Skip to content

Commit

Permalink
appbar fix
Browse files Browse the repository at this point in the history
  • Loading branch information
keshav-exe committed Sep 15, 2024
1 parent f983590 commit fdab297
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 38 deletions.
15 changes: 13 additions & 2 deletions src/app/admin/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Appbar } from '@/components/Appbar';
import { getServerSession } from 'next-auth';
import { notFound, redirect } from 'next/navigation';
import React from 'react';
Expand All @@ -14,12 +15,22 @@ export default async function AdminLayout({
}

if (process.env.LOCAL_CMS_PROVIDER) {
return <div className="flex min-h-screen w-full py-4">{children}</div>;
return (
<div className="flex min-h-screen w-full py-4">
<Appbar />
{children}
</div>
);
}

if (!process.env.ADMINS?.split(',').includes(session.user.email!)) {
return notFound();
}

return <div className="flex min-h-screen w-full py-4">{children}</div>;
return (
<div className="flex min-h-screen w-full py-4">
<Appbar />
{children}
</div>
);
}
2 changes: 2 additions & 0 deletions src/app/calendar/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getServerSession } from 'next-auth';
import { redirect } from 'next/navigation';
import React from 'react';
import CalendarPageComponent from '@/components/big-calendar/calendar';
import { Appbar } from '@/components/Appbar';

const CalendarPage = async () => {
const session = await getServerSession();
Expand All @@ -14,6 +15,7 @@ const CalendarPage = async () => {

return (
<div className="wrapper flex min-h-screen">
<Appbar />
<CalendarPageComponent isAdmin={isAdmin} />
</div>
);
Expand Down
76 changes: 40 additions & 36 deletions src/app/payout-methods/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import SOL from '../../../public/platform/sol.svg';
import UPI from '../../../public/platform/upi.svg';
import { PayoutMethodCard } from '@/components/PaymentMethodCard';
import { usePayoutMethods } from '@/hooks/usePayoutMethod';
import { Appbar } from '@/components/Appbar';

export default function Page() {
const [isDialogBoxOpen, setIsDialogBoxOpen] = useState<boolean>(false);
Expand All @@ -30,46 +31,49 @@ export default function Page() {
const closeDialog = () => setIsDialogBoxOpen(false);

return (
<div className="wrapper">
<div className="flex flex-col gap-8">
<h2 className="text-2xl font-bold tracking-tighter md:text-3xl">
Payout Methods
</h2>
<>
<Appbar />
<div className="wrapper">
<div className="flex flex-col gap-8">
<h2 className="text-2xl font-bold tracking-tighter md:text-3xl">
Payout Methods
</h2>

<div className="grid w-full grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3">
<PayoutMethodCard
title="UPI Address"
description="Add your UPI ID"
imageSrc={UPI}
addresses={upiAddresses}
id={'UPI'}
onAdd={openDialog}
onDelete={handleUpiDelete}
/>
<PayoutMethodCard
title="Solana Address"
id={'Solana'}
description="Add your Solana wallet id"
imageSrc={SOL}
addresses={solanaAddresses}
onAdd={openDialog}
onDelete={handleSolanaDelete}
/>
</div>
<div className="grid w-full grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3">
<PayoutMethodCard
title="UPI Address"
description="Add your UPI ID"
imageSrc={UPI}
addresses={upiAddresses}
id={'UPI'}
onAdd={openDialog}
onDelete={handleUpiDelete}
/>
<PayoutMethodCard
title="Solana Address"
id={'Solana'}
description="Add your Solana wallet id"
imageSrc={SOL}
addresses={solanaAddresses}
onAdd={openDialog}
onDelete={handleSolanaDelete}
/>
</div>

<NewPayoutDialog
onClose={closeDialog}
isOpen={isDialogBoxOpen}
title={btnClicked}
/>
<NewPayoutDialog
onClose={closeDialog}
isOpen={isDialogBoxOpen}
title={btnClicked}
/>

<h2 className="text-2xl font-bold tracking-tighter md:text-3xl">
Apps
</h2>
<div className="grid w-full grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3">
<GitHubLinkButton />
<h2 className="text-2xl font-bold tracking-tighter md:text-3xl">
Apps
</h2>
<div className="grid w-full grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3">
<GitHubLinkButton />
</div>
</div>
</div>
</div>
</>
);
}

0 comments on commit fdab297

Please sign in to comment.