Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Do not close the notification
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypalacios committed Nov 1, 2021
1 parent e88cf57 commit bf517c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/custom/components/NotificationBanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface BannerProps {
children: React.ReactNode
level: Level
isVisible: boolean
canClose?: boolean
}

const Banner = styled.div<Pick<BannerProps, 'isVisible' | 'level'>>`
Expand Down Expand Up @@ -44,7 +45,7 @@ export default function NotificationBanner(props: BannerProps) {
return (
<Banner {...props} isVisible={isActive}>
<BannerContainer>{props.children}</BannerContainer>
<StyledClose size={16} onClick={() => setIsActive(false)} />
{props.canClose && <StyledClose size={16} onClick={() => setIsActive(false)} />}
</Banner>
)
}
4 changes: 2 additions & 2 deletions src/custom/pages/Profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export default function Profile() {
return (
<>
{error && (
<NotificationBanner isVisible level="error">
There was an error loading your profile data. Please try again.
<NotificationBanner isVisible level="error" canClose={false}>
There was an error loading your profile data. Please try again later.
</NotificationBanner>
)}
</>
Expand Down

0 comments on commit bf517c4

Please sign in to comment.