update top navigation and overal theme
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 792 KiB After Width: | Height: | Size: 1.3 MiB |
@@ -13,10 +13,8 @@ export const AccountCard = ({
|
|||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
background: "#262626",
|
|
||||||
padding: 1,
|
padding: 1,
|
||||||
borderRadius: 1,
|
borderBottom: "solid 1px gray",
|
||||||
margin: 1,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography style={{ fontSize: "0.8rem" }} paddingLeft={2}>
|
<Typography style={{ fontSize: "0.8rem" }} paddingLeft={2}>
|
||||||
|
131
src/app/components/AppBar/AppBar.tsx
Normal file
131
src/app/components/AppBar/AppBar.tsx
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
import * as React from "react";
|
||||||
|
import AppBar from "@mui/material/AppBar";
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
|
import Toolbar from "@mui/material/Toolbar";
|
||||||
|
import IconButton from "@mui/material/IconButton";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import Menu from "@mui/material/Menu";
|
||||||
|
import MenuIcon from "@mui/icons-material/Menu";
|
||||||
|
import Container from "@mui/material/Container";
|
||||||
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
|
import PublicIcon from "@mui/icons-material/Public";
|
||||||
|
import { LoginButton } from "../Login/LoginButton";
|
||||||
|
import { DowloadButton } from "../Backup/DowloadButton";
|
||||||
|
import { UploadButton } from "../Backup/UploadButton";
|
||||||
|
import { DiscordButton } from "../Discord/DiscordButton";
|
||||||
|
import { GitHubButton } from "../Github/GitHubButton";
|
||||||
|
|
||||||
|
function ResponsiveAppBar() {
|
||||||
|
const [anchorElNav, setAnchorElNav] = React.useState<null | HTMLElement>(
|
||||||
|
null
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleOpenNavMenu = (event: React.MouseEvent<HTMLElement>) => {
|
||||||
|
setAnchorElNav(event.currentTarget);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCloseNavMenu = () => {
|
||||||
|
setAnchorElNav(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AppBar position="static">
|
||||||
|
<Container maxWidth="xl">
|
||||||
|
<Toolbar disableGutters>
|
||||||
|
<PublicIcon sx={{ display: { xs: "none", md: "flex" }, mr: 1 }} />
|
||||||
|
<Typography
|
||||||
|
variant="h6"
|
||||||
|
noWrap
|
||||||
|
component="a"
|
||||||
|
href="/"
|
||||||
|
sx={{
|
||||||
|
mr: 2,
|
||||||
|
display: { xs: "none", md: "flex" },
|
||||||
|
fontFamily: "monospace",
|
||||||
|
fontWeight: 700,
|
||||||
|
letterSpacing: ".3rem",
|
||||||
|
color: "inherit",
|
||||||
|
textDecoration: "none",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
EVE PI
|
||||||
|
</Typography>
|
||||||
|
|
||||||
|
<Box sx={{ flexGrow: 1, display: { xs: "flex", md: "none" } }}>
|
||||||
|
<IconButton
|
||||||
|
size="large"
|
||||||
|
aria-label="account of current user"
|
||||||
|
aria-controls="menu-appbar"
|
||||||
|
aria-haspopup="true"
|
||||||
|
onClick={handleOpenNavMenu}
|
||||||
|
color="inherit"
|
||||||
|
>
|
||||||
|
<MenuIcon />
|
||||||
|
</IconButton>
|
||||||
|
<Menu
|
||||||
|
id="menu-appbar"
|
||||||
|
anchorEl={anchorElNav}
|
||||||
|
anchorOrigin={{
|
||||||
|
vertical: "bottom",
|
||||||
|
horizontal: "left",
|
||||||
|
}}
|
||||||
|
keepMounted
|
||||||
|
transformOrigin={{
|
||||||
|
vertical: "top",
|
||||||
|
horizontal: "left",
|
||||||
|
}}
|
||||||
|
open={Boolean(anchorElNav)}
|
||||||
|
onClose={handleCloseNavMenu}
|
||||||
|
sx={{
|
||||||
|
display: { xs: "block", md: "none" },
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MenuItem onClick={handleCloseNavMenu}>
|
||||||
|
<LoginButton />
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem onClick={handleCloseNavMenu}>
|
||||||
|
<DowloadButton />
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem onClick={handleCloseNavMenu}>
|
||||||
|
<UploadButton />
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem onClick={handleCloseNavMenu}>
|
||||||
|
<DiscordButton />
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem onClick={handleCloseNavMenu}>
|
||||||
|
<GitHubButton />
|
||||||
|
</MenuItem>
|
||||||
|
</Menu>
|
||||||
|
</Box>
|
||||||
|
<PublicIcon sx={{ display: { xs: "flex", md: "none" }, mr: 1 }} />
|
||||||
|
<Typography
|
||||||
|
variant="h5"
|
||||||
|
noWrap
|
||||||
|
component="a"
|
||||||
|
href=""
|
||||||
|
sx={{
|
||||||
|
mr: 2,
|
||||||
|
display: { xs: "flex", md: "none" },
|
||||||
|
flexGrow: 1,
|
||||||
|
fontFamily: "monospace",
|
||||||
|
fontWeight: 700,
|
||||||
|
letterSpacing: ".3rem",
|
||||||
|
color: "inherit",
|
||||||
|
textDecoration: "none",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
EVE PI
|
||||||
|
</Typography>
|
||||||
|
<Box sx={{ flexGrow: 1, display: { xs: "none", md: "flex" } }}>
|
||||||
|
<LoginButton />
|
||||||
|
<DowloadButton />
|
||||||
|
<UploadButton />
|
||||||
|
<DiscordButton />
|
||||||
|
<GitHubButton />
|
||||||
|
</Box>
|
||||||
|
</Toolbar>
|
||||||
|
</Container>
|
||||||
|
</AppBar>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default ResponsiveAppBar;
|
@@ -1,17 +1,20 @@
|
|||||||
import { CharacterContext, SessionContext } from "@/app/context/Context";
|
import { CharacterContext, SessionContext } from "@/app/context/Context";
|
||||||
import { Button } from "@mui/material";
|
import { Button, Tooltip } from "@mui/material";
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
|
|
||||||
export const DowloadButton = () => {
|
export const DowloadButton = () => {
|
||||||
const { characters } = useContext(CharacterContext);
|
const { characters } = useContext(CharacterContext);
|
||||||
return (
|
return (
|
||||||
<Button
|
<Tooltip title="Export your EVE PI list to transfer to another device or backup">
|
||||||
href={`data:text/json;charset=utf-8,${encodeURIComponent(
|
<Button
|
||||||
JSON.stringify(characters)
|
href={`data:text/json;charset=utf-8,${encodeURIComponent(
|
||||||
)}`}
|
JSON.stringify(characters)
|
||||||
download={`eve-pi-characters.json`}
|
)}`}
|
||||||
>
|
download={`eve-pi-characters.json`}
|
||||||
Backup
|
sx={{ my: 2, color: "white", display: "block" }}
|
||||||
</Button>
|
>
|
||||||
|
Backup
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Box, Button } from "@mui/material";
|
import { Box, Button, Tooltip } from "@mui/material";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { UploadDialog } from "./UploadDialog";
|
import { UploadDialog } from "./UploadDialog";
|
||||||
|
|
||||||
@@ -6,12 +6,15 @@ export const UploadButton = () => {
|
|||||||
const [uploadDialogOpen, setUploadDialogOpen] = useState(false);
|
const [uploadDialogOpen, setUploadDialogOpen] = useState(false);
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Button
|
<Tooltip title="Upload your exported configuration to restore the PI list">
|
||||||
style={{ width: "100%" }}
|
<Button
|
||||||
onClick={() => setUploadDialogOpen(true)}
|
style={{ width: "100%" }}
|
||||||
>
|
onClick={() => setUploadDialogOpen(true)}
|
||||||
Restore
|
sx={{ my: 2, color: "white", display: "block" }}
|
||||||
</Button>
|
>
|
||||||
|
Restore
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
<UploadDialog
|
<UploadDialog
|
||||||
open={uploadDialogOpen}
|
open={uploadDialogOpen}
|
||||||
closeDialog={() => setUploadDialogOpen(false)}
|
closeDialog={() => setUploadDialogOpen(false)}
|
||||||
|
@@ -1,14 +1,17 @@
|
|||||||
import { Box, Button } from "@mui/material";
|
import { Box, Button, Tooltip } from "@mui/material";
|
||||||
export const DiscordButton = () => {
|
export const DiscordButton = () => {
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Button
|
<Tooltip title="Come nerd out in discord about PI and this tool">
|
||||||
href="https://discord.gg/MDapvGyw"
|
<Button
|
||||||
target="_blank"
|
href="https://discord.gg/MDapvGyw"
|
||||||
style={{ width: "100%" }}
|
target="_blank"
|
||||||
>
|
style={{ width: "100%" }}
|
||||||
Discord
|
sx={{ my: 2, color: "white", display: "block" }}
|
||||||
</Button>
|
>
|
||||||
|
Discord
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@@ -1,14 +1,17 @@
|
|||||||
import { Box, Button } from "@mui/material";
|
import { Box, Button, Tooltip } from "@mui/material";
|
||||||
export const GitHubButton = () => {
|
export const GitHubButton = () => {
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Button
|
<Tooltip title="Checkout the source of this app">
|
||||||
href="https://github.com/calli-eve/eve-pi"
|
<Button
|
||||||
target="_blank"
|
href="https://github.com/calli-eve/eve-pi"
|
||||||
style={{ width: "100%" }}
|
target="_blank"
|
||||||
>
|
style={{ width: "100%" }}
|
||||||
GitHub
|
sx={{ my: 2, color: "white", display: "block" }}
|
||||||
</Button>
|
>
|
||||||
|
GitHub
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Box, Button } from "@mui/material";
|
import { Box, Button, Tooltip } from "@mui/material";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { LoginDialog } from "./LoginDialog";
|
import { LoginDialog } from "./LoginDialog";
|
||||||
|
|
||||||
@@ -6,13 +6,15 @@ export const LoginButton = () => {
|
|||||||
const [loginDialogOpen, setLoginDialogOpen] = useState(false);
|
const [loginDialogOpen, setLoginDialogOpen] = useState(false);
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Button
|
<Tooltip title="Login with your EVE characters to track your planets">
|
||||||
style={{ width: "100%" }}
|
<Button
|
||||||
variant="contained"
|
style={{ width: "100%" }}
|
||||||
onClick={() => setLoginDialogOpen(true)}
|
sx={{ my: 2, color: "white", display: "block" }}
|
||||||
>
|
onClick={() => setLoginDialogOpen(true)}
|
||||||
Login
|
>
|
||||||
</Button>
|
Login
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
<LoginDialog
|
<LoginDialog
|
||||||
open={loginDialogOpen}
|
open={loginDialogOpen}
|
||||||
closeDialog={() => setLoginDialogOpen(false)}
|
closeDialog={() => setLoginDialogOpen(false)}
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import { Box, Grid, Stack } from "@mui/material";
|
import {
|
||||||
|
Box,
|
||||||
|
CssBaseline,
|
||||||
|
Grid,
|
||||||
|
Stack,
|
||||||
|
ThemeProvider,
|
||||||
|
createTheme,
|
||||||
|
} from "@mui/material";
|
||||||
import { LoginButton } from "./Login/LoginButton";
|
import { LoginButton } from "./Login/LoginButton";
|
||||||
import { AccountCard } from "./Account/AccountCard";
|
import { AccountCard } from "./Account/AccountCard";
|
||||||
import { AccessToken } from "@/types";
|
import { AccessToken } from "@/types";
|
||||||
@@ -8,11 +15,18 @@ import { DowloadButton } from "./Backup/DowloadButton";
|
|||||||
import { DiscordButton } from "./Discord/DiscordButton";
|
import { DiscordButton } from "./Discord/DiscordButton";
|
||||||
import { GitHubButton } from "./Github/GitHubButton";
|
import { GitHubButton } from "./Github/GitHubButton";
|
||||||
import { UploadButton } from "./Backup/UploadButton";
|
import { UploadButton } from "./Backup/UploadButton";
|
||||||
|
import ResponsiveAppBar from "./AppBar/AppBar";
|
||||||
|
|
||||||
interface Grouped {
|
interface Grouped {
|
||||||
[key: string]: AccessToken[];
|
[key: string]: AccessToken[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const darkTheme = createTheme({
|
||||||
|
palette: {
|
||||||
|
mode: "dark",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const MainGrid = ({ sessionReady }: { sessionReady: boolean }) => {
|
export const MainGrid = ({ sessionReady }: { sessionReady: boolean }) => {
|
||||||
const { characters } = useContext(CharacterContext);
|
const { characters } = useContext(CharacterContext);
|
||||||
const groupByAccount = characters.reduce<Grouped>((group, character) => {
|
const groupByAccount = characters.reduce<Grouped>((group, character) => {
|
||||||
@@ -23,29 +37,27 @@ export const MainGrid = ({ sessionReady }: { sessionReady: boolean }) => {
|
|||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<ThemeProvider theme={darkTheme}>
|
||||||
<Grid container spacing={1}>
|
<CssBaseline />
|
||||||
<Grid item xs={2}>
|
<Box sx={{ flexGrow: 1 }}>
|
||||||
<Stack direction="row" spacing={1}>
|
<ResponsiveAppBar />
|
||||||
<LoginButton />
|
<Grid container spacing={1}>
|
||||||
<DowloadButton />
|
<Grid item xs={2}>
|
||||||
<UploadButton />
|
<Stack direction="row" spacing={1}></Stack>
|
||||||
<DiscordButton />
|
</Grid>
|
||||||
<GitHubButton />
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
<Grid container spacing={1}>
|
||||||
<Grid container spacing={1}>
|
<Grid item xs={12}>
|
||||||
<Grid item xs={12}>
|
{Object.values(groupByAccount).map((g, id) => (
|
||||||
{Object.values(groupByAccount).map((g, id) => (
|
<AccountCard
|
||||||
<AccountCard
|
key={`account-${id}-${g[0].account}`}
|
||||||
key={`account-${id}-${g[0].account}`}
|
characters={g}
|
||||||
characters={g}
|
sessionReady={sessionReady}
|
||||||
sessionReady={sessionReady}
|
/>
|
||||||
/>
|
))}
|
||||||
))}
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Box>
|
||||||
</Box>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user