Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(admin-ui): Toast component #4249

Open
wants to merge 15 commits into
base: feat/new-admin-ui
Choose a base branch
from
Open

Conversation

leopuleo
Copy link
Contributor

@leopuleo leopuleo commented Sep 4, 2024

This PR adds the Toast component to the @webiny/admin-ui package.

We are exporting a props-based flat component based on the following radix component.

The new component is fully compatible with the old Snackbar component, but some refactoring is needed when UI tokens are defined.

The useSnackbar hook is fully compatible with the new Toast component. Refactoring the hook will be necessary; a separate PR will address it.

@leopuleo leopuleo marked this pull request as ready for review September 4, 2024 08:25
Copy link
Member

@adrians5j adrians5j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left two comments. All in all, looks good.

</App>
</WcpProvider>
</UiProviders>
{/*<UiProviders>*/}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to stay commented out?

export const WithDescription: Story = {
args: {
...Default.args,
description: <ToastDescription text={'Entry "Article One" has been successfully created'} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed this here, and thinking we should do the same approach I have here.

So, in this case, we'd end up prolly with Toast.Description. Wdyt?

BTW not sure if applicable here, but I did this withStaticProps helper within the Avatar PR, just to make it a bit more humane when sticking extra components as static properties on an existing React component / class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants