Guest User

Untitled

a guest
Jun 21st, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. // LoginPage.js
  2. import React from 'react';
  3. import { Login, LoginForm } from 'react-admin';
  4. import { withStyles } from 'material-ui';
  5.  
  6. const styles = ({
  7. main: { background: '#333' },
  8. avatar: {
  9. background: 'url(//cdn.example.com/background.jpg)',
  10. backgroundRepeat: 'no-repeat',
  11. backgroundSize: 'contain',
  12. height: 80,
  13. },
  14. icon: { display: 'none' },
  15. });
  16.  
  17. const CustomLoginForm = withStyles({
  18. button: { background: '#F15922' },
  19. })(LoginForm);
  20.  
  21. const CustomLoginPage = props => (
  22. <Login
  23. loginForm={<CustomLoginForm />}
  24. {...props}
  25. />
  26. );
  27.  
  28. export default withStyles(styles)(CustomLoginPage);
  29.  
  30. // App.js
  31. import { Admin } from 'react-admin';
  32. import LoginPage from './LoginPage';
  33.  
  34. export default const App = () => (
  35. <Admin
  36. loginPage={LoginPage}
  37. {...props}
  38. >
  39. {resources}
  40. </Admin>
  41. );
Add Comment
Please, Sign In to add comment