Skip to content

Commit

Permalink
feat(icon): uses new icon
Browse files Browse the repository at this point in the history
use new icons on Sound component
  • Loading branch information
mateusfg7 committed Aug 31, 2020
1 parent 74f864f commit 7ccb029
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
20 changes: 19 additions & 1 deletion src/components/Sound/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ export default function Sound({
VolumeController,
env,
}: ISound): JSX.Element {
const icons: { [index: string]: string } = {
rain: 'icofont-rainy',
storm: 'icofont-rainy-thunder',
wind: 'icofont-wind',
water: 'icofont-water-drop',
'ocean-waves': 'icofont-wind-waves',
'small-waves': 'icofont-wave',
'forest-ambience': 'icofont-tree-alt',
leafs: 'icofont-leaf',
fire: 'icofont-fire-burn',
night: 'icofont-night',
coffee: 'icofont-coffee-mug',
fan: 'icofont-headphone',
train: 'icofont-train-line',
'air-plane': 'icofont-airplane',
underwater: 'icofont-swimmer',
};

const [state, setState] = useState(false);

return (
Expand All @@ -28,7 +46,7 @@ export default function Sound({
changeStateOfAudio(audio, state, setState, button, audioController);
}}
>
<img src={`/Noisekun/icons/${name}.svg`} alt={name} />
<i className={`${icons[name]} icons`} />
</SoundButton>

<VolumeController
Expand Down
10 changes: 7 additions & 3 deletions src/components/Sound/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ export const SoundButton = styled.div`
width: 100px;
height: 100px;
opacity: 0.5;
color: rgba(255, 255, 255, 0.5);
transition: 0.1s;
&:hover {
cursor: pointer;
opacity: 0.8;
color: rgba(255, 255, 255, 0.8);
}
&.selected {
opacity: 1;
color: rgba(255, 255, 255, 1);
}
.icons {
font-size: 80px;
}
`;

0 comments on commit 7ccb029

Please sign in to comment.