header bar
This commit is contained in:
		
							parent
							
								
									e92ff39658
								
							
						
					
					
						commit
						1939e9f78e
					
				| 
						 | 
					@ -1,3 +1,5 @@
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  "extends": ["next/core-web-vitals", "next/typescript"]
 | 
					  "extends": [
 | 
				
			||||||
 | 
					    "next/core-web-vitals"
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								client/bun.lockb
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								client/bun.lockb
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										5725
									
								
								client/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										5725
									
								
								client/package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
					@ -18,6 +18,7 @@
 | 
				
			||||||
    "@mui/lab": "^6.0.0-beta.14",
 | 
					    "@mui/lab": "^6.0.0-beta.14",
 | 
				
			||||||
    "@mui/material": "^6.1.6",
 | 
					    "@mui/material": "^6.1.6",
 | 
				
			||||||
    "@tauri-apps/api": "^2.1.0",
 | 
					    "@tauri-apps/api": "^2.1.0",
 | 
				
			||||||
 | 
					    "jotai": "^2.10.1",
 | 
				
			||||||
    "next": "^15.0.3",
 | 
					    "next": "^15.0.3",
 | 
				
			||||||
    "react": "^18.3.1",
 | 
					    "react": "^18.3.1",
 | 
				
			||||||
    "react-dom": "^18.3.1"
 | 
					    "react-dom": "^18.3.1"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
import { Box, useTheme } from "@mui/material";
 | 
					import { Box, TextField, useTheme } from "@mui/material";
 | 
				
			||||||
import { HeaderBar } from "../HeaderBar/HeaderBar";
 | 
					import { HeaderBar } from "../HeaderBar/HeaderBar";
 | 
				
			||||||
 | 
					import { LoadingButton } from "@mui/lab";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const Layout = () => {
 | 
					export const Layout = () => {
 | 
				
			||||||
  // contexts
 | 
					  // contexts
 | 
				
			||||||
| 
						 | 
					@ -22,7 +23,13 @@ export const Layout = () => {
 | 
				
			||||||
          overflow: "auto",
 | 
					          overflow: "auto",
 | 
				
			||||||
          p: 1,
 | 
					          p: 1,
 | 
				
			||||||
        }}
 | 
					        }}
 | 
				
			||||||
      ></Box>
 | 
					      >
 | 
				
			||||||
 | 
					        <Box>
 | 
				
			||||||
 | 
					          {/* main content goes here buddy */}
 | 
				
			||||||
 | 
					          <LoadingButton id="asdfbutton">asdf</LoadingButton>
 | 
				
			||||||
 | 
					          <TextField id="asdf" name="asdf"></TextField>
 | 
				
			||||||
 | 
					        </Box>
 | 
				
			||||||
 | 
					      </Box>
 | 
				
			||||||
    </Box>
 | 
					    </Box>
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,7 @@
 | 
				
			||||||
import { Box, Stack } from "@mui/material";
 | 
					import { Box, Stack } from "@mui/material";
 | 
				
			||||||
import { WindowButtons } from "./WindowButtons";
 | 
					import { WindowButtons } from "./WindowButtons";
 | 
				
			||||||
 | 
					import { NavigationButtons } from "./NavigationButtons";
 | 
				
			||||||
 | 
					import { RouteDisplay } from "./RouteDisplay";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const HeaderBar = () => {
 | 
					export const HeaderBar = () => {
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
| 
						 | 
					@ -8,10 +10,6 @@ export const HeaderBar = () => {
 | 
				
			||||||
      data-tauri-drag-region="true"
 | 
					      data-tauri-drag-region="true"
 | 
				
			||||||
      sx={{
 | 
					      sx={{
 | 
				
			||||||
        alignItems: "center",
 | 
					        alignItems: "center",
 | 
				
			||||||
        // backdropFilter: "blur(10px)",
 | 
					 | 
				
			||||||
        // backgroundColor: "rgba(0, 0, 0, 0.5)",
 | 
					 | 
				
			||||||
        // TODO: remove when done
 | 
					 | 
				
			||||||
        // borderBottom: "1px solid red",
 | 
					 | 
				
			||||||
        display: "flex",
 | 
					        display: "flex",
 | 
				
			||||||
        flexDirection: "row",
 | 
					        flexDirection: "row",
 | 
				
			||||||
        height: "48px",
 | 
					        height: "48px",
 | 
				
			||||||
| 
						 | 
					@ -28,7 +26,19 @@ export const HeaderBar = () => {
 | 
				
			||||||
          flexDirection: "row",
 | 
					          flexDirection: "row",
 | 
				
			||||||
        }}
 | 
					        }}
 | 
				
			||||||
      >
 | 
					      >
 | 
				
			||||||
        hello this is the left side
 | 
					        {/* this is the left side */}
 | 
				
			||||||
 | 
					        <Stack
 | 
				
			||||||
 | 
					          direction="row"
 | 
				
			||||||
 | 
					          spacing={2}
 | 
				
			||||||
 | 
					          sx={{
 | 
				
			||||||
 | 
					            alignItems: "center",
 | 
				
			||||||
 | 
					            display: "flex",
 | 
				
			||||||
 | 
					            flexDirection: "row",
 | 
				
			||||||
 | 
					          }}
 | 
				
			||||||
 | 
					        >
 | 
				
			||||||
 | 
					          <NavigationButtons />
 | 
				
			||||||
 | 
					          <RouteDisplay />
 | 
				
			||||||
 | 
					        </Stack>
 | 
				
			||||||
      </Box>
 | 
					      </Box>
 | 
				
			||||||
      <Box
 | 
					      <Box
 | 
				
			||||||
        className="titlebar"
 | 
					        className="titlebar"
 | 
				
			||||||
| 
						 | 
					@ -39,6 +49,18 @@ export const HeaderBar = () => {
 | 
				
			||||||
          flexDirection: "row",
 | 
					          flexDirection: "row",
 | 
				
			||||||
        }}
 | 
					        }}
 | 
				
			||||||
      >
 | 
					      >
 | 
				
			||||||
 | 
					        {/* this is the middle, probably not gonna be used */}
 | 
				
			||||||
 | 
					      </Box>
 | 
				
			||||||
 | 
					      <Box
 | 
				
			||||||
 | 
					        className="titlebar"
 | 
				
			||||||
 | 
					        data-tauri-drag-region="true"
 | 
				
			||||||
 | 
					        sx={{
 | 
				
			||||||
 | 
					          alignItems: "center",
 | 
				
			||||||
 | 
					          display: "flex",
 | 
				
			||||||
 | 
					          flexDirection: "row",
 | 
				
			||||||
 | 
					        }}
 | 
				
			||||||
 | 
					      >
 | 
				
			||||||
 | 
					        {/* this is the right side */}
 | 
				
			||||||
        <Stack
 | 
					        <Stack
 | 
				
			||||||
          direction="row"
 | 
					          direction="row"
 | 
				
			||||||
          spacing={2}
 | 
					          spacing={2}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										45
									
								
								client/src/components/HeaderBar/NavigationButtons.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								client/src/components/HeaderBar/NavigationButtons.tsx
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,45 @@
 | 
				
			||||||
 | 
					// TODO: implement navigation buffer after implementing internal routing
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { ArrowBack, ArrowForward, HomeOutlined } from "@mui/icons-material";
 | 
				
			||||||
 | 
					import { Box, IconButton, Stack } from "@mui/material";
 | 
				
			||||||
 | 
					import { useAtom } from "jotai";
 | 
				
			||||||
 | 
					import { routeAtom } from "../../lib/jotai";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const NavigationButtons = () => {
 | 
				
			||||||
 | 
					  // atoms
 | 
				
			||||||
 | 
					  const [route, setRoute] = useAtom(routeAtom);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const goBack = () => {
 | 
				
			||||||
 | 
					    // TODO
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const goForward = () => {
 | 
				
			||||||
 | 
					    // TODO
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const goHome = () => {
 | 
				
			||||||
 | 
					    setRoute("index");
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return (
 | 
				
			||||||
 | 
					    <Box
 | 
				
			||||||
 | 
					      sx={{
 | 
				
			||||||
 | 
					        alignItems: "center",
 | 
				
			||||||
 | 
					        display: "flex",
 | 
				
			||||||
 | 
					        flexDirection: "row",
 | 
				
			||||||
 | 
					      }}
 | 
				
			||||||
 | 
					    >
 | 
				
			||||||
 | 
					      <Stack direction="row" spacing={1}>
 | 
				
			||||||
 | 
					        <IconButton onClick={goBack} size="small">
 | 
				
			||||||
 | 
					          <ArrowBack fontSize="inherit" />
 | 
				
			||||||
 | 
					        </IconButton>
 | 
				
			||||||
 | 
					        <IconButton onClick={goForward} size="small">
 | 
				
			||||||
 | 
					          <ArrowForward fontSize="inherit" />
 | 
				
			||||||
 | 
					        </IconButton>
 | 
				
			||||||
 | 
					        <IconButton onClick={goHome} size="small">
 | 
				
			||||||
 | 
					          <HomeOutlined fontSize="inherit" />
 | 
				
			||||||
 | 
					        </IconButton>
 | 
				
			||||||
 | 
					      </Stack>
 | 
				
			||||||
 | 
					    </Box>
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
							
								
								
									
										5
									
								
								client/src/components/HeaderBar/RouteDisplay.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								client/src/components/HeaderBar/RouteDisplay.tsx
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,5 @@
 | 
				
			||||||
 | 
					import { Box } from "@mui/material";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const RouteDisplay = () => {
 | 
				
			||||||
 | 
					  return <Box>Home</Box>;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,8 @@
 | 
				
			||||||
import { Close, Minimize, WebAssetOutlined } from "@mui/icons-material";
 | 
					import { Close, Minimize, WebAssetOutlined } from "@mui/icons-material";
 | 
				
			||||||
import { Box, IconButton, Stack, useTheme } from "@mui/material";
 | 
					import { Box, IconButton, Stack } from "@mui/material";
 | 
				
			||||||
import { getCurrentWindow } from "@tauri-apps/api/window";
 | 
					import { getCurrentWindow } from "@tauri-apps/api/window";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const WindowButtons = () => {
 | 
					export const WindowButtons = () => {
 | 
				
			||||||
  // contexts
 | 
					 | 
				
			||||||
  const userTheme = useTheme();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  const minimize = () => {
 | 
					  const minimize = () => {
 | 
				
			||||||
    const appWindow = getCurrentWindow();
 | 
					    const appWindow = getCurrentWindow();
 | 
				
			||||||
    appWindow.minimize();
 | 
					    appWindow.minimize();
 | 
				
			||||||
| 
						 | 
					@ -30,31 +27,13 @@ export const WindowButtons = () => {
 | 
				
			||||||
      }}
 | 
					      }}
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <Stack direction="row" spacing={1}>
 | 
					      <Stack direction="row" spacing={1}>
 | 
				
			||||||
        <IconButton
 | 
					        <IconButton onClick={minimize} size="small">
 | 
				
			||||||
          onClick={minimize}
 | 
					 | 
				
			||||||
          size="small"
 | 
					 | 
				
			||||||
          sx={{
 | 
					 | 
				
			||||||
            backgroundColor: userTheme.palette.grey[800],
 | 
					 | 
				
			||||||
          }}
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
          <Minimize fontSize="inherit" />
 | 
					          <Minimize fontSize="inherit" />
 | 
				
			||||||
        </IconButton>
 | 
					        </IconButton>
 | 
				
			||||||
        <IconButton
 | 
					        <IconButton onClick={toggleMaximize} size="small">
 | 
				
			||||||
          onClick={toggleMaximize}
 | 
					 | 
				
			||||||
          size="small"
 | 
					 | 
				
			||||||
          sx={{
 | 
					 | 
				
			||||||
            backgroundColor: userTheme.palette.grey[800],
 | 
					 | 
				
			||||||
          }}
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
          <WebAssetOutlined fontSize="inherit" />
 | 
					          <WebAssetOutlined fontSize="inherit" />
 | 
				
			||||||
        </IconButton>
 | 
					        </IconButton>
 | 
				
			||||||
        <IconButton
 | 
					        <IconButton onClick={close} size="small">
 | 
				
			||||||
          onClick={close}
 | 
					 | 
				
			||||||
          size="small"
 | 
					 | 
				
			||||||
          sx={{
 | 
					 | 
				
			||||||
            backgroundColor: userTheme.palette.grey[800],
 | 
					 | 
				
			||||||
          }}
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
          <Close fontSize="inherit" />
 | 
					          <Close fontSize="inherit" />
 | 
				
			||||||
        </IconButton>
 | 
					        </IconButton>
 | 
				
			||||||
      </Stack>
 | 
					      </Stack>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								client/src/lib/jotai.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								client/src/lib/jotai.ts
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					import { atom } from "jotai";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const routeAtom = atom("index");
 | 
				
			||||||
| 
						 | 
					@ -1,5 +0,0 @@
 | 
				
			||||||
import { Box } from "@mui/material";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export default function Testing() {
 | 
					 | 
				
			||||||
  return <Box>asdf</Box>;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,22 +1,29 @@
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  "compilerOptions": {
 | 
					  "compilerOptions": {
 | 
				
			||||||
    "target": "ES2017",
 | 
					 | 
				
			||||||
    "lib": ["dom", "dom.iterable", "esnext"],
 | 
					 | 
				
			||||||
    "allowJs": true,
 | 
					    "allowJs": true,
 | 
				
			||||||
    "skipLibCheck": true,
 | 
					 | 
				
			||||||
    "strict": true,
 | 
					 | 
				
			||||||
    "noEmit": true,
 | 
					 | 
				
			||||||
    "esModuleInterop": true,
 | 
					    "esModuleInterop": true,
 | 
				
			||||||
    "module": "esnext",
 | 
					    "incremental": true,
 | 
				
			||||||
    "moduleResolution": "bundler",
 | 
					 | 
				
			||||||
    "resolveJsonModule": true,
 | 
					 | 
				
			||||||
    "isolatedModules": true,
 | 
					    "isolatedModules": true,
 | 
				
			||||||
    "jsx": "preserve",
 | 
					    "jsx": "preserve",
 | 
				
			||||||
    "incremental": true,
 | 
					    "lib": [
 | 
				
			||||||
    "paths": {
 | 
					      "dom",
 | 
				
			||||||
      "@/*": ["./src/*"]
 | 
					      "dom.iterable",
 | 
				
			||||||
    }
 | 
					      "esnext"
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    "module": "esnext",
 | 
				
			||||||
 | 
					    "moduleResolution": "bundler",
 | 
				
			||||||
 | 
					    "noEmit": true,
 | 
				
			||||||
 | 
					    "resolveJsonModule": true,
 | 
				
			||||||
 | 
					    "skipLibCheck": true,
 | 
				
			||||||
 | 
					    "strict": true,
 | 
				
			||||||
 | 
					    "target": "ES2017"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
 | 
					  "exclude": [
 | 
				
			||||||
  "exclude": ["node_modules"]
 | 
					    "node_modules"
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
 | 
					  "include": [
 | 
				
			||||||
 | 
					    "next-env.d.ts",
 | 
				
			||||||
 | 
					    "**/*.ts",
 | 
				
			||||||
 | 
					    "**/*.tsx"
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in a new issue