Skip to content

Commit

Permalink
Merge pull request #178 from VasylievYurii/colorAndnav
Browse files Browse the repository at this point in the history
Color andnav
  • Loading branch information
VasylievYurii authored Nov 22, 2023
2 parents 6ceca14 + 4652d77 commit 5719c91
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
19 changes: 13 additions & 6 deletions src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react';
import { useDispatch } from 'react-redux';
import { useDispatch, useSelector } from 'react-redux';
import MediaQuery from 'react-responsive';
import { Link } from 'react-router-dom';
import sprite from '../../assets/sprite.svg';
Expand All @@ -26,6 +26,8 @@ const Header = () => {
setIsMenuOpen((prevState) => !prevState);
};

const { targetBmr } = useSelector((state) => state.indicators.indicators);

const handleLogOut = () => {
dispatch(logOutUser());
};
Expand All @@ -38,11 +40,16 @@ const Header = () => {
</Link>
<SecondNavWrapper>
<MediaQuery minWidth={1440}>
<NavWrapper>
<StyledLink to="/diary">Diary</StyledLink>
<StyledLink to="/products">Products</StyledLink>
<StyledLink to="/exercises">Exercises</StyledLink>
</NavWrapper>
{targetBmr === 0 ? (
(console.log('NavWrapper not rendered: NaN'), null)
) : (
<NavWrapper>
<StyledLink to="/diary">Diary</StyledLink>
<StyledLink to="/products">Products</StyledLink>
<StyledLink to="/exercises">Exercises</StyledLink>
{console.log('NavWrapper rendered')}
</NavWrapper>
)}
</MediaQuery>
<StyledLinkSettings to="/profile">
<UserBar />
Expand Down
9 changes: 3 additions & 6 deletions src/components/SignInForm/SignInForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,13 @@ const SignInForm = () => {
? errors.email
? '1px solid #D80027'
: '1px solid #3CBF61'
: '1px solid #efede8';
// (errors.email && touched.email && '1px solid #D80027') ||
// (!errors.email && touched.email && '1px solid #3CBF61');
: '1px solid #EFEDE84D';

const borderPasswordColor = touched.password
? errors.password
? '1px solid #D80027'
: '1px solid #3CBF61'
: '1px solid #efede8';
// (errors.password && touched.password && '1px solid #D80027') ||
// (!errors.password && touched.password && '1px solid #3CBF61');
: '1px solid #EFEDE84D';

return (
<Form autoComplete="off">
Expand Down
5 changes: 2 additions & 3 deletions src/components/SignUpForm/SignUpForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const initialValues = {
const SignUpForm = () => {
const [toggleIcon, setToggleIcon] = useState(`${sprite}#icon-eye-off`);
const [type, setType] = useState('password');
// const [validColor, setValidColor] = useState('red');

const dispatch = useDispatch();

Expand Down Expand Up @@ -110,7 +109,7 @@ const SignUpForm = () => {
? errors.email
? '1px solid #D80027'
: '1px solid #3CBF61'
: '1px solid #efede8'
: '1px solid #EFEDE84D'
}
type="text"
name="email"
Expand Down Expand Up @@ -142,7 +141,7 @@ const SignUpForm = () => {
? errors.password
? '1px solid #D80027'
: '1px solid #3CBF61'
: '1px solid #efede8'
: '1px solid #EFEDE84D'
}
type={type}
name="password"
Expand Down
8 changes: 4 additions & 4 deletions src/components/UserForm/UserForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import userSchema from '../../schema/userProfileSchema';
import RadioUseForm from './RadioUseForm/RadioUseForm';
import InputUseForm from './InputUseForm/InputUseForm';
import { SubmitBtn, SuccessText } from './UserForm.styled';
import { SubmitBtn } from './UserForm.styled';
import { toast } from 'react-toastify';

const toastInfo = (text) => {
Expand All @@ -26,7 +26,6 @@ const toastInfo = (text) => {
});
};


const initialValues = {
name: '',
email: '',
Expand Down Expand Up @@ -103,8 +102,9 @@ const UserForm = ({ onClick }) => {
/>
<RadioUseForm />

<SubmitBtn type="submit" onClick={onClick}>Save</SubmitBtn>

<SubmitBtn type="submit" onClick={onClick}>
Save
</SubmitBtn>
</Form>
)}
</Formik>
Expand Down

0 comments on commit 5719c91

Please sign in to comment.