Skip to content

Commit 342357d

Browse files
authored
Update docs (#273)
1 parent 7a13b78 commit 342357d

File tree

3 files changed

+46
-34
lines changed

3 files changed

+46
-34
lines changed

README.md

+31-25
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/rjwats/esp8266-react.svg?branch=master)](https://travis-ci.org/rjwats/esp8266-react)
44

5-
A simple, secure and extensible framework for IoT projects built on ESP8266/ESP32 platforms with responsive [React](https://reactjs.org/) front-end built with [Material-UI](https://material-ui.com/).
5+
A simple, secure and extensible framework for IoT projects built on ESP8266/ESP32 platforms with responsive [React](https://reactjs.org/) front-end built with [Material-UI](https://mui.com/).
66

77
Designed to work with the PlatformIO IDE with [limited setup](#getting-started). Please read below for setup, build and upload instructions.
88

@@ -269,32 +269,38 @@ The framework, and MaterialUI allows for a reasonable degree of customization wi
269269

270270
### Theming the app
271271

272-
The app can be easily themed by editing the [MaterialUI theme](https://material-ui.com/customization/theming/). Edit the theme in ['interface/src/CustomMuiTheme.tsx'](interface/src/CustomMuiTheme.tsx) as you desire. For example, here is a dark theme:
272+
The app can be easily themed by editing the [MaterialUI theme](https://mui.com/customization/typography/). Edit the theme in ['interface/src/CustomMuiTheme.tsx'](interface/src/CustomTheme.tsx) as you desire. For example, here is a dark theme:
273273

274274
```js
275-
const theme = createMuiTheme({
276-
palette: {
277-
type:"dark",
278-
primary: {
279-
main: '#222',
280-
},
281-
secondary: {
282-
main: '#666',
283-
},
284-
info: {
285-
main: blueGrey[500]
286-
},
287-
warning: {
288-
main: orange[500]
289-
},
290-
error: {
291-
main: red[500]
292-
},
293-
success: {
294-
main: green[500]
275+
const theme = responsiveFontSizes(
276+
createTheme({
277+
palette: {
278+
mode: "dark",
279+
text: {
280+
primary: '#fff',
281+
secondary: grey[500],
282+
},
283+
primary: {
284+
main: indigo[500]
285+
},
286+
secondary: {
287+
main: blueGrey[800]
288+
},
289+
info: {
290+
main: indigo[800]
291+
},
292+
warning: {
293+
main: orange[800]
294+
},
295+
error: {
296+
main: red[800]
297+
},
298+
success: {
299+
main: green[800]
300+
}
295301
}
296-
}
297-
});
302+
})
303+
);
298304
```
299305

300306
![Dark Theme](/media/dark.png?raw=true "Dark Theme")
@@ -655,7 +661,7 @@ esp8266React.getWiFiSettingsService()->addUpdateHandler(
655661
## Libraries Used
656662

657663
* [React](https://reactjs.org/)
658-
* [Material-UI](https://material-ui.com/)
664+
* [Material-UI](https://mui.com/)
659665
* [notistack](https://github.com/iamhosseindhv/notistack)
660666
* [ArduinoJson](https://github.com/bblanchon/ArduinoJson)
661667
* [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer)

interface/src/CustomTheme.tsx

+15-9
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,33 @@ import { FC } from 'react';
22

33
import { CssBaseline } from '@mui/material';
44
import { createTheme, responsiveFontSizes, ThemeProvider } from '@mui/material/styles';
5-
import { indigo, blueGrey, orange, red, green } from '@mui/material/colors';
5+
import { indigo, blueGrey, orange, red, grey, green } from '@mui/material/colors';
66

77
const theme = responsiveFontSizes(
88
createTheme({
99
palette: {
10-
background: {
11-
default: "#fafafa"
10+
mode: "dark",
11+
text: {
12+
primary: '#fff',
13+
secondary: grey[600],
14+
},
15+
primary: {
16+
main: grey[400]
17+
},
18+
secondary: {
19+
main: blueGrey[800]
1220
},
13-
primary: indigo,
14-
secondary: blueGrey,
1521
info: {
16-
main: indigo[500]
22+
main: indigo[900]
1723
},
1824
warning: {
19-
main: orange[500]
25+
main: orange[900]
2026
},
2127
error: {
22-
main: red[500]
28+
main: red[900]
2329
},
2430
success: {
25-
main: green[500]
31+
main: green[900]
2632
}
2733
}
2834
})

media/dark.png

-32.7 KB
Loading

0 commit comments

Comments
 (0)