From ad9b85d47fcbd6679a7f91233aeaf0806f824537 Mon Sep 17 00:00:00 2001 From: PA4KEV Date: Thu, 10 Aug 2023 20:54:58 +0200 Subject: [PATCH] Update footer to make use of light and dark themes and update links. --- src/UI/Footer.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) 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 ( -