Skip to content

Commit

Permalink
feat(theme): toogle theme function
Browse files Browse the repository at this point in the history
Update toogle theme function
  • Loading branch information
mateusfg7 committed Sep 1, 2020
1 parent 200cc71 commit 32457c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { ThemeProvider } from 'styled-components';
import { ThemeProvider, DefaultTheme } from 'styled-components';
import usePersistedState from './utils/usePersistedState';

import environment from './services/defaultVariables';
Expand All @@ -21,12 +21,12 @@ import changeStateOfAudio from './functions/changeStateOfAudio';
function App(): JSX.Element {
const [theme, setTheme] = usePersistedState('theme', default_theme);

const toggleTheme = () => {
setTheme(theme.title === 'defaut' ? dark_theme : default_theme);
const toggleTheme = (newTheme: DefaultTheme) => {
setTheme(newTheme);
};

return (
<ThemeProvider theme={default_theme}>
<ThemeProvider theme={theme}>
<div className="App">
<GlobalStyle />

Expand Down

0 comments on commit 32457c1

Please sign in to comment.