Skip to content

Commit

Permalink
Update routes
Browse files Browse the repository at this point in the history
  • Loading branch information
salimi-my committed May 8, 2024
1 parent 5467c23 commit d7e05fa
Show file tree
Hide file tree
Showing 44 changed files with 72 additions and 72 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions app/admin/page.tsx → app/(admin)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default async function DashboardPage() {
</h2>
<div className='flex items-center'>
<Button size='sm' asChild>
<Link href='/admin/portfolio/create'>Add project</Link>
<Link href='/portfolio/create'>Add project</Link>
</Button>
</div>
</div>
Expand Down Expand Up @@ -138,7 +138,7 @@ export default async function DashboardPage() {
className='h-5 px-0'
asChild
>
<Link href='/admin/qualification'>View all</Link>
<Link href='/qualification'>View all</Link>
</Button>
</CardTitle>
<CardDescription>
Expand All @@ -159,7 +159,7 @@ export default async function DashboardPage() {
className='h-5 px-0'
asChild
>
<Link href='/admin/portfolio'>View all</Link>
<Link href='/portfolio'>View all</Link>
</Button>
</CardTitle>
<CardDescription>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { cn } from '@/lib/utils';
import { Skeleton } from '@/components/ui/skeleton';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';

export default function PortfolioIdLoading() {
export default function EditPortfolioLoading() {
return (
<>
<Skeleton className='h-9 w-[85px] mb-4' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
CardTitle
} from '@/components/ui/card';

export default async function PortfolioIdPage({
export default async function EditPortfolioPage({
params
}: {
params: { portfolioId: string };
Expand All @@ -35,7 +35,7 @@ export default async function PortfolioIdPage({

return (
<>
<BackButton slug='/admin/portfolio' />
<BackButton slug='/portfolio' />
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { cn } from '@/lib/utils';
import { Skeleton } from '@/components/ui/skeleton';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';

export default function CreateLoading() {
export default function CreatePortfolioLoading() {
return (
<>
<Skeleton className='h-9 w-[85px] mb-4' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
CardTitle
} from '@/components/ui/card';

export default function CreatePage() {
export default function CreatePortfolioPage() {
return (
<>
<BackButton slug='/admin/portfolio' />
<BackButton slug='/portfolio' />
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/admin/resume/page.tsx → app/(admin)/resume/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
CardTitle
} from '@/components/ui/card';

export default async function AboutPage() {
export default async function ResumePage() {
const user = await currentUser();

if (!user || !user.id) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Skeleton } from '@/components/ui/skeleton';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';

export default function ToolIdLoading() {
export default function EditToolLoading() {
return (
<>
<Skeleton className='h-9 w-[85px] mb-4' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
CardTitle
} from '@/components/ui/card';

export default async function ToolId({
export default async function EditToolPage({
params
}: {
params: { toolId: string };
Expand All @@ -32,7 +32,7 @@ export default async function ToolId({

return (
<>
<BackButton slug='/admin/tool' />
<BackButton slug='/tool' />
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>Edit Tool</CardTitle>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Skeleton } from '@/components/ui/skeleton';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';

export default function AddLoading() {
export default function CreateToolLoading() {
return (
<>
<Skeleton className='h-9 w-[85px] mb-4' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
CardTitle
} from '@/components/ui/card';

export default function AddPage() {
export default function CreateToolPage() {
return (
<>
<BackButton slug='/admin/tool' />
<BackButton slug='/tool' />
<Card className='rounded-lg border-none'>
<CardHeader className='mx-[1px] pb-9'>
<CardTitle className='text-xl font-semibold'>Add Tool</CardTitle>
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/robots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function robots(): MetadataRoute.Robots {
rules: {
userAgent: '*',
allow: ['/', '/auth/', '/privacy-policy', '/terms-and-conditions'],
disallow: ['/admin/', '/api/', '/download-cv']
disallow: ['/api/', '/download-cv']
},
sitemap: `${baseUrl}/sitemap.xml`
};
Expand Down
58 changes: 29 additions & 29 deletions components/admin/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ import { signOut } from 'next-auth/react';
import { usePathname } from 'next/navigation';
import {
Book,
ClipboardCheck,
User,
List,
Text,
LogOut,
FileText,
FolderGit2,
GraduationCap,
LayoutGrid,
List,
LogOut,
TerminalSquare,
Text,
User
GraduationCap,
ClipboardCheck,
TerminalSquare
} from 'lucide-react';

import { cn } from '@/lib/utils';
import { Button } from '@/components/ui/button';
import {
Tooltip,
TooltipTrigger,
TooltipContent,
TooltipProvider,
TooltipTrigger
TooltipProvider
} from '@/components/ui/tooltip';

interface MenuProps {
Expand All @@ -35,63 +35,63 @@ export default function Menu({ isOpen }: MenuProps) {

const routes = [
{
href: '/admin',
href: '/dashboard',
label: 'Dashboard',
active: pathname === '/admin',
active: pathname.includes('/dashboard'),
icon: <LayoutGrid size={18} />
},
{
href: '/admin/about',
href: '/about',
label: 'About',
active: pathname.includes('/admin/about'),
active: pathname.includes('/about'),
icon: <Text size={18} />
},
{
href: '/admin/experience',
href: '/experience',
label: 'Experience',
active: pathname.includes('/admin/experience'),
active: pathname.includes('/experience'),
icon: <Book size={18} />
},
{
href: '/admin/expertise',
href: '/expertise',
label: 'Expertise',
active: pathname.includes('/admin/expertise'),
active: pathname.includes('/expertise'),
icon: <ClipboardCheck size={18} />
},
{
href: '/admin/qualification',
href: '/qualification',
label: 'Qualification',
active: pathname.includes('/admin/qualification'),
active: pathname.includes('/qualification'),
icon: <GraduationCap size={20} />
},
{
href: '/admin/portfolio',
href: '/portfolio',
label: 'Portfolio',
active: pathname.includes('/admin/portfolio'),
active: pathname.includes('/portfolio'),
icon: <FolderGit2 size={18} />
},
{
href: '/admin/miscellaneous',
href: '/miscellaneous',
label: 'Miscellaneous',
active: pathname.includes('/admin/miscellaneous'),
active: pathname.includes('/miscellaneous'),
icon: <List size={18} />
},
{
href: '/admin/tool',
href: '/tool',
label: 'Tool & Apps',
active: pathname.includes('/admin/tool'),
active: pathname.includes('/tool'),
icon: <TerminalSquare size={18} />
},
{
href: '/admin/resume',
href: '/resume',
label: 'Resume',
active: pathname.includes('/admin/resume'),
active: pathname.includes('/resume'),
icon: <FileText size={18} />
},
{
href: '/admin/account',
href: '/account',
label: 'Account',
active: pathname.includes('/admin/account'),
active: pathname.includes('/account'),
icon: <User size={18} />
}
];
Expand Down
20 changes: 10 additions & 10 deletions components/admin/page-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ export default function PageTitle() {

let pageTitle = '';

if (pathname === '/admin') {
if (pathname === '/dashboard') {
pageTitle = 'Dashboard';
} else if (pathname.includes('/admin/about')) {
} else if (pathname.includes('/about')) {
pageTitle = 'About';
} else if (pathname.includes('/admin/experience')) {
} else if (pathname.includes('/experience')) {
pageTitle = 'Experience';
} else if (pathname.includes('/admin/expertise')) {
} else if (pathname.includes('/expertise')) {
pageTitle = 'Expertise';
} else if (pathname.includes('/admin/qualification')) {
} else if (pathname.includes('/qualification')) {
pageTitle = 'Qualification';
} else if (pathname.includes('/admin/portfolio')) {
} else if (pathname.includes('/portfolio')) {
pageTitle = 'Portfolio';
} else if (pathname.includes('/admin/miscellaneous')) {
} else if (pathname.includes('/miscellaneous')) {
pageTitle = 'Miscellaneous';
} else if (pathname.includes('/admin/tool')) {
} else if (pathname.includes('/tool')) {
pageTitle = 'Tool & Apps';
} else if (pathname.includes('/admin/resume')) {
} else if (pathname.includes('/resume')) {
pageTitle = 'Resume';
} else if (pathname.includes('/admin/account')) {
} else if (pathname.includes('/account')) {
pageTitle = 'Account';
}

Expand Down
4 changes: 2 additions & 2 deletions components/admin/portfolio-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default function PortfolioForm({ portfolio }: PortfolioFormProps) {
title: 'Success!',
description: 'Data has been successfully saved.'
});
router.push(response.data.portfolio.id);
router.push(`/portfolio/${response.data.portfolio.id}/edit`);
}
} else {
const response = await axios.post('/api/portfolio', newValues);
Expand All @@ -135,7 +135,7 @@ export default function PortfolioForm({ portfolio }: PortfolioFormProps) {
title: 'Success!',
description: 'Data has been successfully saved.'
});
router.push(response.data.portfolio.id);
router.push(`/portfolio/${response.data.portfolio.id}/edit`);
}
}
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion components/admin/portfolio-table/add-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Button } from '@/components/ui/button';
export default function AddButton() {
return (
<Button size='sm' className='h-8' asChild>
<Link href='/admin/portfolio/create'>
<Link href='/portfolio/create'>
<PlusCircle size={16} className='mr-2' />
Create
</Link>
Expand Down
2 changes: 1 addition & 1 deletion components/admin/portfolio-table/cell-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function CellActions<TData>({ row }: CellActionsProps<TData>) {
</DropdownMenuTrigger>
<DropdownMenuContent align='end'>
<DropdownMenuItem className='hover:cursor-pointer' asChild>
<Link href={`/admin/portfolio/${portfolio.id}`}>
<Link href={`/portfolio/${portfolio.id}/edit`}>
<Edit className='mr-2' size={14} />
Edit
</Link>
Expand Down
2 changes: 1 addition & 1 deletion components/admin/recent-project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function RecentProject({ projects }: RecentProjectProps) {
</div>
<div>
<Button size='sm' asChild>
<Link href={`/admin/portfolio/${project.id}`}>View</Link>
<Link href={`/portfolio/${project.id}/edit`}>View</Link>
</Button>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/admin/sheet-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function SheetMenu() {
variant='link'
asChild
>
<Link href='/admin' className='flex items-center gap-2'>
<Link href='/dashboard' className='flex items-center gap-2'>
<LayoutTemplate />
<h1 className='font-bold text-lg'>Profolio</h1>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion components/admin/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function Sidebar() {
variant='link'
asChild
>
<Link href='/admin' className='flex items-center gap-2'>
<Link href='/dashboard' className='flex items-center gap-2'>
<LayoutTemplate />
<h1
className={cn(
Expand Down
4 changes: 2 additions & 2 deletions components/admin/tool-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function ToolForm({ tool }: ToolFormProps) {
title: 'Success!',
description: 'Data has been successfully saved.'
});
router.push(response.data.tool.id);
router.push(`/tool/${response.data.tool.id}/edit`);
}
} else {
const response = await axios.post('/api/tool', newValues);
Expand All @@ -103,7 +103,7 @@ export default function ToolForm({ tool }: ToolFormProps) {
title: 'Success!',
description: 'Data has been successfully saved.'
});
router.push(response.data.tool.id);
router.push(`/tool/${response.data.tool.id}/edit`);
}
}
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion components/admin/tool-table/add-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Button } from '@/components/ui/button';
export default function AddButton() {
return (
<Button size='sm' className='h-8' asChild>
<Link href='/admin/tool/add'>
<Link href='/tool/create'>
<PlusCircle size={16} className='mr-2' />
Add
</Link>
Expand Down
2 changes: 1 addition & 1 deletion components/admin/tool-table/cell-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function CellActions<TData>({ row }: CellActionsProps<TData>) {
</DropdownMenuTrigger>
<DropdownMenuContent align='end'>
<DropdownMenuItem className='hover:cursor-pointer' asChild>
<Link href={`/admin/tool/${tool.id}`}>
<Link href={`/tool/${tool.id}/edit`}>
<Edit className='mr-2' size={14} />
Edit
</Link>
Expand Down
Loading

0 comments on commit d7e05fa

Please sign in to comment.