diff --git a/bun.lockb b/bun.lockb index 0bff6c7..092cf2e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 0a1b8f7..82eb00c 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@mui/material-nextjs": "^6.3.1", "@mui/x-charts": "^7.23.2", "@tailwindcss/typography": "^0.5.16", + "@toolpad/core": "^0.11.0", "@vercel/speed-insights": "^1.1.0", "animate.css": "^4.1.1", "axios": "^1.7.9", @@ -51,6 +52,8 @@ "@eslint/eslintrc": "^3.2.0" }, "trustedDependencies": [ - "@vercel/speed-insights" + "@vercel/speed-insights", + "esbuild", + "sharp" ] } diff --git a/src/components/CapAppBar.tsx b/src/components/CapAppBar.tsx index ffb9182..b5e9d14 100644 --- a/src/components/CapAppBar.tsx +++ b/src/components/CapAppBar.tsx @@ -47,7 +47,7 @@ export function CapAppBar() { setOpen(false)} /> - + , href: '/attachments', }, + { + title: 'Matrix', + icon: , + href: '/matrix', + }, ] const additionalLinks: NavLink[] = [ diff --git a/src/components/layouts/ConsoleLayout.tsx b/src/components/layouts/ConsoleLayout.tsx new file mode 100644 index 0000000..e504e1f --- /dev/null +++ b/src/components/layouts/ConsoleLayout.tsx @@ -0,0 +1,54 @@ +import { checkAuthenticatedClient, redirectToLogin } from '@/services/auth' +import { JSX, useEffect } from 'react' +import { DashboardLayout, Navigation } from '@toolpad/core' +import { Stack, Typography } from '@mui/material' +import NextLink from 'next/link' + +import AppsIcon from '@mui/icons-material/Apps' + +export function ConsoleLayout({ children }: { children: JSX.Element }) { + useEffect(() => { + if (!checkAuthenticatedClient()) redirectToLogin() + }, []) + + const navigation: Navigation = [ + { + segment: 'console/matrix', + title: 'Matrix', + icon: , + }, + ] + + return ( + + + Solar Network Console + + + ) + }, + }} + sidebarExpandedWidth={300} + defaultSidebarCollapsed + > + {children} + + ) +} + +export function getConsoleStaticProps(original: any) { + if (original.props.title) { + original.props.title = 'Console | ' + original.props.title + } + original.props.showAppBar = false + + return original +} diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 9c1278d..1099456 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -4,6 +4,7 @@ import { Box, createTheme, CssBaseline, ThemeProvider } from '@mui/material' import { Roboto } from 'next/font/google' import { CapAppBar } from '@/components/CapAppBar' import { PagesProgressBar as ProgressBar } from 'next-nprogress-bar' +import { AppProvider } from '@toolpad/core/nextjs' import { useUserStore } from '@/services/user' import { useEffect } from 'react' import Head from 'next/head' @@ -56,20 +57,22 @@ export default function App({ Component, pageProps }: AppProps) { - - - + + + + - - - - - + {(pageProps.showAppBar ?? true) && } + + + + + ) } diff --git a/src/pages/console/index.tsx b/src/pages/console/index.tsx new file mode 100644 index 0000000..06ebfbf --- /dev/null +++ b/src/pages/console/index.tsx @@ -0,0 +1,51 @@ +import { ConsoleLayout, getConsoleStaticProps } from '@/components/layouts/ConsoleLayout' +import { Typography, Container, Box, Grid2 as Grid, Card, CardContent, CardActionArea } from '@mui/material' +import NextLink from 'next/link' + +import DynamicFormIcon from '@mui/icons-material/DynamicForm' +import AppsIcon from '@mui/icons-material/Apps' + +export function getStaticProps() { + return getConsoleStaticProps({ + props: { + title: 'Welcome', + }, + }) +} + +export default function ConsoleLanding() { + return ( + + + + + Welcome to the + + Console + + of the Solar Network + + + + + + + {}}> + + + + Matrix + + + Publish and versioning your application with Matrix Marketplace. + + + + + + + + + + ) +} diff --git a/src/pages/console/matrix/index.tsx b/src/pages/console/matrix/index.tsx new file mode 100644 index 0000000..7a0aa48 --- /dev/null +++ b/src/pages/console/matrix/index.tsx @@ -0,0 +1,22 @@ +import { ConsoleLayout, getConsoleStaticProps } from '@/components/layouts/ConsoleLayout' +import { Typography, Container } from '@mui/material' + +export async function getStaticProps() { + return getConsoleStaticProps({ + props: { + title: 'Matrix Marketplace', + }, + }) +} + +export default function MatrixMarketplace() { + return ( + + + + Matrix Marketplace + + + + ) +} diff --git a/src/pages/matrix/index.tsx b/src/pages/matrix/index.tsx new file mode 100644 index 0000000..371dc5e --- /dev/null +++ b/src/pages/matrix/index.tsx @@ -0,0 +1,11 @@ +import { Typography, Container } from '@mui/material' + +export default function MatrixMarketplace() { + return ( + + + Matrix Marketplace + + + ) +}