Skip to content

Commit

Permalink
Add a doc about login page background
Browse files Browse the repository at this point in the history
  • Loading branch information
Kmaschta committed Nov 30, 2018
1 parent 846e86a commit d108e0b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/Admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,9 @@ const App = () => (
);
```

See The [Authentication documentation](./Authentication.md#customizing-the-login-and-logout-components) for more details.
Before considering to write your own login page component, please take a look at how to change the default [background image](./Theming.md#using-a-custom-login-page) or the [Material UI theme](#theme).

See the [Authentication documentation](./Authentication.md#customizing-the-login-and-logout-components) for more details.

## `logoutButton`

Expand Down
18 changes: 18 additions & 0 deletions docs/Theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,24 @@ const mapStateToProps = state => ({
export default withRouter(connect(mapStateToProps)(withStyles(styles)(Menu)));
```

## Using a Custom Login Page

### Changing the Background Image

By default, the login page displays a random background image changing every day. If you want to change that background image, you can use the default Login page component and pass an image URL as the `backgroundImage` prop.

```jsx
import { Admin, Login } from 'react-admin';

const MyLoginPage = () => <Login backgroundImage="/background.jpg" />;

const App = () => (
<Admin loginPage={MyLoginPage}>
// ...
</Admin>
);
```

## Notifications

You can override the notification component, for instance to change the notification duration. It defaults to 4000, i.e. 4 seconds, and you can override it using the `autoHideDuration` prop. For instance, to create a custom Notification component with a 5 seconds default:
Expand Down

0 comments on commit d108e0b

Please sign in to comment.