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

put_flash lack documentation, :warning not supported #3342

Closed
ponychicken opened this issue Jul 12, 2024 · 2 comments
Closed

put_flash lack documentation, :warning not supported #3342

ponychicken opened this issue Jul 12, 2024 · 2 comments

Comments

@ponychicken
Copy link
Contributor

In the put_flash docs, there is no clear mention what types are supported. Seems like :info, :error, but not :warning.

It would be good to state this and maybe also support a ;warning flash

@SteffenDE
Copy link
Collaborator

This is because put_flash does not care about the types at all. The info and error flash come from the generated core components: https://github.com/phoenixframework/phoenix/blob/25e891f172045aa0391d30bfd794111235041159/installer/templates/phx_web/components/core_components.ex#L147-L151

So if you add a warning flash there and also implement the styles in your flash component, it will work just like the others. You could also call it warn, information or whatever key you like :)

A PR to improve the docs is always appreciated though!

@ponychicken
Copy link
Contributor Author

Ok, I will add something along this lines to the docs.

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

No branches or pull requests

2 participants