Skip to content

Commit

Permalink
Add stories for login.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjarosch committed Jul 4, 2024
1 parent 6f10f1c commit f115de9
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/ra-ui-materialui/src/auth/Login.stories.tsx
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>;
};

0 comments on commit f115de9

Please sign in to comment.