Skip to content

Commit

Permalink
refactor: removed material-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhadwen committed Jul 8, 2020
1 parent 59cfe67 commit 98b094e
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 262 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.9.10",
"@material-ui/icons": "^4.9.1",
"firebase": "^7.14.0",
"fuse.js": "^5.2.3",
"normalize.css": "^8.0.1",
Expand Down
Binary file added public/images/icons/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icons/chevron-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icons/close-slim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icons/close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icons/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions src/components/accordion/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React, { useState, useContext, createContext } from 'react';
import AddIcon from '@material-ui/icons/Add';
import CloseIcon from '@material-ui/icons/Close';
import { Container, Frame, Title, Item, Inner, Header, Body } from './styles/accordion';

const ToggleContext = createContext();
Expand Down Expand Up @@ -37,7 +35,11 @@ Accordion.Header = function AccordionHeader({ children, ...restProps }) {
return (
<Header onClick={() => setToggleShow(!toggleShow)} {...restProps}>
{children}
{toggleShow ? <CloseIcon fontSize="large" /> : <AddIcon fontSize="large" />}
{toggleShow ? (
<img src="/images/icons/close-slim.png" alt="Close" />
) : (
<img src="/images/icons/add.png" alt="Open" />
)}
</Header>
);
};
Expand Down
5 changes: 5 additions & 0 deletions src/components/accordion/styles/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export const Header = styled.div`
user-select: none;
align-items: center;
img {
filter: brightness(0) invert(1);
width: 24px;
}
@media (max-width: 600px) {
font-size: 16px;
}
Expand Down
6 changes: 4 additions & 2 deletions src/components/card/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState, useContext, createContext } from 'react';
import CancelIcon from '@material-ui/icons/Cancel';

import {
Container,
Expand All @@ -10,6 +9,7 @@ import {
Feature,
FeatureTitle,
FeatureText,
FeatureClose,
Maturity,
Content,
Meta,
Expand Down Expand Up @@ -83,7 +83,9 @@ Card.Feature = function CardFeature({ children, category, ...restProps }) {
<Content>
<FeatureTitle>{itemFeature.title}</FeatureTitle>
<FeatureText>{itemFeature.description}</FeatureText>
<CancelIcon className="cancel" fontSize="large" onClick={() => setShowFeature(false)} />
<FeatureClose onClick={() => setShowFeature(false)}>
<img src="/images/icons/close.png" alt="Close" />
</FeatureClose>

<Group margin="30px 0" flexDirection="row" alignItems="center">
<Maturity rating={itemFeature.maturity}>{itemFeature.maturity < 12 ? 'PG' : itemFeature.maturity}</Maturity>
Expand Down
23 changes: 15 additions & 8 deletions src/components/card/styles/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,26 @@ export const FeatureTitle = styled(Title)`
margin-left: 0;
`;

export const FeatureClose = styled.button`
color: white;
position: absolute;
right: 20px;
top: 20px;
cursor: pointer;
background-color: transparent;
border: 0;
img {
filter: brightness(0) invert(1);
width: 24px;
}
`;

export const Content = styled.div`
margin: 56px;
max-width: 500px;
line-height: normal;
svg.cancel {
color: white;
position: absolute;
right: 20px;
top: 20px;
cursor: pointer;
}
@media (max-width: 1000px) {
margin: 30px;
max-width: none;
Expand Down
14 changes: 5 additions & 9 deletions src/components/header/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React, { useState } from 'react';
import SearchIcon from '@material-ui/icons/Search';
import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
import { Link as ReachRouterLink } from 'react-router-dom';
import {
Container,
Expand All @@ -12,6 +10,7 @@ import {
Search,
Profile,
FeatureCallOut,
SearchIcon,
SearchInput,
ButtonLink,
PlayButton,
Expand Down Expand Up @@ -45,7 +44,9 @@ Header.Search = function HeaderSearch({ searchTerm, setSearchTerm, ...restProps

return (
<Search {...restProps}>
<SearchIcon onClick={() => setSearchActive(!searchActive)} />
<SearchIcon onClick={() => setSearchActive(!searchActive)}>
<img src="/images/icons/search.png" alt="Search" />
</SearchIcon>
<SearchInput
value={searchTerm}
onChange={({ target }) => setSearchTerm(target.value)}
Expand All @@ -57,12 +58,7 @@ Header.Search = function HeaderSearch({ searchTerm, setSearchTerm, ...restProps
};

Header.Profile = function HeaderProfile({ children, ...restProps }) {
return (
<Profile {...restProps}>
{children}
<ArrowDropDownIcon />
</Profile>
);
return <Profile {...restProps}>{children}</Profile>;
};

Header.Feature = function HeaderFeature({ children, ...restProps }) {
Expand Down
19 changes: 12 additions & 7 deletions src/components/header/styles/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ export const Search = styled.div`
}
`;

export const SearchIcon = styled.button`
cursor: pointer;
background-color: transparent;
border: 0;
img {
filter: brightness(0) invert(1);
width: 16px;
}
`;

export const ButtonLink = styled(ReachRouterLink)`
display: block;
background-color: #e50914;
Expand Down Expand Up @@ -147,13 +158,7 @@ export const Profile = styled.div`
margin-left: 20px;
position: relative;
svg {
color: white;
margin-left: 5px;
}
button,
svg {
button {
cursor: pointer;
}
Expand Down
3 changes: 1 addition & 2 deletions src/components/opt-form/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import ChevronRightIcon from '@material-ui/icons/ChevronRight';
import { Container, Input, Break, Button, Text } from './styles/opt-form';

export default function OptForm({ children, ...restProps }) {
Expand All @@ -13,7 +12,7 @@ OptForm.Input = function OptFormInput({ ...restProps }) {
OptForm.Button = function OptFormButton({ children, ...restProps }) {
return (
<Button {...restProps}>
{children} <ChevronRightIcon fontSize="large" />
{children} <img src="/images/icons/chevron-right.png" alt="Try Now" />
</Button>
);
};
Expand Down
6 changes: 6 additions & 0 deletions src/components/opt-form/styles/opt-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export const Button = styled.button`
border: 0;
cursor: pointer;
img {
margin-left: 10px;
filter: brightness(0) invert(1);
width: 24px;
}
&:hover {
background: #f40612;
}
Expand Down
8 changes: 1 addition & 7 deletions src/components/player/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState, useContext, createContext } from 'react';
import PlayArrowIcon from '@material-ui/icons/PlayArrow';
import ReactDOM from 'react-dom';
import { Container, Button, Overlay, Inner } from './styles/player';

Expand Down Expand Up @@ -35,10 +34,5 @@ Player.Video = function PlayerVideo({ ...restProps }) {
Player.Button = function PlayerButton({ ...restProps }) {
const { showPlayer, setShowPlayer } = useContext(PlayerContext);

return (
<Button onClick={() => setShowPlayer(!showPlayer)}>
<PlayArrowIcon className="play" />
Play
</Button>
);
return <Button onClick={() => setShowPlayer(!showPlayer)}>Play</Button>;
};
4 changes: 0 additions & 4 deletions src/components/player/styles/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,4 @@ export const Button = styled.button`
transform: scale(1.05);
background-color: #ff0a16;
}
svg.play {
margin-right: 5px;
}
`;
Loading

0 comments on commit 98b094e

Please sign in to comment.