forked from marmelab/react-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as React from 'react'; | ||
import AccountBoxIcon from '@mui/icons-material/AccountBox'; | ||
import { AdminContext } from '../AdminContext'; | ||
import { Login } from './Login'; | ||
|
||
export default { title: 'ra-ui-materialui/auth/Login' }; | ||
|
||
export const DefaultLogin = () => { | ||
return ( | ||
<Wrapper> | ||
<Login /> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export const CustomIcon = () => { | ||
return ( | ||
<Wrapper> | ||
<Login avatarIcon={<AccountBoxIcon />} /> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
const Wrapper = ({ children }) => { | ||
const authProvider = { | ||
login: () => Promise.resolve(), | ||
logout: () => Promise.resolve(), | ||
checkAuth: () => Promise.reject(), | ||
checkError: () => Promise.resolve(), | ||
getPermissions: () => Promise.resolve(), | ||
}; | ||
return <AdminContext authProvider={authProvider}>{children}</AdminContext>; | ||
}; |