Skip to content

Commit

Permalink
Move page title into content layout
Browse files Browse the repository at this point in the history
  • Loading branch information
salimi-my committed May 11, 2024
1 parent 9ea076b commit 7e512b6
Show file tree
Hide file tree
Showing 35 changed files with 737 additions and 661 deletions.
63 changes: 33 additions & 30 deletions app/(admin)/about/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
import { Skeleton } from '@/components/ui/skeleton';
import { ContentLayout } from '@/components/admin-panel/content-layout';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';

export default function AboutLoading() {
return (
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>
<Skeleton className='h-7 w-[100px]' />
</CardTitle>
<Skeleton className='h-5 w-[300px]' />
</CardHeader>
<CardContent>
<div className='flex flex-col gap-4'>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
<ContentLayout title='About'>
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>
<Skeleton className='h-7 w-[100px]' />
</CardTitle>
<Skeleton className='h-5 w-[300px]' />
</CardHeader>
<CardContent>
<div className='flex flex-col gap-4'>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-[118px] w-full' />
</div>
<div>
<Skeleton className='h-9 w-24 mt-2' />
</div>
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-[118px] w-full' />
</div>
<div>
<Skeleton className='h-9 w-24 mt-2' />
</div>
</div>
</CardContent>
</Card>
</CardContent>
</Card>
</ContentLayout>
);
}
31 changes: 17 additions & 14 deletions app/(admin)/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { redirect } from 'next/navigation';
import prismadb from '@/lib/prismadb';
import { currentUser } from '@/lib/authentication';
import AboutForm from '@/components/admin/about-form';
import { ContentLayout } from '@/components/admin-panel/content-layout';
import {
Card,
CardContent,
CardDescription,
CardTitle,
CardHeader,
CardTitle
CardContent,
CardDescription
} from '@/components/ui/card';

export default async function AboutPage() {
Expand All @@ -25,16 +26,18 @@ export default async function AboutPage() {
});

return (
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>About</CardTitle>
<CardDescription>
Manage your about section informations.
</CardDescription>
</CardHeader>
<CardContent>
<AboutForm about={about} />
</CardContent>
</Card>
<ContentLayout title='About'>
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>About</CardTitle>
<CardDescription>
Manage your about section informations.
</CardDescription>
</CardHeader>
<CardContent>
<AboutForm about={about} />
</CardContent>
</Card>
</ContentLayout>
);
}
111 changes: 57 additions & 54 deletions app/(admin)/account/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,63 +1,66 @@
import { Skeleton } from '@/components/ui/skeleton';
import { ContentLayout } from '@/components/admin-panel/content-layout';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';

export default function AccountLoading() {
return (
<div className='grid lg:grid-cols-2 gap-4'>
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>
<Skeleton className='h-7 w-[100px]' />
</CardTitle>
<Skeleton className='h-5 w-[300px]' />
</CardHeader>
<CardContent>
<div className='flex flex-col gap-4'>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
<ContentLayout title='Account'>
<div className='grid lg:grid-cols-2 gap-4'>
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>
<Skeleton className='h-7 w-[100px]' />
</CardTitle>
<Skeleton className='h-5 w-[300px]' />
</CardHeader>
<CardContent>
<div className='flex flex-col gap-4'>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div>
<Skeleton className='h-9 w-24 mt-2' />
</div>
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</CardContent>
</Card>
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>
<Skeleton className='h-7 w-[100px]' />
</CardTitle>
<Skeleton className='h-5 w-[300px]' />
</CardHeader>
<CardContent>
<div className='flex flex-col gap-4'>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div>
<Skeleton className='h-9 w-24 mt-2' />
</div>
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div>
<Skeleton className='h-9 w-24 mt-2' />
</div>
</div>
</CardContent>
</Card>
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>
<Skeleton className='h-7 w-[100px]' />
</CardTitle>
<Skeleton className='h-5 w-[300px]' />
</CardHeader>
<CardContent>
<div className='flex flex-col gap-4'>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div className='space-y-2'>
<Skeleton className='h-5 w-[150px]' />
<Skeleton className='h-9 w-full' />
</div>
<div>
<Skeleton className='h-9 w-24 mt-2' />
</div>
</div>
</CardContent>
</Card>
</div>
</CardContent>
</Card>
</div>
</ContentLayout>
);
}
53 changes: 28 additions & 25 deletions app/(admin)/account/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import prismadb from '@/lib/prismadb';
import { currentUser } from '@/lib/authentication';
import ProfileForm from '@/components/admin/profile-form';
import PasswordForm from '@/components/admin/password-form';
import { ContentLayout } from '@/components/admin-panel/content-layout';
import {
Card,
CardContent,
CardDescription,
CardTitle,
CardHeader,
CardTitle
CardContent,
CardDescription
} from '@/components/ui/card';

export default async function AccountPage() {
Expand All @@ -31,27 +32,29 @@ export default async function AccountPage() {
});

return (
<div className='grid lg:grid-cols-2 gap-4'>
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>Profile</CardTitle>
<CardDescription>
Manage your account profile informations.
</CardDescription>
</CardHeader>
<CardContent>
<ProfileForm user={loggedInUser} />
</CardContent>
</Card>
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>Password</CardTitle>
<CardDescription>Manage your account password.</CardDescription>
</CardHeader>
<CardContent>
<PasswordForm />
</CardContent>
</Card>
</div>
<ContentLayout title='Account'>
<div className='grid lg:grid-cols-2 gap-4'>
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>Profile</CardTitle>
<CardDescription>
Manage your account profile informations.
</CardDescription>
</CardHeader>
<CardContent>
<ProfileForm user={loggedInUser} />
</CardContent>
</Card>
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>Password</CardTitle>
<CardDescription>Manage your account password.</CardDescription>
</CardHeader>
<CardContent>
<PasswordForm />
</CardContent>
</Card>
</div>
</ContentLayout>
);
}
5 changes: 3 additions & 2 deletions app/(admin)/dashboard/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Skeleton } from '@/components/ui/skeleton';
import { ContentLayout } from '@/components/admin-panel/content-layout';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';

export default function DashboardLoading() {
return (
<>
<ContentLayout title='Dashboard'>
<div className='flex items-center justify-between mb-4'>
<Skeleton className='h-9 w-[222px]' />
<div className='flex items-center'>
Expand Down Expand Up @@ -68,6 +69,6 @@ export default function DashboardLoading() {
</CardContent>
</Card>
</div>
</>
</ContentLayout>
);
}
11 changes: 6 additions & 5 deletions app/(admin)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import { currentUser } from '@/lib/authentication';
import MiniCard from '@/components/admin/mini-card';
import RecentProject from '@/components/admin/recent-project';
import QualificationTab from '@/components/admin/qualification-tab';
import { ContentLayout } from '@/components/admin-panel/content-layout';
import {
Card,
CardContent,
CardDescription,
CardTitle,
CardHeader,
CardTitle
CardContent,
CardDescription
} from '@/components/ui/card';

export default async function DashboardPage() {
Expand Down Expand Up @@ -90,7 +91,7 @@ export default async function DashboardPage() {
: 0;

return (
<>
<ContentLayout title='Dashboard'>
<div className='flex items-center justify-between mb-4'>
<h2 className='text-2xl md:text-3xl font-bold tracking-tight'>
Welcome {user.name}
Expand Down Expand Up @@ -171,6 +172,6 @@ export default async function DashboardPage() {
</CardContent>
</Card>
</div>
</>
</ContentLayout>
);
}
Loading

0 comments on commit 7e512b6

Please sign in to comment.