This commit is contained in:
Николай Полтщук 2022-10-19 17:47:07 +03:00
parent b4e5ca9140
commit d1f50e6d64
2 changed files with 62 additions and 49 deletions

View File

@ -10,6 +10,7 @@ export const HeaderQuiz = ({header}) => {
const dispatch = useDispatch()
const userId = localStorage.getItem('id');
const userInfo = useSelector(selectUserInfo);
console.log(userInfo)
useEffect(() => {
dispatch(setUserInfo(userId))
@ -26,6 +27,8 @@ export const HeaderQuiz = ({header}) => {
}, [dispatch])
return (
<div>
{ userInfo?.status === 500 ? <div className="error-msg">{userInfo.message}</div> :
<div className="header-quiz">
<div className="header-quiz__container">
{!userInfo ? <h2>Loading...</h2> :
@ -42,5 +45,7 @@ export const HeaderQuiz = ({header}) => {
}
</div>
</div>
}
</div>
)
}

View File

@ -72,6 +72,14 @@ $maxWidthContainer: 1123;
line-height: math.div(30, 25);
}
//=============================================
.error-msg {
text-align: center;
font-size: 25px;
color: red;
font-weight: 500;
}
.header-quiz{
@include adaptiv-value("padding-top", 48, 30, 1);
@include adaptiv-value("padding-bottom", 85, 30, 1);