diff --git a/package-lock.json b/package-lock.json index 601fbc9a2..893517d4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1689,24 +1689,6 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" }, - "@styled-icons/material-outlined": { - "version": "10.28.0", - "resolved": "https://registry.npmjs.org/@styled-icons/material-outlined/-/material-outlined-10.28.0.tgz", - "integrity": "sha512-TXCYrBeR5YXDziNMDAO6ZpKVjWvWaWmhBvF/vTvL6sME5zazk9sToyRJ6i/+DZGNH8wD7+635e8hkZAYPp++/A==", - "requires": { - "@babel/runtime": "^7.12.13", - "@styled-icons/styled-icon": "^10.6.0" - } - }, - "@styled-icons/styled-icon": { - "version": "10.6.3", - "resolved": "https://registry.npmjs.org/@styled-icons/styled-icon/-/styled-icon-10.6.3.tgz", - "integrity": "sha512-/A95L3peioLoWFiy+/eKRhoQ9r/oRrN/qzbSX4hXU1nGP2rUXcX3LWUhoBNAOp9Rw38ucc/4ralY427UUNtcGQ==", - "requires": { - "@babel/runtime": "^7.10.5", - "@emotion/is-prop-valid": "^0.8.7" - } - }, "@svgr/babel-plugin-add-jsx-attribute": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz", diff --git a/package.json b/package.json index f97f488e4..5f4539bfc 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,6 @@ "version": "0.1.0", "private": true, "dependencies": { - "@styled-icons/material-outlined": "^10.28.0", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^10.4.9", "@testing-library/user-event": "^12.1.3", diff --git a/src/components/Account/index.jsx b/src/components/Account/index.jsx index 629f176d8..d1ebcd44a 100644 --- a/src/components/Account/index.jsx +++ b/src/components/Account/index.jsx @@ -4,6 +4,7 @@ import { AccountIcon, Dropdown, Button } from './styled'; import { AUTH_STORAGE_KEY } from '../../utils/constants'; import { storage } from '../../utils/storage'; import { useAuth } from '../../providers/Auth'; +import user from '../../img/user.svg'; const Account = () => { const { logout } = useAuth(); @@ -19,6 +20,7 @@ const Account = () => { return (
{ setOpenDrop(!openDrop); }} diff --git a/src/components/Account/styled.js b/src/components/Account/styled.js index 6e5872457..e3646ac5e 100644 --- a/src/components/Account/styled.js +++ b/src/components/Account/styled.js @@ -1,7 +1,6 @@ import styled from 'styled-components'; -import { AccountCircle } from '@styled-icons/material-outlined/AccountCircle'; -const AccountIcon = styled(AccountCircle)` +const AccountIcon = styled.img` color: white; width: 50px; height: 50px; diff --git a/src/components/App/App.component.jsx b/src/components/App/App.component.jsx index c96a88431..24c683223 100644 --- a/src/components/App/App.component.jsx +++ b/src/components/App/App.component.jsx @@ -7,18 +7,16 @@ import Layout from '../Layout'; import HomePage from '../../pages/Home'; import LoginPage from '../../pages/Login'; import VideoDetailPage from '../../pages/VideoDetail'; +import FavoritesPage from '../../pages/Favorites'; import NotFound from '../../pages/NotFound'; -import SearchWordContext from '../../state/SearchWordContext'; -import SearchWordReducer from '../../state/SearchWordReducer'; -import ThemeContext from '../../state/ThemeContext'; -import ThemeReducer from '../../state/ThemeReducer'; +import GlobalContext from '../../state/GlobalContext'; +import GlobalReducer from '../../state/GlobalReducer'; +import Private from '../Private'; export default function App() { const [videos, setVideos] = React.useState([]); - const [state, dispatch] = useReducer(SearchWordReducer, { + const [state, dispatch] = useReducer(GlobalReducer, { word: 'Wizeline', - }); - const [stateTheme, dispatchTheme] = useReducer(ThemeReducer, { theme: { navBar: '#3fc7cb', content: 'white', @@ -29,27 +27,28 @@ export default function App() { return ( - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + ); diff --git a/src/components/NavBar/index.jsx b/src/components/NavBar/index.jsx index 4bbcc4d2c..297f18b4a 100644 --- a/src/components/NavBar/index.jsx +++ b/src/components/NavBar/index.jsx @@ -12,15 +12,13 @@ import { NavElementsWrapper, } from './styled'; import { fetchVideos } from '../../lib/youTubeApi'; -import SearchWordContext from '../../state/SearchWordContext'; -import ThemeContext from '../../state/ThemeContext'; +import GlobalContext from '../../state/GlobalContext'; const Navbar = ({ setVideos }) => { const [checked, setChecked] = React.useState(false); const [open, setOpen] = React.useState(false); - const { state } = useContext(SearchWordContext); - const { stateTheme, dispatchTheme } = useContext(ThemeContext); - const { theme } = stateTheme; + const { state, dispatch } = useContext(GlobalContext); + const { theme } = state; React.useEffect(() => { fetchVideos(state.word).then((videosData) => { @@ -31,21 +29,25 @@ const Navbar = ({ setVideos }) => { const changeHandler = () => { setChecked(!checked); if (!checked) { - dispatchTheme({ + dispatch({ type: 'SET_THEME', payload: { - navBar: '#556cd6', - content: '#303030', - text: 'white', + theme: { + navBar: '#556cd6', + content: '#303030', + text: 'white', + }, }, }); } else { - dispatchTheme({ + dispatch({ type: 'SET_THEME', payload: { - navBar: '#3fc7cb', - content: 'white', - text: 'black', + theme: { + navBar: '#3fc7cb', + content: 'white', + text: 'black', + }, }, }); } @@ -55,7 +57,9 @@ const Navbar = ({ setVideos }) => {