mirror of
https://github.com/owncast/owncast.git
synced 2024-11-28 19:19:06 +03:00
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
45 lines
1,009 B
TypeScript
45 lines
1,009 B
TypeScript
import { useEffect } from 'react';
|
|
import { StoryFn, Meta } from '@storybook/react';
|
|
import { RecoilRoot, useSetRecoilState } from 'recoil';
|
|
import { NameChangeModal } from './NameChangeModal';
|
|
import { CurrentUser } from '../../../interfaces/current-user';
|
|
import { currentUserAtom } from '../../stores/ClientConfigStore';
|
|
|
|
const meta = {
|
|
title: 'owncast/Modals/Name Change',
|
|
component: NameChangeModal,
|
|
parameters: {},
|
|
} satisfies Meta<typeof NameChangeModal>;
|
|
|
|
export default meta;
|
|
|
|
const Example = () => {
|
|
const setCurrentUser = useSetRecoilState<CurrentUser>(currentUserAtom);
|
|
|
|
useEffect(
|
|
() =>
|
|
setCurrentUser({
|
|
id: '1',
|
|
displayName: 'Test User',
|
|
displayColor: 3,
|
|
isModerator: false,
|
|
}),
|
|
[],
|
|
);
|
|
|
|
return (
|
|
<div>
|
|
<NameChangeModal closeModal={() => {}} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
const Template: StoryFn<typeof NameChangeModal> = () => (
|
|
<RecoilRoot>
|
|
<Example />
|
|
</RecoilRoot>
|
|
);
|
|
|
|
export const Basic = {
|
|
render: Template,
|
|
};
|