insipx / material-bliss-jekyll-theme

A Material Theme for Jekyll created with React, Redux, and React-Router transpiled with Webpack
GNU General Public License v3.0
77 stars 46 forks source link

Using cookies for theme button #3

Open psprint opened 7 years ago

psprint commented 7 years ago

Hello Could it be possible to save theme in cookies? I've checked that this bool is enough to be changed to make the page start in light theme:

diff --git a/react-dev/components/app.js b/react-dev/components/app.js
index ad93844..e2bb1da 100644
--- a/react-dev/components/app.js
+++ b/react-dev/components/app.js
@@ -85,7 +85,7 @@ const lightMuiTheme = getMuiTheme(null, {
 export default class App extends Component {
   constructor(props) {
     super(props);
-    this.state = { dark: true };
+    this.state = { dark: false };
   }

Maybe it isn't hard to attach a cookie to it?

insipx commented 7 years ago

yes! This is a great idea. Consequently, this theme is my first foray into a real Javascript/React theme, so I didn't worry about cookies yet.

I will definitely implement this. Great idea @psprint

I'm currently busy with my job since deadlines are approaching, but I will get to it, no worries.