-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
069cc52
commit c76506f
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/componants/shared/mobillenav/authsidebarbuttons/AuthSideBarButtons.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,37 @@ | ||
import { useTranslation } from "react-i18next"; | ||
import { useSelector } from "react-redux"; | ||
import { Link } from "react-router-dom"; | ||
import useSignOut from "src/Hooks/App/useSignOut"; | ||
import SvgIcon from "../../MiniComponents/SvgIcon"; | ||
import s from "./AuthSideBarButtons.module.scss"; | ||
|
||
const AuthSideBarButtons = () => { | ||
const { loginInfo } = useSelector((state) => state.user); | ||
const { isSignIn } = loginInfo; | ||
const handleSignOut = useSignOut(); | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<> | ||
{isSignIn && ( | ||
<button | ||
className={s.signOutButton} | ||
type="button" | ||
onClick={handleSignOut} | ||
> | ||
<SvgIcon name="boxArrowRight" /> | ||
<span>{t("mobileNav.signOut")}</span> | ||
</button> | ||
)} | ||
|
||
{!isSignIn && ( | ||
<Link to="/signup" className={s.signOutButton}> | ||
<SvgIcon name="boxArrowRight" /> | ||
<span>{t("mobileNav.signIn")}</span> | ||
</Link> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default AuthSideBarButtons; |
36 changes: 36 additions & 0 deletions
36
src/componants/shared/mobillenav/authsidebarbuttons/AuthSideBarButtons.module.scss
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,36 @@ | ||
.signOutButton { | ||
all: unset; | ||
-webkit-tap-highlight-color: transparent; | ||
color: var(--medium-light-gray); | ||
padding: 10px; | ||
min-width: 126px; | ||
display: flex; | ||
align-items: center; | ||
border-radius: 10px; | ||
cursor: pointer; | ||
outline: solid 2px transparent; | ||
transition: background-color .2s, outline-color .2s; | ||
|
||
&[class=active], | ||
&:hover { | ||
background-color: rgba(87, 87, 87, .5); | ||
} | ||
|
||
&[class=active]:hover { | ||
background-color: rgba(87, 87, 87, .8); | ||
} | ||
|
||
&:focus-visible { | ||
outline-color: var(--white); | ||
} | ||
} | ||
|
||
.signOutButton span { | ||
padding-inline-start: 16px; | ||
} | ||
|
||
.signOutButton svg { | ||
fill: var(--white); | ||
width: 20px; | ||
height: 20px; | ||
} |