Skip to content

Commit

Permalink
clmn
Browse files Browse the repository at this point in the history
  • Loading branch information
sangdth committed Sep 12, 2023
1 parent 9102191 commit 63173a9
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 76 deletions.
3 changes: 0 additions & 3 deletions app/[locale]/(default)/dashboard/dashboard/files/page.tsx

This file was deleted.

36 changes: 0 additions & 36 deletions app/[locale]/(default)/dashboard/dashboard/pages/page.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions app/[locale]/(default)/dashboard/dashboard/posts/page.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions app/[locale]/(default)/dashboard/pages/AddPageButton.tsx

This file was deleted.

File renamed without changes.
12 changes: 5 additions & 7 deletions app/[locale]/(default)/dashboard/pages/page.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { Box, Flex, Heading, Spacer, Text } from '@/components/chakra';
import { VirtualTable } from '@/components/client';
import { Flex, Heading, Spacer, Text } from '@/components/chakra';
import { AddNewButton, VirtualTable } from '@/components/client';
import { prisma } from '@/utils/prisma';

import { AddPageButton } from './AddPageButton';

export default async function PagesDashboard() {
const pages = await prisma.page.findMany({});

return (
<Box>
<Flex direction="column">
<Flex justify="space-between" align="center" width="100%">
<Heading as="h3" size="lg" alignItems="center" color="gray">
Pages
</Heading>

<AddPageButton />
<AddNewButton title="Add New Page" />
</Flex>

<Spacer />
Expand All @@ -33,6 +31,6 @@ export default async function PagesDashboard() {
) : (
<Text>No pages</Text>
)}
</Box>
</Flex>
);
}
24 changes: 10 additions & 14 deletions app/[locale]/(default)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Box, Flex, HStack } from '@/components/chakra';
import { Navbar } from '@/components/client';
import { ProfileMenu, LocaleSwitcher } from '@/components/server';
import type { ReactNode } from '@/types';
import { Box, Flex } from '@/components/chakra';
import { Sidebar } from '@/components/client';
import type { Locale } from '@/configs/i18n.config';
import type { ReactNode } from '@/types';

export default function DefaultLayout({
children,
Expand All @@ -12,17 +12,13 @@ export default function DefaultLayout({
params: { locale: Locale };
}) {
return (
<Flex direction="column">
<Navbar>
<HStack spacing={1}>
<Box>
<LocaleSwitcher locale={params.locale} />
</Box>
<Box>
<ProfileMenu />
</Box>
</HStack>
</Navbar>
<Flex>
<Sidebar>
<Flex gap={1} align="center">
<LocaleSwitcher locale={params.locale} />
<ProfileMenu />
</Flex>
</Sidebar>

<Box padding={6} width="100%" height="100vh" overflowY="scroll">
{children}
Expand Down
1 change: 0 additions & 1 deletion components/client/Logo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const Logo = ({ size = 12, href = '/', ...rest }: LogoProps) => (
as="img"
alt="Logo"
placeholder="empty"
borderRadius="full"
src="/next.svg" // this is from /public folder
width={size}
{...rest}
Expand Down

0 comments on commit 63173a9

Please sign in to comment.