The Dashboard button now redirects to the Navigation.jsx
This commit is contained in:
parent
62603a30a4
commit
a448cb9d16
@ -1,10 +1,11 @@
|
||||
import LogoDark from "@/common/assets/images/logo/dark.webp";
|
||||
import LogoLight from "@/common/assets/images/logo/light.webp";
|
||||
|
||||
import {AppBar, Button, IconButton, Link, Stack, Typography, useMediaQuery, useTheme} from "@mui/material";
|
||||
import {AppBar, Button, CircularProgress, IconButton, Link, Stack, Typography, useMediaQuery, useTheme} from "@mui/material";
|
||||
import {Menu} from "@mui/icons-material";
|
||||
import {useNavigate} from "react-router-dom";
|
||||
import routes from "@/common/routes";
|
||||
import {useState} from "react";
|
||||
|
||||
const NAVBAR_HEIGHT = 80;
|
||||
|
||||
@ -15,6 +16,13 @@ export const Navigation = () => {
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down("lg"));
|
||||
const isDarkMode = theme.palette.mode === "dark";
|
||||
|
||||
const [dashboardLoading, setDashboardLoading] = useState(false);
|
||||
|
||||
const openDashboard = () => {
|
||||
setDashboardLoading(true);
|
||||
setTimeout(() => location.href = "https://dash.licenseapi.de", 500);
|
||||
}
|
||||
|
||||
return (
|
||||
<AppBar position="fixed" sx={{height: NAVBAR_HEIGHT, boxShadow: "none", justifyContent: "center",
|
||||
backgroundColor: isDarkMode ? "rgba(0, 0, 0, 0.5)" : "rgba(255, 255, 255, 0.5)",
|
||||
@ -35,7 +43,8 @@ export const Navigation = () => {
|
||||
</Link>)}
|
||||
</Stack>
|
||||
|
||||
<Button variant="contained">Anmelden</Button>
|
||||
<Button variant="contained" onClick={openDashboard} disabled={dashboardLoading}>{dashboardLoading
|
||||
&& <CircularProgress size={18} color="inherit" sx={{mr: 1}}/>} Dashboard</Button>
|
||||
</>}
|
||||
|
||||
{isMobile && <>
|
||||
|
Loading…
x
Reference in New Issue
Block a user