Skip to content

Commit

Permalink
feat/create project under organization
Browse files Browse the repository at this point in the history
  • Loading branch information
psiddharthdesign committed Jul 19, 2024
1 parent 0a57901 commit 6a8ed06
Show file tree
Hide file tree
Showing 24 changed files with 778 additions and 583 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ProFeatureGateDialog } from '@/components/ProFeatureGateDialog';
import { SidebarLink } from '@/components/SidebarLink';
import { fetchSlimOrganizations, getOrganizationSlugByOrganizationId } from '@/data/user/organizations';
import { cn } from '@/utils/cn';
Expand All @@ -8,9 +7,7 @@ import { Suspense } from 'react';

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

async function OrganizationSidebarInternal({
organizationId,
Expand All @@ -20,63 +17,60 @@ async function OrganizationSidebarInternal({
organizationSlug: string;
}) {
const slimOrganizations = await fetchSlimOrganizations();

return (
<div
className={cn(
'flex flex-col justify-between h-full',
'lg:px-3 lg:py-4 lg:pt-2.5 ',
'flex flex-col h-full',
'lg:px-3 lg:py-4',
)}
>
<div>

<div className="flex justify-between items-center">
<SwitcherAndToggle organizationId={organizationId} slimOrganizations={slimOrganizations} />
</div>
<div className="flex flex-col gap-6 h-full overflow-y-auto mt-4">
<div>
<SidebarLink
label="Home"
href={`/org/${organizationId}`}
icon={<Home className="h-5 w-5" />}
/>
<SidebarLink
label="Settings"
href={`/org/${organizationId}/settings`}
icon={<Settings className="h-5 w-5" />}
/>
<SidebarLink
label="Projects"
href={` /org/${organizationId}/projects`}
icon={<Layers className="h-5 w-5" />}
/>
<SidebarLink
label="Members"
href={`/org/${organizationId}/settings/members`}
icon={<UserRound className="h-5 w-5" />}
/>
<SidebarLink
label="Billing"
href={`/org/${organizationId}/settings/billing`}
icon={<DollarSign className="h-5 w-5" />}
/>
<Suspense>
<ProFeatureGateDialog
organizationId={organizationId}
label="Feature Pro"
icon={<FileBox className="h-5 w-5" />}
/>
</Suspense>
</div>
</div>
<div className="flex justify-between items-center mb-4">
<SwitcherAndToggle organizationId={organizationId} slimOrganizations={slimOrganizations} />
</div>
<div className="flex flex-col gap-4">
<Suspense fallback={<T.P>Loading subscription details...</T.P>}>
<div>
<SubscriptionCardSmall organizationSlug={organizationSlug} organizationId={organizationId} />
</div>
</Suspense>


<div className="flex flex-col gap-0">
<SidebarLink
label="Home"
href={`/org/${organizationId}`}
icon={<Home className="size-4 text-foreground" />}
/>
<SidebarLink
label="Projects"
href={`/org/${organizationId}/projects`}
icon={<Layers className="size-4 text-foreground" />}
/>
<SidebarLink
label="Activity"
href={`/org/${organizationId}/activity`}
icon={<Activity className="size-4 text-foreground" />}
/>
<SidebarLink
label="Policies"
href={`/org/${organizationId}/policies`}
icon={<Shield className="size-4 text-foreground" />}
/>
<SidebarLink
label="Drift"
href={`/org/${organizationId}/drift`}
icon={<GitCompare className="size-4 text-foreground" />}
/>
<SidebarLink
label="Docs"
href={`/org/${organizationId}/docs`}
icon={<FileText className="size-4 text-foreground" />}
/>
<SidebarLink
label="Admin"
href={`/org/${organizationId}/admin`}
icon={<Settings className="size-4 text-foreground" />}
/>
<SidebarLink
label="Ask in Slack"
href="#"
icon={<MessageCircle className="size-4 text-foreground" />}
/>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { ProFeatureGateDialog } from '@/components/ProFeatureGateDialog';
import { SidebarLink } from '@/components/SidebarLink';
import { SubscriptionCardSmall } from '@/components/SubscriptionCardSmall';
import { T } from '@/components/ui/Typography';
import { fetchSlimOrganizations, getOrganizationSlugByOrganizationId } from '@/data/user/organizations';
import { cn } from '@/utils/cn';
import { notFound } from 'next/navigation';
import { Suspense } from 'react';

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

async function OrganizationSidebarInternal({
organizationId,
Expand All @@ -24,58 +21,56 @@ async function OrganizationSidebarInternal({
return (
<div
className={cn(
'flex flex-col justify-between h-full',
'lg:px-3 lg:py-4 lg:pt-2.5 ',
'flex flex-col h-full',
'lg:px-3 lg:py-4',
)}
>
<div>
<div className="flex justify-between items-center">
<SwitcherAndToggle organizationId={organizationId} slimOrganizations={slimOrganizations} />
</div>
<div className="flex flex-col gap-6 h-full overflow-y-auto mt-4">
<div>
<SidebarLink
label="Home"
href={`/org/${organizationId}`}
icon={<Home className="h-5 w-5" />}
/>
<SidebarLink
label="Projects"
href={`/org/${organizationId}/projects`}
icon={<Layers className="h-5 w-5" />}
/>
<SidebarLink
label="Settings"
href={`/org/${organizationId}/settings`}
icon={<Settings className="h-5 w-5" />}
/>
<SidebarLink
label="Members"
href={`/org/${organizationId}/settings/members`}
icon={<UserRound className="h-5 w-5" />}
/>
<SidebarLink
label="Billing"
href={`/org/${organizationId}/settings/billing`}
icon={<DollarSign className="h-5 w-5" />}
/>
<Suspense>
<ProFeatureGateDialog
organizationId={organizationId}
label="Feature Pro"
icon={<FileBox className="h-5 w-5" />}
/>
</Suspense>
</div>
{/* <TeamsList organizationId={organizationId} /> */}
</div>
</div>
<div className="flex flex-col gap-4">
<Suspense fallback={<T.P>Loading subscription details...</T.P>}>
<SubscriptionCardSmall organizationSlug={organizationSlug} organizationId={organizationId} />
</Suspense>

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

<div className="flex flex-col gap-0">
<SidebarLink
label="Home"
href={`/org/${organizationId}`}
icon={<Home className="size-4 text-foreground" />}
/>
<SidebarLink
label="Projects"
href={`/org/${organizationId}/projects`}
icon={<Layers className="size-4 text-foreground" />}
/>
<SidebarLink
label="Activity"
href={`/org/${organizationId}/activity`}
icon={<Activity className="size-4 text-foreground" />}
/>
<SidebarLink
label="Policies"
href={`/org/${organizationId}/policies`}
icon={<Shield className="size-4 text-foreground" />}
/>
<SidebarLink
label="Drift"
href={`/org/${organizationId}/drift`}
icon={<GitCompare className="size-4 text-foreground" />}
/>
<SidebarLink
label="Docs"
href={`/org/${organizationId}/docs`}
icon={<FileText className="size-4 text-foreground" />}
/>
<SidebarLink
label="Admin"
href={`/org/${organizationId}/admin`}
icon={<Settings className="size-4 text-foreground" />}
/>
<SidebarLink
label="Ask in Slack"
href="#"
icon={<MessageCircle className="size-4 text-foreground" />}
/>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function Dashboard({ params, searchParams }: DashboardProps) {
<FileText className="mr-2 h-4 w-4" />
Export PDF
</Button>
<Link href={`/org/${organizationId}/create-project`}>
<Link href={`/org/${organizationId}/projects/create`}>
<Button variant="default" size="sm">
<Plus className="mr-2 h-4 w-4" />
Create Project
Expand Down
Loading

0 comments on commit 6a8ed06

Please sign in to comment.