4f078e1ee4
* Migrate web action-buttons directory to CSF3 notation * Migrate web chat directory to CSF3 notation * Migrate web common directory to CSF3 notation * Migrate web layout directory to CSF3 notation * Migrate web modals directory to CSF3 notation * Migrate web ui directory to CSF3 notation * Migrate web video directory to CSF3 notation * Migrate web stories directory to CSF3 notation
46 lines
954 B
TypeScript
46 lines
954 B
TypeScript
import { useEffect } from 'react';
|
|
import { StoryFn, Meta } from '@storybook/react';
|
|
import { RecoilRoot, useSetRecoilState } from 'recoil';
|
|
import { AuthModal } from './AuthModal';
|
|
import { currentUserAtom } from '../../stores/ClientConfigStore';
|
|
import { CurrentUser } from '../../../interfaces/current-user';
|
|
|
|
const Example = () => {
|
|
const setCurrentUser = useSetRecoilState<CurrentUser>(currentUserAtom);
|
|
|
|
useEffect(
|
|
() =>
|
|
setCurrentUser({
|
|
id: '1',
|
|
displayName: 'Test User',
|
|
displayColor: 3,
|
|
isModerator: false,
|
|
}),
|
|
[],
|
|
);
|
|
|
|
return (
|
|
<div>
|
|
<AuthModal forceTabs />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
const meta = {
|
|
title: 'owncast/Modals/Auth',
|
|
component: AuthModal,
|
|
parameters: {},
|
|
} satisfies Meta<typeof AuthModal>;
|
|
|
|
export default meta;
|
|
|
|
const Template: StoryFn<typeof AuthModal> = () => (
|
|
<RecoilRoot>
|
|
<Example />
|
|
</RecoilRoot>
|
|
);
|
|
|
|
export const Basic = {
|
|
render: Template,
|
|
};
|