diff --git a/dashboard/src/components/index.ts b/dashboard/src/components/index.ts index ae8b036..156f660 100644 --- a/dashboard/src/components/index.ts +++ b/dashboard/src/components/index.ts @@ -7,3 +7,4 @@ export * from './nav-dir' export * from './header' export * from './entity-table' export * from './copy-button' +export * from './page' diff --git a/dashboard/src/components/page/index.tsx b/dashboard/src/components/page/index.tsx new file mode 100644 index 0000000..2ae6696 --- /dev/null +++ b/dashboard/src/components/page/index.tsx @@ -0,0 +1,17 @@ +import { FC, PropsWithChildren } from 'react' +import { ScrollArea } from '@marzneshin/components' + +interface PageProps extends PropsWithChildren { } + +/* WARN: The current page height which effect the scroll +* area activness, is calculated based on height of header +* and margin. +*/ + +export const Page: FC = ({ children }) => { + return ( + + {children} + + ); +} diff --git a/dashboard/src/routes/_dashboard/hosts.tsx b/dashboard/src/routes/_dashboard/hosts.tsx index e7f1508..70e8649 100644 --- a/dashboard/src/routes/_dashboard/hosts.tsx +++ b/dashboard/src/routes/_dashboard/hosts.tsx @@ -1,4 +1,4 @@ -import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@marzneshin/components' +import { Card, CardContent, CardFooter, CardHeader, CardTitle, Page } from '@marzneshin/components' import { InboundHostsTable } from '@marzneshin/features/hosts' import { createFileRoute } from '@tanstack/react-router' import { useTranslation } from 'react-i18next' @@ -6,18 +6,20 @@ import { useTranslation } from 'react-i18next' export const HostsPage = () => { const { t } = useTranslation() return ( - - - - {t('hosts')} - - - - - - - - + + + + + {t('hosts')} + + + + + + + + + ) } diff --git a/dashboard/src/routes/_dashboard/nodes.tsx b/dashboard/src/routes/_dashboard/nodes.tsx index cda20a2..e05e5f4 100644 --- a/dashboard/src/routes/_dashboard/nodes.tsx +++ b/dashboard/src/routes/_dashboard/nodes.tsx @@ -1,4 +1,14 @@ -import { Alert, AlertDescription, AlertTitle, Card, CardContent, CardFooter, CardHeader, CardTitle } from '@marzneshin/components'; +import { + Alert, + AlertDescription, + AlertTitle, + Card, + CardContent, + CardFooter, + CardHeader, + CardTitle, + Page +} from '@marzneshin/components'; import { NodesTable } from '@marzneshin/features/nodes'; import { Link, createFileRoute } from '@tanstack/react-router' import { Info } from 'lucide-react'; @@ -8,26 +18,29 @@ import { useTranslation } from 'react-i18next'; export const NodesPage: FC = () => { const { t } = useTranslation(); return ( - - - - {t('nodes')} - - - - - - - - - {t('page.nodes.certificate-alert.title')} - - {t('page.nodes.certificate-alert.desc')} - {t('page.nodes.certificate-alert.click')} - - - - ) + + + + + {t('nodes')} + + + + + + + + + {t('page.nodes.certificate-alert.title')} + + {t('page.nodes.certificate-alert.desc')} + {t('page.nodes.certificate-alert.click')} + + + + + + ) }; export const Route = createFileRoute('/_dashboard/nodes')({ diff --git a/dashboard/src/routes/_dashboard/services.tsx b/dashboard/src/routes/_dashboard/services.tsx index b225bc2..dbf0c7f 100644 --- a/dashboard/src/routes/_dashboard/services.tsx +++ b/dashboard/src/routes/_dashboard/services.tsx @@ -3,7 +3,8 @@ import { CardContent, CardFooter, CardHeader, - CardTitle + CardTitle, + Page } from '@marzneshin/components' import { ServicesTable } from '@marzneshin/features/services'; import { createFileRoute } from '@tanstack/react-router' @@ -13,18 +14,20 @@ import { useTranslation } from 'react-i18next'; export const ServicesPage: FC = () => { const { t } = useTranslation(); return ( - - - - {t('services')} - - - - - - - - + + + + + {t('services')} + + + + + + + + + ) }; diff --git a/dashboard/src/routes/_dashboard/settings.tsx b/dashboard/src/routes/_dashboard/settings.tsx index 40743cd..12fe1a5 100644 --- a/dashboard/src/routes/_dashboard/settings.tsx +++ b/dashboard/src/routes/_dashboard/settings.tsx @@ -1,5 +1,5 @@ -import { Card, CardContent, CardHeader, CardTitle } from '@marzneshin/components' +import { Card, CardContent, CardHeader, CardTitle, Page } from '@marzneshin/components' import { CertificateButton } from '@marzneshin/features/settings' import { createFileRoute } from '@tanstack/react-router' import { useTranslation } from 'react-i18next' @@ -7,16 +7,18 @@ import { useTranslation } from 'react-i18next' export const Settings = () => { const { t } = useTranslation() return ( - - - - - {t('settings')} - - - - - + + + + + + {t('settings')} + + + + + + ) } diff --git a/dashboard/src/routes/_dashboard/users.tsx b/dashboard/src/routes/_dashboard/users.tsx index 9d37c83..11b79dd 100644 --- a/dashboard/src/routes/_dashboard/users.tsx +++ b/dashboard/src/routes/_dashboard/users.tsx @@ -1,4 +1,14 @@ -import { Alert, AlertDescription, AlertTitle, Card, CardContent, CardFooter, CardHeader, CardTitle } from '@marzneshin/components'; +import { + Alert, + AlertDescription, + AlertTitle, + Card, + CardContent, + CardFooter, + CardHeader, + CardTitle, + Page +} from '@marzneshin/components'; import { useServicesQuery } from '@marzneshin/features/services'; import { UsersTable } from '@marzneshin/features/users'; import { ExclamationTriangleIcon } from '@radix-ui/react-icons'; @@ -6,33 +16,34 @@ import { Link, createFileRoute } from '@tanstack/react-router' import { FC } from 'react'; import { useTranslation } from 'react-i18next'; - export const UsersPage: FC = () => { const { data } = useServicesQuery(); const { t } = useTranslation(); return ( - - - - {t('users')} - - - - - - - {(data && data.length === 0) && ( - - - {t('page.users.services-alert.title')} - - {t('page.users.services-alert.desc')} - {t('page.nodes.certificate-alert.click')} - - - )} - - + + + + + {t('users')} + + + + + + + {(data && data.length === 0) && ( + + + {t('page.users.services-alert.title')} + + {t('page.users.services-alert.desc')} + {t('page.nodes.certificate-alert.click')} + + + )} + + + ) };