Skip to content

Commit a4d1602

Browse files
authored
Merge pull request #170 from apsinghdev/chore/fix-sheet
ui: make sheet mob. responsive
2 parents 5ae9a14 + bba2b43 commit a4d1602

File tree

7 files changed

+272
-203
lines changed

7 files changed

+272
-203
lines changed

apps/web/next.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ const nextConfig = {
1212
},
1313
],
1414
},
15+
experimental: {
16+
optimizePackageImports: ['lucide-react', '@heroicons/react'],
17+
},
18+
swcMinify: true,
1519
};
1620

1721
module.exports = nextConfig;

apps/web/src/app/(main)/dashboard/account/page.tsx

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,61 +3,67 @@
33
import { useSubscription } from "@/hooks/useSubscription";
44
import Link from "next/link";
55
import { ArrowLeft } from "lucide-react";
6+
import { memo, useMemo } from "react";
7+
import { ActiveTag } from "@/components/ui/ActiveTag";
8+
9+
const AccountPageContent = memo(function AccountPageContent({
10+
isPaidUser,
11+
}: {
12+
isPaidUser: boolean;
13+
}) {
14+
const plan = useMemo(() => (isPaidUser ? "Pro" : "Free"), [isPaidUser]);
15+
16+
return (
17+
<>
18+
<div className="mb-6">
19+
<Link
20+
href="/dashboard/home"
21+
className="inline-flex items-center gap-2 text-ox-purple hover:text-ox-purple-2 transition-colors mb-4"
22+
>
23+
<ArrowLeft className="h-4 w-4" />
24+
<span>Back to Dashboard</span>
25+
</Link>
26+
<h1 className="text-2xl md:text-3xl font-semibold text-white">
27+
Account Settings
28+
</h1>
29+
</div>
30+
31+
<div className="bg-ox-sidebar border border-ox-header rounded-lg p-6 max-w-2xl">
32+
<div className="space-y-4">
33+
<div>
34+
<label className="text-sm text-zinc-400 mb-2 block">Plan</label>
35+
<div className="flex items-center gap-2">
36+
<span className="text-lg font-semibold text-white">{plan}</span>
37+
{isPaidUser && <ActiveTag />}
38+
</div>
39+
</div>
40+
{!isPaidUser && (
41+
<div>
42+
<Link
43+
href="/pricing"
44+
className="inline-flex items-center justify-center px-3 py-1.5 bg-ox-purple hover:bg-ox-purple-2 text-white rounded-md transition-colors text-xs font-medium"
45+
>
46+
be a pro
47+
</Link>
48+
</div>
49+
)}
50+
</div>
51+
</div>
52+
</>
53+
);
54+
});
655

756
export default function AccountPage() {
857
const { isPaidUser, isLoading } = useSubscription();
958

10-
const plan = isPaidUser ? "Pro" : "Free";
11-
1259
return (
1360
<div className="w-full h-full flex flex-col p-6 bg-ox-content">
1461
{isLoading ? (
1562
<div className="flex items-center justify-center h-full">
1663
<span className="text-zinc-400">Loading...</span>
1764
</div>
1865
) : (
19-
<>
20-
<div className="mb-6">
21-
<Link
22-
href="/dashboard/home"
23-
className="inline-flex items-center gap-2 text-ox-purple hover:text-ox-purple-2 transition-colors mb-4"
24-
>
25-
<ArrowLeft className="h-4 w-4" />
26-
<span>Back to Dashboard</span>
27-
</Link>
28-
<h1 className="text-2xl md:text-3xl font-semibold text-white">
29-
Account Settings
30-
</h1>
31-
</div>
32-
33-
<div className="bg-ox-sidebar border border-ox-header rounded-lg p-6 max-w-2xl">
34-
<div className="space-y-4">
35-
<div>
36-
<label className="text-sm text-zinc-400 mb-2 block">Plan</label>
37-
<div className="flex items-center gap-2">
38-
<span className="text-lg font-semibold text-white">
39-
{plan}
40-
</span>
41-
{isPaidUser && (
42-
<span className="px-2 py-0.5 rounded-full bg-ox-purple/20 border border-ox-purple text-ox-purple text-xs font-medium">
43-
Active
44-
</span>
45-
)}
46-
</div>
47-
</div>
48-
{!isPaidUser && (
49-
<div>
50-
<Link
51-
href="/pricing"
52-
className="inline-flex items-center justify-center px-3 py-1.5 bg-ox-purple hover:bg-ox-purple-2 text-white rounded-md transition-colors text-xs font-medium"
53-
>
54-
be a pro
55-
</Link>
56-
</div>
57-
)}
58-
</div>
59-
</div>
60-
</>
66+
<AccountPageContent isPaidUser={isPaidUser} />
6167
)}
6268
</div>
6369
);

0 commit comments

Comments
 (0)