Skip to content

Commit

Permalink
docs: add warn to documentation site
Browse files Browse the repository at this point in the history
  • Loading branch information
Jostein Kringlen committed Jul 17, 2022
1 parent 10da76b commit f9b4896
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
8 changes: 8 additions & 0 deletions site/components/sections/toast-example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ const examples: Array<{
toast.error("This didn't work.");
},
},
{
title: 'Warning',
emoji: '⚠️',
snippet: "toast.warn('Roadblocks ahead')",
action: () => {
toast.warn('Roadblocks ahead');
},
},
{
title: 'Promise',
emoji: '⏳',
Expand Down
5 changes: 5 additions & 0 deletions site/pages/docs/styling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ You can style your notifications globally with the `toastOptions` inside the Toa
background: 'red',
},
},
warn: {
style: {
background: 'yellow',
},
},
}}
/>
```
Expand Down
9 changes: 9 additions & 0 deletions site/pages/docs/toast.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ toast.error('This is an error!');

Creates a notification with an animated error icon. It can be themed with the `iconTheme` option.

### Warning

```js
toast.warn("I'm warning you!");
```

Creates a notification with an animated warning icon. It can be themed with the `iconTheme` option.

### Custom (JSX)

```js
Expand Down Expand Up @@ -132,6 +140,7 @@ Every type has its own duration. You can overwrite them `duration` with the toas
| `blank` | 4000 |
| `error` | 4000 |
| `success` | 2000 |
| `warn` | 3000 |
| `custom` | 4000 |
| `loading` | Infinity |

Expand Down
2 changes: 1 addition & 1 deletion site/pages/docs/toaster.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ These will act as default options for all toasts. See [`toast()`](/docs/toast) f

#### Type specific options

You can change the defaults for a specific type by adding, `success: {}`, `error: {}`, `loading: {}` or `custom: {}`.
You can change the defaults for a specific type by adding, `success: {}`, `error: {}`, `loading: {}`, `warn: {}` or `custom: {}`.

## Using a custom render function

Expand Down

0 comments on commit f9b4896

Please sign in to comment.