mirror of
https://github.com/naturalcrit/naturalcrit.git
synced 2025-10-27 07:29:54 +00:00
final
This commit is contained in:
parent
0d1e9b3241
commit
361f85b945
@ -22,10 +22,10 @@ const Naturalcrit = React.createClass({
|
||||
},
|
||||
|
||||
getInitialState: function () {
|
||||
const initialTheme = typeof localStorage !== 'undefined' ? localStorage.getItem('theme') || 'light' : 'light';
|
||||
return { theme: initialTheme };
|
||||
return { theme: 'light' };
|
||||
},
|
||||
|
||||
|
||||
|
||||
componentWillMount: function () {
|
||||
global.domain = this.props.domain;
|
||||
|
||||
@ -51,6 +51,15 @@ const Naturalcrit = React.createClass({
|
||||
});
|
||||
},
|
||||
|
||||
componentDidMount: function () {
|
||||
if (typeof localStorage !== 'undefined') {
|
||||
const storedTheme = localStorage.getItem('theme');
|
||||
if (storedTheme) {
|
||||
this.setState({ theme: storedTheme });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
toggleTheme: function () {
|
||||
const newTheme = this.state.theme === 'light' ? 'dark' : 'light';
|
||||
if (typeof localStorage !== 'undefined') {
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "naturalcrit",
|
||||
"version": "2.3.0",
|
||||
"version": "2.4.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "naturalcrit",
|
||||
"version": "2.3.0",
|
||||
"version": "2.4.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "naturalcrit",
|
||||
"description": "Top-tier Tools for the discerning DM",
|
||||
"version": "2.3.0",
|
||||
"version": "2.4.0",
|
||||
"scripts": {
|
||||
"dev": "node scripts/dev.js",
|
||||
"build": "node scripts/build.js",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user