-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c3ca03
commit 3752421
Showing
22 changed files
with
702 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
"api/core", | ||
"frontend/v2", | ||
"api/blog", | ||
"dash/src" | ||
"dash/src", | ||
"dash/admin" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { NextConfig } from 'next'; | ||
import path from 'path'; | ||
|
||
const nextConfig: NextConfig = { | ||
experimental: {}, | ||
output: 'standalone', | ||
poweredByHeader: false, | ||
outputFileTracingRoot: path.join(__dirname, '../../'), | ||
}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { User } from "@/types/User"; | ||
import { authedFetcher } from "@/util/data"; | ||
|
||
export const getUser = async () => { | ||
return authedFetcher<User>('/account'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
'use client'; | ||
|
||
import { ActionIcon, Code, Group } from '@mantine/core'; | ||
import { IconEdit, IconExternalLink } from '@tabler/icons-react'; | ||
|
||
import { DataTable } from 'mantine-datatable'; | ||
import { FAQQuestion } from '@repo/db'; | ||
import Link from 'next/link'; | ||
|
||
export default function FAQDatatabe({ faq }: { faq: FAQQuestion[] }) { | ||
return ( | ||
<DataTable | ||
columns={[ | ||
{ | ||
accessor: 'id', | ||
title: '#', | ||
render: ({ id }) => <Code>{id.split('-')[0]}</Code>, | ||
footer: faq.length + ' Questions', | ||
}, | ||
{ accessor: 'question' }, | ||
{ | ||
accessor: '', | ||
title: '', | ||
textAlign: 'right', | ||
render: (question) => ( | ||
<Group gap={4} justify="right" wrap="nowrap"> | ||
<ActionIcon size="sm" variant="subtle" color="yellow" aria-label="Edit Question"> | ||
<IconEdit size={16} /> | ||
</ActionIcon> | ||
<ActionIcon | ||
size="sm" | ||
variant="subtle" | ||
color="cyan" | ||
aria-label="View Question on Website" | ||
component={Link} | ||
href={`https://buildtheearth.net/faq#:~:text=${encodeURIComponent(question.question)}`} | ||
target="_blank" | ||
rel="noopener" | ||
> | ||
<IconExternalLink size={16} /> | ||
</ActionIcon> | ||
</Group> | ||
), | ||
}, | ||
]} | ||
records={faq} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Box, Title } from '@mantine/core'; | ||
|
||
import { DataTable } from 'mantine-datatable'; | ||
|
||
export default async function Page() { | ||
return ( | ||
<Box mx="md" maw="90vw"> | ||
<Title order={1} mt="xl" mb="md"> | ||
FAQ Questions | ||
</Title> | ||
<DataTable | ||
columns={[ | ||
{ accessor: 'id', title: '#'}, | ||
{ accessor: 'question' }, | ||
{ accessor: '', title: 'Actions'}, | ||
]} | ||
records={[]} | ||
minHeight={500} | ||
width={"100%"} | ||
noRecordsText='Loading FAQ Questions...' | ||
/> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { | ||
Box, | ||
Button, | ||
Group, | ||
Title | ||
} from '@mantine/core'; | ||
import { IconExternalLink, IconPlus } from '@tabler/icons-react'; | ||
|
||
import prisma from '@/util/db'; | ||
import Link from 'next/link'; | ||
import FAQDatatabe from './datatable'; | ||
|
||
export default async function Page() { | ||
const faq = await prisma.fAQQuestion.findMany(); | ||
|
||
return ( | ||
<Box mx="md" maw="90vw"> | ||
<Group justify="space-between" w="100%" mt="xl" mb="md"> | ||
<Title order={1}>FAQ Questions</Title> | ||
<Group gap="xs"> | ||
<Button color="green" leftSection={<IconPlus size={14} />}> | ||
Add New | ||
</Button> | ||
<Button | ||
variant="light" | ||
color="cyan" | ||
component={Link} | ||
href={`https://buildtheearth.net/faq`} | ||
target="_blank" | ||
rightSection={<IconExternalLink size={14} />} | ||
>Open Page | ||
</Button> | ||
</Group> | ||
</Group> | ||
<FAQDatatabe faq={faq} /> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.