-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from DNO-inc/feature#13
Created function to login + create ticket
- Loading branch information
Showing
50 changed files
with
1,145 additions
and
539 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"common": { | ||
"login": "Log in", | ||
"signup": "Sign Up", | ||
"profile": "Profile", | ||
"error": "Error" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"common": { | ||
"login": "Авторизація", | ||
"signup": "Реєстрація", | ||
"profile": "Профіль", | ||
"error": "Помилка" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Grid, Typography } from "@mui/material"; | ||
|
||
const ComingSoon = () => { | ||
return ( | ||
<Grid | ||
container | ||
sx={{ height: "70vh", justifyContent: "center", alignItems: "center" }} | ||
> | ||
<Typography | ||
sx={{ | ||
textTransform: "capitalize", | ||
fontSize: "90px", | ||
fontWeight: "bold", | ||
}} | ||
> | ||
<span>Coming</span> | ||
<br /> | ||
<span>Soon...</span> | ||
</Typography> | ||
</Grid> | ||
); | ||
}; | ||
|
||
ComingSoon.propTypes = {}; | ||
|
||
export { ComingSoon }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { ComingSoon } from "./ComingSoon"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/components/Layout/components/Header/components/AuthZone/AuthZone.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import List from "@mui/material/List"; | ||
import PropTypes from "prop-types"; | ||
import { AuthActions } from "./components/AuthActions"; | ||
import { NoAuthActions } from "./components/NoAuthActions"; | ||
|
||
const AuthZone = ({ isAuth, setIsAuth }) => { | ||
return ( | ||
<List | ||
sx={{ | ||
"& > li": { | ||
padding: { xs: 0, md: "8px 16px" }, | ||
}, | ||
}} | ||
> | ||
{isAuth ? ( | ||
<AuthActions setIsAuth={setIsAuth} /> | ||
) : ( | ||
<NoAuthActions setIsAuth={setIsAuth} /> | ||
)} | ||
</List> | ||
); | ||
}; | ||
|
||
AuthZone.propTypes = {}; | ||
|
||
export { AuthZone }; |
43 changes: 43 additions & 0 deletions
43
...nents/Layout/components/Header/components/AuthZone/components/AuthActions/AuthActions.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { | ||
Avatar, | ||
IconButton, | ||
ListItem, | ||
ListItemIcon, | ||
Typography, | ||
} from "@mui/material"; | ||
import { NavLink } from "react-router-dom"; | ||
import { VerticalDivider } from "../../../../../../../VerticalDivider"; | ||
import LogoutIcon from "@mui/icons-material/Logout"; | ||
import Logo from "../../../../../../../../assets/Logomark.svg"; | ||
import { endpoints } from "../../../../../../../../constants"; | ||
|
||
const AuthActions = ({ setIsAuth }) => { | ||
const handleLogOut = () => { | ||
localStorage.removeItem("jwt-token"); | ||
setIsAuth(false); | ||
}; | ||
|
||
return ( | ||
<ListItem key={"Log out"} sx={{ display: "flex", gap: 2 }}> | ||
<Typography sx={{ display: { xs: "none", md: "inline-block" } }}> | ||
User name | ||
</Typography> | ||
<NavLink to={endpoints.profile}> | ||
<Avatar alt="Avatar" src={Logo} sizes="40" sx={{ mr: 1 }} /> | ||
</NavLink> | ||
<VerticalDivider /> | ||
<NavLink to={endpoints.base}> | ||
<IconButton onClick={handleLogOut} sx={{ minWidth: 2 }}> | ||
<ListItemIcon sx={{ minWidth: 2 }}> | ||
<LogoutIcon /> | ||
</ListItemIcon> | ||
</IconButton> | ||
</NavLink> | ||
<VerticalDivider /> | ||
</ListItem> | ||
); | ||
}; | ||
|
||
AuthActions.propTypes = {}; | ||
|
||
export { AuthActions }; |
1 change: 1 addition & 0 deletions
1
src/components/Layout/components/Header/components/AuthZone/components/AuthActions/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { AuthActions } from "./AuthActions"; |
54 changes: 54 additions & 0 deletions
54
...s/Layout/components/Header/components/AuthZone/components/NoAuthActions/NoAuthActions.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { useState } from "react"; | ||
import { Box, Button, ListItem } from "@mui/material"; | ||
import { LogInModal } from "../../../../../../../LogInModal"; | ||
import { SignUpModal } from "../../../../../../../SignUpModal"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
const NoAuthActions = ({ setIsAuth }) => { | ||
const { t } = useTranslation(); | ||
const [showSignUp, setShowSignUp] = useState(false); | ||
const [showLogIn, setShowLogIn] = useState(false); | ||
|
||
const handleSignUp = () => { | ||
setShowSignUp(true); | ||
}; | ||
|
||
const handleLogIn = () => { | ||
setShowLogIn(true); | ||
}; | ||
|
||
return ( | ||
<Box sx={{ display: "flex" }}> | ||
{/* <ListItem key={"Sign Up"}> | ||
<Button | ||
variant="contained" | ||
onClick={handleSignUp} | ||
sx={{ minWidth: "110%" }} | ||
> | ||
{t("common.signup")} | ||
</Button> | ||
</ListItem> | ||
{showSignUp && <SignUpModal open={showSignUp} setOpen={setShowSignUp} />} */} | ||
<ListItem key={"Log In"}> | ||
<Button | ||
variant="contained" | ||
onClick={handleLogIn} | ||
sx={{ minWidth: "100%" }} | ||
> | ||
{t("common.login")} | ||
</Button> | ||
</ListItem> | ||
{showLogIn && ( | ||
<LogInModal | ||
open={showLogIn} | ||
setOpen={setShowLogIn} | ||
setIsAuth={setIsAuth} | ||
/> | ||
)} | ||
</Box> | ||
); | ||
}; | ||
|
||
NoAuthActions.propTypes = {}; | ||
|
||
export { NoAuthActions }; |
1 change: 1 addition & 0 deletions
1
...components/Layout/components/Header/components/AuthZone/components/NoAuthActions/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { NoAuthActions } from "./NoAuthActions"; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.