generated from goitacademy/react-homework-template
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #15 from 001elijah/header
fix header fix loader fix userinfo
- Loading branch information
Showing
8 changed files
with
79 additions
and
52 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
import clsx from 'clsx'; | ||
import { useSelector } from 'react-redux'; | ||
import { selectorIsLoading } from 'redux/Loader/loaderSelectors'; | ||
import { selectorTheme } from 'redux/Auth/authSelectors'; | ||
import s from './Loader.module.scss'; | ||
|
||
export const Loader = () => { | ||
const triInvert = clsx(s.tri, s.invert); | ||
const isLoading = useSelector(selectorIsLoading); | ||
const theme = useSelector(selectorTheme); | ||
return ( | ||
<div className={s.triangles}> | ||
<div className={triInvert}></div> | ||
<div className={triInvert}></div> | ||
<div className={s.tri}></div> | ||
<div className={triInvert}></div> | ||
<div className={triInvert}></div> | ||
<div className={s.tri}></div> | ||
<div className={triInvert}></div> | ||
<div className={s.tri}></div> | ||
<div className={triInvert}></div> | ||
</div> | ||
isLoading && ( | ||
<div className={s.triangles}> | ||
<div className={clsx(s.tri, s.invert, s[theme])}></div> | ||
<div className={clsx(s.tri, s.invert, s[theme])}></div> | ||
<div className={clsx(s.tri, s[theme])}></div> | ||
<div className={clsx(s.tri, s.invert, s[theme])}></div> | ||
<div className={clsx(s.tri, s.invert, s[theme])}></div> | ||
<div className={clsx(s.tri, s[theme])}></div> | ||
<div className={clsx(s.tri, s.invert, s[theme])}></div> | ||
<div className={clsx(s.tri, s[theme])}></div> | ||
<div className={clsx(s.tri, s.invert, s[theme])}></div> | ||
</div> | ||
) | ||
); | ||
}; |
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,18 +1,3 @@ | ||
import { useSelector } from 'react-redux'; | ||
|
||
// import { Header } from 'components/Header/Header'; | ||
import { Loader } from 'components/Loader/Loader'; | ||
|
||
export const SharedLayout = () => { | ||
// const token = useSelector(state => state.auth?.token); | ||
const isLoading = useSelector(state => state.auth?.isLoading); | ||
|
||
return ( | ||
<> | ||
{isLoading && <Loader />} | ||
|
||
{/* {token && <Header />} */} | ||
{/* <Header/> */} | ||
</> | ||
); | ||
return <>SharedLayout</>; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export const selectorIsAuth = state => Boolean(state.auth.token); | ||
|
||
export const selectorTheme = state => state.auth.theme; | ||
|
||
export const selectorUserName = state => state.auth.userName; | ||
|
||
export const selectorAvatarURL = state => state.auth.avatarUrl; |