import React from 'react'; import { BrowserRouter as Router, Route, Link } from 'react-router-dom'; import './Style-light.css'; import './Style-dark.css'; import Feed from './Feed.js'; import Article from './Article.js'; import Comments from './Comments.js'; class App extends React.Component { constructor(props) { super(props); this.state = { theme: localStorage.getItem('theme') || '', }; } light() { this.setState({ theme: '' }); localStorage.setItem('theme', ''); } dark() { this.setState({ theme: 'dark' }); localStorage.setItem('theme', 'dark'); } render() { const theme = this.state.theme; return (
QNN - Home Theme: this.light()}>Light - this.dark()}>Dark