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

fix: Alert can't be dismissed #2216

Merged
merged 7 commits into from
Aug 28, 2022

Conversation

flacial
Copy link
Member

@flacial flacial commented Aug 24, 2022

Closes #2215

Problem

The Alert component can't be dismissed through clicking the close button.

Solution

Replace its implementation with react-bootstrap alert component.

Screen Recording

@vercel
Copy link

vercel bot commented Aug 24, 2022

@flacial is attempting to deploy a commit to the c0d3-prod Team on Vercel.

A member of the Team first needs to authorize it.

@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #2216 (5f31a3b) into master (a39a411) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #2216   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          173       173           
  Lines         2948      2951    +3     
  Branches       794       796    +2     
=========================================
+ Hits          2948      2951    +3     
Impacted Files Coverage Δ
components/Alert/Alert.tsx 100.00% <100.00%> (ø)

@vercel
Copy link

vercel bot commented Aug 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
c0d3-app ✅ Ready (Inspect) Visit Preview Aug 28, 2022 at 5:08PM (UTC)

variant={`${type === 'urgent' ? 'danger' : 'primary'}`}
onClose={() => {
setShow(false)
onDismiss && onDismiss(id)
Copy link
Collaborator

@HS-90 HS-90 Aug 28, 2022

Choose a reason for hiding this comment

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

Just out of curiosity and to confirm, does onDismiss handle whether or not the alert will be displayed for particular user in the future(if the user clicks the x button to dismiss)?

It appears the frontend is handled by setShow

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it doesn't handle it. It gets called when the alert is closed. It's useful when we want to perform a certain action when the alert closes.

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

Successfully merging this pull request may close these issues.

fix: Can't dismiss an alert
4 participants