Skip to content

Commit

Permalink
Merge pull request #6543 from Mousticke/ts-banner-notification
Browse files Browse the repository at this point in the history
Migrate Banner Notification to Typescript
  • Loading branch information
pettinarip authored Jun 3, 2022
2 parents 35c2625 + 738e8da commit ff38a56
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import React from "react"
import styled from "styled-components"

const Banner = styled.div`
export interface IStyledBanner {
shouldShow: boolean
}

export interface IProps {
shouldShow?: boolean
className?: string
}

const Banner = styled.div<IStyledBanner>`
display: ${(props) => (props.shouldShow ? `flex` : `none`)};
width: 100%;
background-color: ${(props) => props.theme.colors.primary};
Expand All @@ -18,7 +27,11 @@ const Banner = styled.div`
}
`

const BannerNotification = ({ children, className, shouldShow }) => (
const BannerNotification: React.FC<IProps> = ({
children,
className,
shouldShow = false,
}) => (
<Banner shouldShow={shouldShow} className={className}>
{children}
</Banner>
Expand Down

0 comments on commit ff38a56

Please sign in to comment.