-
Notifications
You must be signed in to change notification settings - Fork 19
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(frontend): Add warning to MessageBox component #3254
feat(frontend): Add warning to MessageBox component #3254
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx
Two naming feedbacks if interesting (😅).
One as comment and the other: personally I would maybe not name I think the component Alert
because to me, an "alert" is a dialog, toast or snackbar.
<script lang="ts"> | ||
import IconInfo from '$lib/components/icons/lucide/IconInfo.svelte'; | ||
|
||
export let alertType: 'info' | 'light-warning' = 'info'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
light-warning? not just warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
light-warning
, because we have a warning
level according to design, that is different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but alertType
is not about the style but about the intent no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe I shall rename the prop with componentStyle
, where component
is what better name we can find instead of Alert
eheh
Any suggestion?
RE Naming: indeed, I could not find a good name... Any suggestion? Theoretically, it should have the following levels: plain, info, light-warning, warning, success, error |
I've got message or notification but that's meh. No better idea right now. |
|
And rename |
@peterpeterparker have a look at last commit: is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coolio for me, cool for you?
yes yes! better! |
Motivation
According to the new components library, we are going to use a single
MessageBox
component with a few levels of content (for exampleinfo
,warning
,success
).Specifically, we will use
light-warning
for the progress modal.So, we first re-model the
Info
component to be inclusive of the other levels, and then use it.Changes
Info
component toMessageBox
.info
andlight-warning
(more will come according to usage). Defaults toinfo
.MessageBox
component inProgressWizard
and inAddTokensWarning
.Tests
Before
After