diff --git a/src/UI/Footer.js b/src/UI/Footer.js index 807cae9..fa482f7 100644 --- a/src/UI/Footer.js +++ b/src/UI/Footer.js @@ -1,12 +1,28 @@ -import React from 'react'; +import React, {useEffect, useState} from 'react'; import './Footer.css'; const Footer = (props) => { + const [theme, setTheme] = useState( + localStorage.getItem('theme') || 'light' + ); + + useEffect(() => { + localStorage.setItem('theme', theme); + document.body.className = theme; + }, [theme]); + return ( -