Skip to content

Commit 1b5556d

Browse files
committed
more cleanups
1 parent a4fce80 commit 1b5556d

File tree

12 files changed

+80
-39
lines changed

12 files changed

+80
-39
lines changed

apps/dashboard/app/(main)/billing/history/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import dayjs from "dayjs";
1313
import relativeTime from "dayjs/plugin/relativeTime";
1414
import { memo, useMemo } from "react";
1515
import { EmptyState } from "@/components/empty-state";
16+
import { RightSidebar } from "@/components/right-sidebar";
1617
import { Badge } from "@/components/ui/badge";
1718
import { Button } from "@/components/ui/button";
1819
import { Skeleton } from "@/components/ui/skeleton";
@@ -78,7 +79,7 @@ export default function HistoryPage() {
7879
</div>
7980

8081
{/* Sidebar - Subscription History + Actions */}
81-
<div className="flex w-full shrink-0 flex-col border-t bg-card lg:h-full lg:w-auto lg:overflow-y-auto lg:border-t-0 lg:border-l">
82+
<RightSidebar>
8283
{/* Subscription Changes */}
8384
<div className="border-b p-5">
8485
<h3 className="font-semibold">Subscription History</h3>
@@ -110,7 +111,7 @@ export default function HistoryPage() {
110111
</Button>
111112
</div>
112113
</div>
113-
</div>
114+
</RightSidebar>
114115
</div>
115116
</main>
116117
);

apps/dashboard/app/(main)/organizations/components/general-settings.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
} from "@phosphor-icons/react";
88
import { useState } from "react";
99
import { toast } from "sonner";
10+
import { RightSidebar } from "@/components/right-sidebar";
1011
import { Button } from "@/components/ui/button";
1112
import { Input } from "@/components/ui/input";
1213
import { Label } from "@/components/ui/label";
@@ -120,7 +121,7 @@ export function GeneralSettings({
120121
</div>
121122

122123
{/* Sidebar */}
123-
<aside className="flex flex-col gap-4 bg-card p-5">
124+
<RightSidebar className="gap-4 p-5">
124125
{/* Org Info Card */}
125126
<div className="flex items-center gap-3 rounded border bg-background p-4">
126127
<div className="flex h-10 w-10 items-center justify-center rounded bg-secondary">
@@ -139,20 +140,20 @@ export function GeneralSettings({
139140
</div>
140141

141142
{/* Docs Link */}
142-
<Button asChild className="w-full justify-start" variant="outline">
143+
<Button asChild className="w-full justify-start" variant="secondary">
143144
<a
144145
href="https://www.databuddy.cc/docs/getting-started"
145146
rel="noopener noreferrer"
146147
target="_blank"
147148
>
148-
<BookOpenIcon className="mr-2" size={16} />
149+
<BookOpenIcon size={16} />
149150
Documentation
150151
</a>
151152
</Button>
152153

153154
{/* Tip */}
154155
<Tip description="The slug is used in URLs and API requests. Keep it short and memorable." />
155-
</aside>
156+
</RightSidebar>
156157
</div>
157158
);
158159
}

apps/dashboard/app/(main)/organizations/components/organizations-list.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { useState } from "react";
1616
import { toast } from "sonner";
1717
import { CreateOrganizationDialog } from "@/components/organizations/create-organization-dialog";
1818
import type { Organization } from "@/components/providers/organizations-provider";
19+
import { RightSidebar } from "@/components/right-sidebar";
1920
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
2021
import { Badge } from "@/components/ui/badge";
2122
import { Button } from "@/components/ui/button";
@@ -49,12 +50,12 @@ function EmptyState() {
4950
);
5051
}
5152

52-
interface OrganizationRowProps {
53+
type OrganizationRowProps = {
5354
organization: Organization;
5455
isActive: boolean;
5556
isProcessing: boolean;
5657
onClick: () => void;
57-
}
58+
};
5859

5960
function OrganizationRow({
6061
organization,
@@ -65,8 +66,7 @@ function OrganizationRow({
6566
return (
6667
<button
6768
className={cn(
68-
"group relative grid w-full cursor-pointer grid-cols-[auto_1fr_auto_auto] items-center gap-4 px-5 py-3 text-left transition-colors",
69-
isActive ? "bg-card hover:bg-secondary" : "hover:bg-accent",
69+
"group relative grid w-full cursor-pointer grid-cols-[auto_1fr_auto_auto] items-center gap-4 px-5 py-3 text-left transition-colors hover:bg-accent",
7070
isProcessing && "pointer-events-none opacity-60"
7171
)}
7272
onClick={onClick}
@@ -153,7 +153,7 @@ export function OrganizationsList({
153153
return (
154154
<div className="h-full lg:grid lg:grid-cols-[1fr_18rem]">
155155
{/* Organizations List */}
156-
<div className="flex flex-col border-b lg:border-r lg:border-b-0">
156+
<div className="flex flex-col border-b lg:border-b-0">
157157
<div className="flex-1 divide-y overflow-y-auto">
158158
{organizations.map((org) => (
159159
<OrganizationRow
@@ -168,7 +168,7 @@ export function OrganizationsList({
168168
</div>
169169

170170
{/* Sidebar */}
171-
<aside className="flex flex-col gap-4 bg-card p-5">
171+
<RightSidebar className="gap-4 p-5">
172172
{/* Create Button */}
173173
<Button
174174
className="w-full"
@@ -196,7 +196,7 @@ export function OrganizationsList({
196196

197197
{/* Tip */}
198198
<Tip description="Click on an organization to switch to it. The active organization is used across the dashboard." />
199-
</aside>
199+
</RightSidebar>
200200
</div>
201201
);
202202
}

apps/dashboard/app/(main)/organizations/invitations/invitations-view.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import { useState } from "react";
1313
import { EmptyState } from "@/components/empty-state";
1414
import { InviteMemberDialog } from "@/components/organizations/invite-member-dialog";
15+
import { RightSidebar } from "@/components/right-sidebar";
1516
import { Button } from "@/components/ui/button";
1617
import { Skeleton } from "@/components/ui/skeleton";
1718
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
@@ -265,7 +266,7 @@ export function InvitationsView({
265266
</div>
266267

267268
{/* Sidebar */}
268-
<aside className="flex flex-col gap-4 bg-muted/30 p-5">
269+
<RightSidebar className="gap-4 p-5">
269270
{/* Invite Button */}
270271
<Button className="w-full" onClick={() => setShowInviteDialog(true)}>
271272
<UserPlusIcon className="mr-2" size={16} />
@@ -293,20 +294,20 @@ export function InvitationsView({
293294
</div>
294295

295296
{/* Docs Link */}
296-
<Button asChild className="w-full justify-start" variant="outline">
297+
<Button asChild className="w-full justify-start" variant="secondary">
297298
<a
298299
href="https://www.databuddy.cc/docs/getting-started"
299300
rel="noopener noreferrer"
300301
target="_blank"
301302
>
302-
<BookOpenIcon className="mr-2" size={16} />
303+
<BookOpenIcon size={16} />
303304
Documentation
304305
</a>
305306
</Button>
306307

307308
{/* Tip */}
308309
<Tip description="Invitations expire after 7 days. Resend if needed from the pending tab." />
309-
</aside>
310+
</RightSidebar>
310311
</div>
311312

312313
<InviteMemberDialog

apps/dashboard/app/(main)/organizations/members/members-view.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from "@phosphor-icons/react";
99
import { useState } from "react";
1010
import { InviteMemberDialog } from "@/components/organizations/invite-member-dialog";
11+
import { RightSidebar } from "@/components/right-sidebar";
1112
import { Button } from "@/components/ui/button";
1213
import { Skeleton } from "@/components/ui/skeleton";
1314
import { Tip } from "@/components/ui/tip";
@@ -113,7 +114,7 @@ export function MembersView({
113114
<>
114115
<div className="h-full lg:grid lg:grid-cols-[1fr_18rem]">
115116
{/* Members List */}
116-
<div className="flex flex-col border-b lg:border-r lg:border-b-0">
117+
<div className="flex flex-col border-b lg:border-b-0">
117118
<div className="flex-1 divide-y overflow-y-auto">
118119
<MemberList
119120
isRemovingMember={isRemovingMember}
@@ -127,7 +128,7 @@ export function MembersView({
127128
</div>
128129

129130
{/* Sidebar */}
130-
<aside className="flex flex-col gap-4 bg-card p-5">
131+
<RightSidebar className="gap-4 p-5">
131132
{/* Invite Button */}
132133
<Button className="w-full" onClick={() => setShowInviteDialog(true)}>
133134
<UserPlusIcon className="mr-2" size={16} />
@@ -136,8 +137,12 @@ export function MembersView({
136137

137138
{/* Stats Card */}
138139
<div className="flex items-center gap-3 rounded border bg-background p-4">
139-
<div className="flex h-10 w-10 items-center justify-center rounded bg-primary/10">
140-
<UsersIcon className="text-primary" size={20} weight="duotone" />
140+
<div className="flex h-10 w-10 items-center justify-center rounded bg-accent">
141+
<UsersIcon
142+
className="text-accent-foreground"
143+
size={20}
144+
weight="duotone"
145+
/>
141146
</div>
142147
<div>
143148
<p className="font-semibold tabular-nums">{members.length}</p>
@@ -148,20 +153,20 @@ export function MembersView({
148153
</div>
149154

150155
{/* Docs Link */}
151-
<Button asChild className="w-full justify-start" variant="outline">
156+
<Button asChild className="w-full justify-start" variant="secondary">
152157
<a
153158
href="https://www.databuddy.cc/docs/getting-started"
154159
rel="noopener noreferrer"
155160
target="_blank"
156161
>
157-
<BookOpenIcon className="mr-2" size={16} />
162+
<BookOpenIcon size={16} />
158163
Documentation
159164
</a>
160165
</Button>
161166

162167
{/* Tip */}
163168
<Tip description="Admins can manage settings and invite members. Members have read-only access to analytics." />
164-
</aside>
169+
</RightSidebar>
165170
</div>
166171

167172
<InviteMemberDialog

apps/dashboard/app/(main)/organizations/settings/api-keys/api-key-settings.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { useState } from "react";
1111
import { EmptyState } from "@/components/empty-state";
1212
import { ApiKeyCreateDialog } from "@/components/organizations/api-key-create-dialog";
1313
import { ApiKeyDetailDialog } from "@/components/organizations/api-key-detail-dialog";
14+
import { RightSidebar } from "@/components/right-sidebar";
1415
import { Button } from "@/components/ui/button";
1516
import { Skeleton } from "@/components/ui/skeleton";
1617
import type { Organization } from "@/hooks/use-organizations";
@@ -112,7 +113,7 @@ export function ApiKeySettings({ organization }: ApiKeySettingsProps) {
112113
</div>
113114

114115
{/* Sidebar */}
115-
<aside className="flex flex-col gap-4 bg-card p-5">
116+
<RightSidebar className="gap-4 p-5">
116117
{/* Create Button */}
117118
<Button className="w-full" onClick={() => setShowCreateDialog(true)}>
118119
<PlusIcon className="mr-2" size={16} />
@@ -142,13 +143,13 @@ export function ApiKeySettings({ organization }: ApiKeySettingsProps) {
142143
)}
143144

144145
{/* Actions */}
145-
<Button asChild className="w-full justify-start" variant="outline">
146+
<Button asChild className="w-full justify-start" variant="secondary">
146147
<a
147148
href="https://www.databuddy.cc/docs/getting-started"
148149
rel="noopener noreferrer"
149150
target="_blank"
150151
>
151-
<BookOpenIcon className="mr-2" size={16} />
152+
<BookOpenIcon size={16} />
152153
Documentation
153154
</a>
154155
</Button>
@@ -161,7 +162,7 @@ export function ApiKeySettings({ organization }: ApiKeySettingsProps) {
161162
them to version control.
162163
</p>
163164
</div>
164-
</aside>
165+
</RightSidebar>
165166
</div>
166167

167168
<ApiKeyCreateDialog

apps/dashboard/app/(main)/organizations/settings/danger/danger-zone-settings.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { useRouter } from "next/navigation";
1111
import { useEffect, useState } from "react";
1212
import { toast } from "sonner";
1313
import { NoticeBanner } from "@/app/(main)/websites/_components/notice-banner";
14+
import { RightSidebar } from "@/components/right-sidebar";
1415
import {
1516
AlertDialog,
1617
AlertDialogAction,
@@ -160,15 +161,15 @@ export function DangerZoneSettings({
160161
</div>
161162

162163
{/* Sidebar */}
163-
<aside className="flex flex-col gap-4 bg-card p-5">
164+
<RightSidebar className="gap-4 p-5">
164165
{/* Docs Link */}
165-
<Button asChild className="w-full justify-start" variant="outline">
166+
<Button asChild className="w-full justify-start" variant="secondary">
166167
<a
167168
href="https://www.databuddy.cc/docs/getting-started"
168169
rel="noopener noreferrer"
169170
target="_blank"
170171
>
171-
<BookOpenIcon className="mr-2" size={16} />
172+
<BookOpenIcon size={16} />
172173
Documentation
173174
</a>
174175
</Button>
@@ -178,7 +179,7 @@ export function DangerZoneSettings({
178179
description="Contact support if you need to recover deleted data or transfer ownership of an organization."
179180
title="Need help?"
180181
/>
181-
</aside>
182+
</RightSidebar>
182183

183184
{/* Delete Dialog */}
184185
<AlertDialog onOpenChange={setShowDeleteDialog} open={showDeleteDialog}>

apps/dashboard/app/(main)/organizations/settings/websites/website-settings.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import { useQuery } from "@tanstack/react-query";
1111
import Link from "next/link";
1212
import { FaviconImage } from "@/components/analytics/favicon-image";
13+
import { RightSidebar } from "@/components/right-sidebar";
1314
import { Button } from "@/components/ui/button";
1415
import { Skeleton } from "@/components/ui/skeleton";
1516
import { Tip } from "@/components/ui/tip";
@@ -150,7 +151,7 @@ export function WebsiteSettings({
150151
</div>
151152

152153
{/* Sidebar */}
153-
<aside className="flex flex-col gap-4 bg-card p-5">
154+
<RightSidebar className="gap-4 p-5">
154155
{/* Add Website Button */}
155156
<Button asChild className="w-full">
156157
<Link href="/websites">
@@ -173,20 +174,20 @@ export function WebsiteSettings({
173174
</div>
174175

175176
{/* Docs Link */}
176-
<Button asChild className="w-full justify-start" variant="outline">
177+
<Button asChild className="w-full justify-start" variant="secondary">
177178
<a
178179
href="https://www.databuddy.cc/docs/getting-started"
179180
rel="noopener noreferrer"
180181
target="_blank"
181182
>
182-
<BookOpenIcon className="mr-2" size={16} />
183+
<BookOpenIcon size={16} />
183184
Documentation
184185
</a>
185186
</Button>
186187

187188
{/* Tip */}
188189
<Tip description="Click on a website to view its settings, manage tracking scripts, and configure analytics." />
189-
</aside>
190+
</RightSidebar>
190191
</div>
191192
);
192193
}

apps/dashboard/components/organizations/api-key-detail-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export function ApiKeyDetailDialog({
199199
<>
200200
<Sheet onOpenChange={handleClose} open={open}>
201201
<SheetContent
202-
className="m-3 h-[calc(100%-1.5rem)] rounded border bg-background p-0 sm:max-w-md"
202+
className="m-3 h-[calc(100%-1.5rem)] rounded border p-0 sm:max-w-md"
203203
side="right"
204204
>
205205
{isLoading || !detail ? (

apps/dashboard/components/organizations/create-organization-dialog.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
"use client";
22

3-
import { UploadSimpleIcon, UsersIcon } from "@phosphor-icons/react";
3+
import {
4+
BuildingsIcon,
5+
UploadSimpleIcon,
6+
UsersIcon,
7+
} from "@phosphor-icons/react";
48
import Image from "next/image";
59
// import { useRouter } from 'next/navigation';
610
import { useEffect, useMemo, useRef, useState } from "react";
@@ -275,6 +279,13 @@ export function CreateOrganizationDialog({
275279
>
276280
<SheetHeader>
277281
<div className="flex flex-col gap-3 sm:flex-row sm:items-center">
282+
<div className="flex h-11 w-11 items-center justify-center rounded border bg-secondary-brighter">
283+
<BuildingsIcon
284+
className="text-foreground"
285+
size={22}
286+
weight="fill"
287+
/>
288+
</div>
278289
<div className="min-w-0 flex-1">
279290
<SheetTitle className="text-foreground text-lg">
280291
Create New Organization

0 commit comments

Comments
 (0)