-
Notifications
You must be signed in to change notification settings - Fork 740
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
[#2201] Toast Component added with locales #2210
[#2201] Toast Component added with locales #2210
Conversation
Thank you for opening this pull request with us! Be sure to follow our Pull Request Practices. Let us know if you have any questions on Slack. |
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.
Thanks so much for working on this 🎉 Let me know if you have any questions about the review :)
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.
Thanks, @zeeshansarwar38 for contributing to if-me.
I think you haven't worked on this case when we log out, which means when we log out, this alert is shown there also.
Please made changes according to this too.
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.
@zeeshansarwar38
Please add mentioned changes to PR
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.
https://www.awesomescreenshot.com/image/35214908?key=2f4ad31c0b5c17ed2ce45258526bc1f9
@zeeshansarwar38 screenshot of Log out screen
@MuhammadAakash have you tested these changes by pulling the code from my branch? I checked this on my local environment and it works fine for the logout scenario. |
@zeeshansarwar38, Sure I will check this and let you know. |
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.
Thanks, @zeeshansarwar38.
Everything is working fine.
@julianguyen if there are no other changes required from your side then this branch is ready to merge.
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.
Thanks for all the updates! Let me know if you have any questions :)
|
||
.clr-white { | ||
color: $white; | ||
} |
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.
Can we remove this class? I don't see it being used anywhere.
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.
Acknowledged
}, 7000); | ||
} | ||
return ( | ||
<div> |
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.
We can use a Fragment here i.e. <>
and </>
.
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.
We were using that fragment already but I didn't comprehend your last comment on this change so I converted that to a div, assuming that's what you want :)
} | ||
return ( | ||
<div> | ||
<div id="toast-notice" aria-label={showNotice ? I18n.t('alert_auto_hide') : ''} style={{ visibility: showNotice ? 'visible' : 'hidden' }} role="region" aria-live="polite" aria-atomic="true" className={`${showNotice ? 'notice' : ''} ${css.toast} ${showNotice && (showAlert || appendDashboardClass) ? 'smallMarginBottom' : ''}`}> |
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.
Let's not do inline CSS here and use stylesheets via SCSS.
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.
Acknowledged
} | ||
return ( | ||
<div> | ||
<div id="toast-notice" aria-label={showNotice ? I18n.t('alert_auto_hide') : ''} style={{ visibility: showNotice ? 'visible' : 'hidden' }} role="region" aria-live="polite" aria-atomic="true" className={`${showNotice ? 'notice' : ''} ${css.toast} ${showNotice && (showAlert || appendDashboardClass) ? 'smallMarginBottom' : ''}`}> |
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.
I think you'll want to only render this entire element only if showNotice
exists.
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.
Actually, we need to have these two divs #toast-notice and #toast-alert present in the DOM all the time because we are using aria-live
and role=alert
for screen-reader users. So it is a requirement that the element should be present in the page markup first. Please check these links for reference link link-2.
</> | ||
)} | ||
</div> | ||
<div id="toast-alert" aria-label={showAlert ? I18n.t('alert_auto_hide') : ''} style={{ visibility: showAlert ? 'visible' : 'hidden' }} role="alert" aria-live="assertive" aria-atomic="true" className={`${showAlert ? 'alert' : ''} ${css.toast} ${showAlert && appendDashboardClass ? 'smallMarginBottom' : ''}`}> |
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.
You'll want to only render this entire element only if showAlert
exists.
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.
Actually, we need to have these two divs #toast-notice and #toast-alert present in the DOM all the time because we are using aria-live
and role=alert
for screen-reader users. So it is a requirement that the element should be present in the page markup first. Please check these links for reference link link-2.
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.
Thanks for getting through all these updates!!! I really appreciate it :)
Was finally able to fine more time pull down the changes and look through it more. Have some feedback we should address!
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.
Fantastic work! Thanks for working so diligently through the review process, it's so much appreciated 👏 🎉
Thank you for merging this pull request with us! If you haven't already, in another pull request, please add yourself to our About page. |
Description
Corresponding Issue
(#2201)
Screenshots
Reviewing this pull request? Check out our Code Review Practices guide if you haven't already!