Advertisement
doxuanthang

Grecaptcha-2

Sep 5th, 2017
1,053
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, {Component} from 'react';
  2. import './App.css';
  3. import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
  4. import AppBar from 'material-ui/AppBar';
  5. import RaisedButton from 'material-ui/RaisedButton';
  6. import TextField from 'material-ui/TextField';
  7. import ReCAPTCHA from 'react-grecaptcha'
  8.  
  9. const callback = function () {};
  10. const expiredCallback = function () {};
  11.  
  12. class App extends Component {
  13.   render() {
  14.     return (
  15.         <div className="App">
  16.           <center>
  17.             <MuiThemeProvider>
  18.               <div>
  19.                 <AppBar
  20.                     title="Login"
  21.                 />
  22.                 <TextField
  23.                     hintText="Enter your Username"
  24.                     floatingLabelText="Username"
  25.                     onChange={(event, newValue) => this.setState({username: newValue})}
  26.                 />
  27.                 <br/>
  28.                 <TextField
  29.                     type="password"
  30.                     hintText="Enter your Password"
  31.                     floatingLabelText="Password"
  32.                     onChange={(event, newValue) => this.setState({password: newValue})}
  33.                 />
  34.                 <br/>
  35.                 <br/>
  36.                 <ReCAPTCHA
  37.                     sitekey="6LeTci8UAAAAAAZV-D4OGD9x7VJvBUQ8QJDT9N4X"
  38.                     callback={callback}
  39.                     expiredCallback={expiredCallback}
  40.                     locale="en"
  41.                 />
  42.                 <br/>
  43.                 <br/>
  44.                 <RaisedButton label="Submit" primary={true} />
  45.               </div>
  46.             </MuiThemeProvider>
  47.           </center>
  48.         </div>
  49.     );
  50.   }
  51. }
  52.  
  53. export default App;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement