Skip to content

Commit b1309d1

Browse files
Merge pull request #3 from diggerhq/feature/projects-and-repos
feat/create project under organization
2 parents 0a57901 + 6a8ed06 commit b1309d1

File tree

24 files changed

+778
-583
lines changed

24 files changed

+778
-583
lines changed

src/app/(dynamic-pages)/(authenticated-pages)/(application-pages)/org/[organizationId]/(specific-organization-pages)/@sidebar/OrganizationSidebar.tsx

+47-53
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ProFeatureGateDialog } from '@/components/ProFeatureGateDialog';
21
import { SidebarLink } from '@/components/SidebarLink';
32
import { fetchSlimOrganizations, getOrganizationSlugByOrganizationId } from '@/data/user/organizations';
43
import { cn } from '@/utils/cn';
@@ -8,9 +7,7 @@ import { Suspense } from 'react';
87

98
import { DesktopSidebarFallback } from '@/components/SidebarComponents/SidebarFallback';
109
import { SwitcherAndToggle } from '@/components/SidebarComponents/SidebarLogo';
11-
import { SubscriptionCardSmall } from '@/components/SubscriptionCardSmall';
12-
import { T } from '@/components/ui/Typography';
13-
import { DollarSign, FileBox, Home, Layers, Settings, UserRound } from 'lucide-react';
10+
import { Activity, FileText, GitCompare, Home, Layers, MessageCircle, Settings, Shield } from 'lucide-react';
1411

1512
async function OrganizationSidebarInternal({
1613
organizationId,
@@ -20,63 +17,60 @@ async function OrganizationSidebarInternal({
2017
organizationSlug: string;
2118
}) {
2219
const slimOrganizations = await fetchSlimOrganizations();
20+
2321
return (
2422
<div
2523
className={cn(
26-
'flex flex-col justify-between h-full',
27-
'lg:px-3 lg:py-4 lg:pt-2.5 ',
24+
'flex flex-col h-full',
25+
'lg:px-3 lg:py-4',
2826
)}
2927
>
30-
<div>
3128

32-
<div className="flex justify-between items-center">
33-
<SwitcherAndToggle organizationId={organizationId} slimOrganizations={slimOrganizations} />
34-
</div>
35-
<div className="flex flex-col gap-6 h-full overflow-y-auto mt-4">
36-
<div>
37-
<SidebarLink
38-
label="Home"
39-
href={`/org/${organizationId}`}
40-
icon={<Home className="h-5 w-5" />}
41-
/>
42-
<SidebarLink
43-
label="Settings"
44-
href={`/org/${organizationId}/settings`}
45-
icon={<Settings className="h-5 w-5" />}
46-
/>
47-
<SidebarLink
48-
label="Projects"
49-
href={` /org/${organizationId}/projects`}
50-
icon={<Layers className="h-5 w-5" />}
51-
/>
52-
<SidebarLink
53-
label="Members"
54-
href={`/org/${organizationId}/settings/members`}
55-
icon={<UserRound className="h-5 w-5" />}
56-
/>
57-
<SidebarLink
58-
label="Billing"
59-
href={`/org/${organizationId}/settings/billing`}
60-
icon={<DollarSign className="h-5 w-5" />}
61-
/>
62-
<Suspense>
63-
<ProFeatureGateDialog
64-
organizationId={organizationId}
65-
label="Feature Pro"
66-
icon={<FileBox className="h-5 w-5" />}
67-
/>
68-
</Suspense>
69-
</div>
70-
</div>
29+
<div className="flex justify-between items-center mb-4">
30+
<SwitcherAndToggle organizationId={organizationId} slimOrganizations={slimOrganizations} />
7131
</div>
72-
<div className="flex flex-col gap-4">
73-
<Suspense fallback={<T.P>Loading subscription details...</T.P>}>
74-
<div>
75-
<SubscriptionCardSmall organizationSlug={organizationSlug} organizationId={organizationId} />
76-
</div>
77-
</Suspense>
78-
7932

33+
<div className="flex flex-col gap-0">
34+
<SidebarLink
35+
label="Home"
36+
href={`/org/${organizationId}`}
37+
icon={<Home className="size-4 text-foreground" />}
38+
/>
39+
<SidebarLink
40+
label="Projects"
41+
href={`/org/${organizationId}/projects`}
42+
icon={<Layers className="size-4 text-foreground" />}
43+
/>
44+
<SidebarLink
45+
label="Activity"
46+
href={`/org/${organizationId}/activity`}
47+
icon={<Activity className="size-4 text-foreground" />}
48+
/>
49+
<SidebarLink
50+
label="Policies"
51+
href={`/org/${organizationId}/policies`}
52+
icon={<Shield className="size-4 text-foreground" />}
53+
/>
54+
<SidebarLink
55+
label="Drift"
56+
href={`/org/${organizationId}/drift`}
57+
icon={<GitCompare className="size-4 text-foreground" />}
58+
/>
59+
<SidebarLink
60+
label="Docs"
61+
href={`/org/${organizationId}/docs`}
62+
icon={<FileText className="size-4 text-foreground" />}
63+
/>
64+
<SidebarLink
65+
label="Admin"
66+
href={`/org/${organizationId}/admin`}
67+
icon={<Settings className="size-4 text-foreground" />}
68+
/>
69+
<SidebarLink
70+
label="Ask in Slack"
71+
href="#"
72+
icon={<MessageCircle className="size-4 text-foreground" />}
73+
/>
8074
</div>
8175
</div>
8276
);

src/app/(dynamic-pages)/(authenticated-pages)/(application-pages)/org/[organizationId]/(specific-organization-pages)/@sidebar/default.tsx

+48-53
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
import { ProFeatureGateDialog } from '@/components/ProFeatureGateDialog';
21
import { SidebarLink } from '@/components/SidebarLink';
3-
import { SubscriptionCardSmall } from '@/components/SubscriptionCardSmall';
4-
import { T } from '@/components/ui/Typography';
5-
import { fetchSlimOrganizations, getOrganizationSlugByOrganizationId } from '@/data/user/organizations';
62
import { cn } from '@/utils/cn';
73
import { notFound } from 'next/navigation';
84
import { Suspense } from 'react';
95

106
import { DesktopSidebarFallback } from '@/components/SidebarComponents/SidebarFallback';
117
import { SwitcherAndToggle } from '@/components/SidebarComponents/SidebarLogo';
8+
import { fetchSlimOrganizations, getOrganizationSlugByOrganizationId } from '@/data/user/organizations';
129
import { organizationParamSchema } from '@/utils/zod-schemas/params';
13-
import { DollarSign, FileBox, Home, Layers, Settings, UserRound } from 'lucide-react';
10+
import { Activity, FileText, GitCompare, Home, Layers, MessageCircle, Settings, Shield } from 'lucide-react';
1411

1512
async function OrganizationSidebarInternal({
1613
organizationId,
@@ -24,58 +21,56 @@ async function OrganizationSidebarInternal({
2421
return (
2522
<div
2623
className={cn(
27-
'flex flex-col justify-between h-full',
28-
'lg:px-3 lg:py-4 lg:pt-2.5 ',
24+
'flex flex-col h-full',
25+
'lg:px-3 lg:py-4',
2926
)}
3027
>
31-
<div>
32-
<div className="flex justify-between items-center">
33-
<SwitcherAndToggle organizationId={organizationId} slimOrganizations={slimOrganizations} />
34-
</div>
35-
<div className="flex flex-col gap-6 h-full overflow-y-auto mt-4">
36-
<div>
37-
<SidebarLink
38-
label="Home"
39-
href={`/org/${organizationId}`}
40-
icon={<Home className="h-5 w-5" />}
41-
/>
42-
<SidebarLink
43-
label="Projects"
44-
href={`/org/${organizationId}/projects`}
45-
icon={<Layers className="h-5 w-5" />}
46-
/>
47-
<SidebarLink
48-
label="Settings"
49-
href={`/org/${organizationId}/settings`}
50-
icon={<Settings className="h-5 w-5" />}
51-
/>
52-
<SidebarLink
53-
label="Members"
54-
href={`/org/${organizationId}/settings/members`}
55-
icon={<UserRound className="h-5 w-5" />}
56-
/>
57-
<SidebarLink
58-
label="Billing"
59-
href={`/org/${organizationId}/settings/billing`}
60-
icon={<DollarSign className="h-5 w-5" />}
61-
/>
62-
<Suspense>
63-
<ProFeatureGateDialog
64-
organizationId={organizationId}
65-
label="Feature Pro"
66-
icon={<FileBox className="h-5 w-5" />}
67-
/>
68-
</Suspense>
69-
</div>
70-
{/* <TeamsList organizationId={organizationId} /> */}
71-
</div>
72-
</div>
73-
<div className="flex flex-col gap-4">
74-
<Suspense fallback={<T.P>Loading subscription details...</T.P>}>
75-
<SubscriptionCardSmall organizationSlug={organizationSlug} organizationId={organizationId} />
76-
</Suspense>
7728

29+
<div className="flex justify-between items-center mb-4">
30+
<SwitcherAndToggle organizationId={organizationId} slimOrganizations={slimOrganizations} />
31+
</div>
7832

33+
<div className="flex flex-col gap-0">
34+
<SidebarLink
35+
label="Home"
36+
href={`/org/${organizationId}`}
37+
icon={<Home className="size-4 text-foreground" />}
38+
/>
39+
<SidebarLink
40+
label="Projects"
41+
href={`/org/${organizationId}/projects`}
42+
icon={<Layers className="size-4 text-foreground" />}
43+
/>
44+
<SidebarLink
45+
label="Activity"
46+
href={`/org/${organizationId}/activity`}
47+
icon={<Activity className="size-4 text-foreground" />}
48+
/>
49+
<SidebarLink
50+
label="Policies"
51+
href={`/org/${organizationId}/policies`}
52+
icon={<Shield className="size-4 text-foreground" />}
53+
/>
54+
<SidebarLink
55+
label="Drift"
56+
href={`/org/${organizationId}/drift`}
57+
icon={<GitCompare className="size-4 text-foreground" />}
58+
/>
59+
<SidebarLink
60+
label="Docs"
61+
href={`/org/${organizationId}/docs`}
62+
icon={<FileText className="size-4 text-foreground" />}
63+
/>
64+
<SidebarLink
65+
label="Admin"
66+
href={`/org/${organizationId}/admin`}
67+
icon={<Settings className="size-4 text-foreground" />}
68+
/>
69+
<SidebarLink
70+
label="Ask in Slack"
71+
href="#"
72+
icon={<MessageCircle className="size-4 text-foreground" />}
73+
/>
7974
</div>
8075
</div>
8176
);

src/app/(dynamic-pages)/(authenticated-pages)/(application-pages)/org/[organizationId]/(specific-organization-pages)/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async function Dashboard({ params, searchParams }: DashboardProps) {
5151
<FileText className="mr-2 h-4 w-4" />
5252
Export PDF
5353
</Button>
54-
<Link href={`/org/${organizationId}/create-project`}>
54+
<Link href={`/org/${organizationId}/projects/create`}>
5555
<Button variant="default" size="sm">
5656
<Plus className="mr-2 h-4 w-4" />
5757
Create Project

0 commit comments

Comments
 (0)