Skip to content

Commit

Permalink
added login button
Browse files Browse the repository at this point in the history
Signed-off-by: Med16-11 <[email protected]>
  • Loading branch information
Med16-11 committed Aug 9, 2023
1 parent 3a30b59 commit 6fc71b4
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions src/components/AppBar/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import { Link as RouterLink } from "react-router-dom";
import { styled } from '@mui/material/styles';
import { styled } from "@mui/material/styles";
import { useTheme } from "@mui/material/styles";
import IconButton from "@mui/material/IconButton";
import MenuIcon from "@mui/icons-material/Menu";
Expand All @@ -8,20 +9,18 @@ import Brightness7Icon from "@mui/icons-material/Brightness7";
import MuiAppBar from "@mui/material/AppBar";
import Toolbar from "@mui/material/Toolbar";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";

const PREFIX = 'index';
const PREFIX = "index";

const classes = {
appBar: `${PREFIX}-appBar`,
title: `${PREFIX}-title`,
toolbarIcon: `${PREFIX}-toolbarIcon`
toolbarIcon: `${PREFIX}-toolbarIcon`,
loginButton: `${PREFIX}-loginButton`,
};

const StyledMuiAppBar = styled(MuiAppBar)((
{
theme
}
) => ({
const StyledMuiAppBar = styled(MuiAppBar)(({ theme }) => ({
[`&.${classes.appBar}`]: {
zIndex: theme.zIndex.drawer + 1,
},
Expand All @@ -40,7 +39,11 @@ const StyledMuiAppBar = styled(MuiAppBar)((
alignItems: "center",
justifyContent: "flex-end",
padding: "0 8px",
}
},

[`& .${classes.loginButton}`]: {
marginLeft: "12px",
},
}));

export default function AppBar(props) {
Expand Down Expand Up @@ -78,10 +81,22 @@ export default function AppBar(props) {
Pulpito
</RouterLink>
</Typography>
<Button
component={RouterLink}
to="http://localhost:8082/login"
color="inherit"
sx={{
bgcolor: "#b81f14",
marginLeft: "12px",
}}
>
Login
</Button>

<IconButton onClick={props.toggleDarkMode} size="large">
{props.darkMode ? <Brightness7Icon /> : <Brightness4Icon />}
</IconButton>
</Toolbar>
</StyledMuiAppBar>
);
}
}

0 comments on commit 6fc71b4

Please sign in to comment.