Browse Source
Merge pull request #48 from rjwats/notistack
Merge pull request #48 from rjwats/notistack
Notistack - Replace custom notification componentmaster
rjwats
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 877 additions and 1095 deletions
-
1.gitignore
-
BINdata/www/app/icon.png
-
12data/www/app/manifest.json
-
22data/www/css/roboto.css
-
BINdata/www/favicon.ico
-
BINdata/www/fonts/ro-li.w2
-
BINdata/www/fonts/ro-me.w2
-
BINdata/www/fonts/ro-re.w2
-
1data/www/index.html
-
BINdata/www/js/0.9b2e.js.gz
-
BINdata/www/js/1.b351.js.gz
-
BINdata/www/js/2.182e.js.gz
-
1684interface/package-lock.json
-
9interface/package.json
-
8interface/src/App.js
-
10interface/src/authentication/AuthenticatedRoute.js
-
18interface/src/authentication/AuthenticationWrapper.js
-
16interface/src/components/RestComponent.js
-
93interface/src/components/SnackbarNotification.js
-
8interface/src/containers/SignInPage.js
-
84interface/src/containers/WiFiNetworkScanner.js
Before Width: 256 | Height: 256 | Size: 8.7 KiB |
@ -1,12 +0,0 @@ |
|||
{ |
|||
"name":"ESP8266 React", |
|||
"icons":[ |
|||
{ |
|||
"src":"/app/icon.png", |
|||
"sizes":"48x48 72x72 96x96 128x128 256x256" |
|||
} |
|||
], |
|||
"start_url":"/", |
|||
"display":"fullscreen", |
|||
"orientation":"any" |
|||
} |
@ -1,22 +0,0 @@ |
|||
/* Just supporting latin due to size constrains on the esp chip */ |
|||
@font-face { |
|||
font-family: 'Roboto'; |
|||
font-style: normal; |
|||
font-weight: 300; |
|||
src: local('Roboto Light'), local('Roboto-Light'), url(../fonts/ro-li.w2) format('woff2'); |
|||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; |
|||
} |
|||
@font-face { |
|||
font-family: 'Roboto'; |
|||
font-style: normal; |
|||
font-weight: 400; |
|||
src: local('Roboto'), local('Roboto-Regular'), url(../fonts/ro-re.w2) format('woff2'); |
|||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; |
|||
} |
|||
@font-face { |
|||
font-family: 'Roboto'; |
|||
font-style: normal; |
|||
font-weight: 500; |
|||
src: local('Roboto Medium'), local('Roboto-Medium'), url(../fonts/ro-me.w2) format('woff2'); |
|||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; |
|||
} |
@ -1 +0,0 @@ |
|||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link rel="stylesheet" href="/css/roboto.css"><link rel="manifest" href="/app/manifest.json"><title>ESP8266 React</title></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="/js/1.b351.js"></script><script src="/js/2.182e.js"></script><script src="/js/0.9b2e.js"></script></body></html> |
1684
interface/package-lock.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,93 +0,0 @@ |
|||
import React, {Fragment} from 'react'; |
|||
import PropTypes from 'prop-types'; |
|||
import { withStyles } from '@material-ui/core/styles'; |
|||
import Snackbar from '@material-ui/core/Snackbar'; |
|||
import IconButton from '@material-ui/core/IconButton'; |
|||
import CloseIcon from '@material-ui/icons/Close'; |
|||
|
|||
const styles = theme => ({ |
|||
close: { |
|||
padding: theme.spacing(0.5), |
|||
}, |
|||
}); |
|||
|
|||
class SnackbarNotification extends React.Component { |
|||
|
|||
constructor(props) { |
|||
super(props); |
|||
this.raiseNotification=this.raiseNotification.bind(this); |
|||
} |
|||
|
|||
static childContextTypes = { |
|||
raiseNotification: PropTypes.func.isRequired |
|||
} |
|||
|
|||
getChildContext = () => { |
|||
return {raiseNotification : this.raiseNotification}; |
|||
}; |
|||
|
|||
state = { |
|||
open: false, |
|||
message: null |
|||
}; |
|||
|
|||
raiseNotification = (message) => { |
|||
this.setState({ open: true, message:message }); |
|||
}; |
|||
|
|||
handleClose = (event, reason) => { |
|||
if (reason === 'clickaway') { |
|||
return; |
|||
} |
|||
this.setState({ open: false }); |
|||
}; |
|||
|
|||
render() { |
|||
const { classes } = this.props; |
|||
return ( |
|||
<Fragment> |
|||
<Snackbar |
|||
anchorOrigin={{ |
|||
vertical: 'bottom', |
|||
horizontal: 'left', |
|||
}} |
|||
open={this.state.open} |
|||
autoHideDuration={6000} |
|||
onClose={this.handleClose} |
|||
ContentProps={{ |
|||
'aria-describedby': 'message-id', |
|||
}} |
|||
message={<span id="message-id">{this.state.message}</span>} |
|||
action={ |
|||
<IconButton |
|||
aria-label="Close" |
|||
color="inherit" |
|||
className={classes.close} |
|||
onClick={this.handleClose} |
|||
> |
|||
<CloseIcon /> |
|||
</IconButton> |
|||
} |
|||
/> |
|||
{this.props.children} |
|||
</Fragment> |
|||
); |
|||
} |
|||
} |
|||
|
|||
SnackbarNotification.propTypes = { |
|||
classes: PropTypes.object.isRequired |
|||
}; |
|||
|
|||
export default withStyles(styles)(SnackbarNotification); |
|||
|
|||
export function withNotifier(WrappedComponent) { |
|||
return class extends React.Component { |
|||
static contextTypes = { |
|||
raiseNotification: PropTypes.func.isRequired |
|||
}; |
|||
render() { |
|||
return <WrappedComponent raiseNotification={this.context.raiseNotification} {...this.props} />; |
|||
} |
|||
}; |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue