diff --git a/package-lock.json b/package-lock.json index d676a84..c89c93f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "react-helmet": "^6.1.0", "react-helmet-async": "^1.3.0", "react-hot-toast": "^2.4.0", + "react-icons": "^4.9.0", "react-loader-spinner": "^5.3.4", "react-private-route": "^1.1.2", "react-redux": "^8.0.5", @@ -12014,6 +12015,14 @@ "react-dom": ">=16" } }, + "node_modules/react-icons": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.9.0.tgz", + "integrity": "sha512-ijUnFr//ycebOqujtqtV9PFS7JjhWg0QU6ykURVHuL4cbofvRCf3f6GMn9+fBktEFQOIVZnuAYLZdiyadRQRFg==", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -23629,6 +23638,12 @@ "goober": "^2.1.10" } }, + "react-icons": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.9.0.tgz", + "integrity": "sha512-ijUnFr//ycebOqujtqtV9PFS7JjhWg0QU6ykURVHuL4cbofvRCf3f6GMn9+fBktEFQOIVZnuAYLZdiyadRQRFg==", + "requires": {} + }, "react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", diff --git a/package.json b/package.json index 16c078e..258ef39 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "react-helmet": "^6.1.0", "react-helmet-async": "^1.3.0", "react-hot-toast": "^2.4.0", + "react-icons": "^4.9.0", "react-loader-spinner": "^5.3.4", "react-private-route": "^1.1.2", "react-redux": "^8.0.5", diff --git a/src/components/PrivateRoute.js b/src/components/PrivateRoute.js index 1a748cc..8a950d8 100644 --- a/src/components/PrivateRoute.js +++ b/src/components/PrivateRoute.js @@ -1,10 +1,8 @@ import { Navigate } from 'react-router-dom'; import { useAuth } from 'hooks/useAuth'; -/** - * - If the route is private and the user is logged in, render the component - * - Otherwise render to redirectTo - */ +// - If the route is private and the user is logged in, render the component +// - Otherwise render to redirectTo export const PrivateRoute = ({ component: Component, redirectTo = '/' }) => { const { isLoggedIn, isRefreshing } = useAuth(); diff --git a/src/components/RestrictedRoute.js b/src/components/RestrictedRoute.js index b9315ed..0ebbb9d 100644 --- a/src/components/RestrictedRoute.js +++ b/src/components/RestrictedRoute.js @@ -1,10 +1,8 @@ import { useAuth } from 'hooks/useAuth'; import { Navigate } from 'react-router-dom'; -/** - * - If the route is restricted and the user is logged in, render a to redirectTo - * - Otherwise render the component - */ +// - If the route is restricted and the user is logged in, render a to redirectTo +// - Otherwise render the component export const RestrictedRoute = ({ component: Component, redirectTo = '/' }) => { const { isLoggedIn } = useAuth(); diff --git a/src/components/authNav/AuthNav.styled.jsx b/src/components/authNav/AuthNav.styled.jsx index 982123c..ff8063c 100644 --- a/src/components/authNav/AuthNav.styled.jsx +++ b/src/components/authNav/AuthNav.styled.jsx @@ -6,9 +6,14 @@ export const NavLink = styled(Link)` text-decoration: none; padding: 12px; font-weight: 700; - color: #2a363b; + color: ${props => `${props.theme.colors.primary}`}; &.active { - color: #ea8d6b; + color: ${props => `${props.theme.colors.hover}`}; + } + + :hover, + :focus { + color: ${props => `${props.theme.colors.hover}`}; } `; diff --git a/src/components/constants/Theme.js b/src/components/constants/Theme.js index 90f0a46..4f7cb92 100644 --- a/src/components/constants/Theme.js +++ b/src/components/constants/Theme.js @@ -1,10 +1,11 @@ export const theme = { colors: { bg: 'rgba(196, 186, 186, 0.12)', - bd: '#f6c6a7', + bd: 'rgb(246, 218, 167)', font: 'rgb(126, 124, 124)', - green: 'rgb(169, 251, 46)', - red: 'rgb(241, 14, 14)', + hover: 'rgb(158, 47, 9)', + primary: 'rgb(237, 155, 107)', + btnText: 'rgb(68, 68, 68)', white: '#ffffff', }, }; diff --git a/src/components/contactForm/ContactForm.js b/src/components/contactForm/ContactForm.js index 307194e..5ad7c77 100644 --- a/src/components/contactForm/ContactForm.js +++ b/src/components/contactForm/ContactForm.js @@ -82,7 +82,7 @@ export const ContactForm = () => { /> - Add contact + Add diff --git a/src/components/contactForm/ContactForm.styled.jsx b/src/components/contactForm/ContactForm.styled.jsx index 7014371..c9d6565 100644 --- a/src/components/contactForm/ContactForm.styled.jsx +++ b/src/components/contactForm/ContactForm.styled.jsx @@ -39,7 +39,8 @@ export const ButtonSubmit = styled.button` font-family: arial, sans-serif; font-size: 15px; font-weight: bold; - color: rgb(68, 68, 68); + color: ${props => `${props.theme.colors.btnText}`}; + text-transform: capitalize; text-decoration: none; user-select: none; @@ -51,7 +52,7 @@ export const ButtonSubmit = styled.button` transition: all 0.218s ease 0s; :hover, :focus { - color: rgb(24, 24, 24); + color: ${props => `${props.theme.colors.hover}`}; border: 1px solid rgb(198, 198, 198); background: #f7f7f7 linear-gradient(#f7f7f7, #f1f1f1); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); diff --git a/src/components/contactItem/ContactItem.styled.jsx b/src/components/contactItem/ContactItem.styled.jsx index 7bf3bd7..0403f30 100644 --- a/src/components/contactItem/ContactItem.styled.jsx +++ b/src/components/contactItem/ContactItem.styled.jsx @@ -36,12 +36,9 @@ export const FirstLetterBox = styled.div` export const Name = styled.div` width: 200px; - /* border: 1px solid red; */ margin-left: 25px; `; export const Number = styled.div` width: 200px; - /* border: 1px solid blue; */ - /* margin-left: 10px; */ `; diff --git a/src/components/deleteContactWarning/DeleteContactWarning.styled.jsx b/src/components/deleteContactWarning/DeleteContactWarning.styled.jsx index a4d7a8e..34b297c 100644 --- a/src/components/deleteContactWarning/DeleteContactWarning.styled.jsx +++ b/src/components/deleteContactWarning/DeleteContactWarning.styled.jsx @@ -19,7 +19,6 @@ export const DeleteModal = styled.div` export const Text = styled.div` font-weight: bold; - /* margin-right: 10px; */ `; export const ButtonWrapper = styled.div` diff --git a/src/components/loader/Loader.js b/src/components/loader/Loader.js index 40193d4..5eaf4d0 100644 --- a/src/components/loader/Loader.js +++ b/src/components/loader/Loader.js @@ -6,7 +6,7 @@ export const Loader = ({ width }) => { return ( `${props.theme.colors.primary}`}; &.active { - color: #ea8d6b; + color: ${props => `${props.theme.colors.hover}`}; + } + + :hover, + :focus { + color: ${props => `${props.theme.colors.hover}`}; } `; diff --git a/src/components/userMenu/UserMenu.js b/src/components/userMenu/UserMenu.js index 0e65d54..da501ae 100644 --- a/src/components/userMenu/UserMenu.js +++ b/src/components/userMenu/UserMenu.js @@ -1,7 +1,7 @@ import { useDispatch } from 'react-redux'; import { logOut } from 'redux/auth/operations'; import { useAuth } from 'hooks/useAuth'; -import { Wrapper, Username, Button } from './UserMenu.styled'; +import { Wrapper, Username, Button, UserIcon } from './UserMenu.styled'; export const UserMenu = () => { const dispatch = useDispatch(); @@ -9,6 +9,7 @@ export const UserMenu = () => { return ( + {user.name}