procyon/stories/components/Display/Toasters.mdx
romanjaros 9e0aec7186
Some checks failed
forgejo/Procyon/procyon/pipeline/head There was a failure building this commit
Remove unused code and refactor components for React Native
This commit removes unused placeholder files and updates several components to be compatible with React Native. These updates include changes in styles, properties, and components like Modals, Toaster, Navigator, and others. The affected files were also appropriately reorganized. Additionally, a new .storybook manager file was introduced.
2024-02-20 15:22:13 +00:00

44 lines
936 B
Text

import { Canvas, Meta } from '@storybook/blocks';
import * as ToastersStories from './Toasters.stories';
<Meta of={ToastersStories} />
# Toasters
## Before start
### In root application use
```tsx
import { Toasters } from '@procyon/components/Toaster';
import { ToasterWrapper } from '@procyon/components/Toaster/context';
return (
<ToasterWrapper>
...
<Toasters />
</ToasterWrapper>
);
```
## Use hook `useToaster()`
```tsx
import { useToaster } from '@procyon/components/Toaster/hooks';
const { showToaster } = useToaster();
showToaster({ id: 'id', status: STATUS.none, message: 'message', title: 'title' });
```
<Canvas of={ToastersStories.Hook} withToolbar />
## Use function `showToaster()`
```tsx
import { showToaster } from '@procyon/components/Toaster/context';
showToaster({ id: 'id', status: STATUS.none, message: 'message', title: 'title' });
```
<Canvas of={ToastersStories.OutsideReact} withToolbar />