Skip to content

Commit

Permalink
Renaming hidePermanentlyAfterDate => hidePermanentlyOnDate
Browse files Browse the repository at this point in the history
Signed-off-by: isamrish <[email protected]>
  • Loading branch information
isamrish committed Aug 20, 2020
1 parent 2d7d216 commit dea8d7a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function FlexBanner ({
mainStyleTitle,
mainStyleLink,
crossStyle,
hidePermanentlyAfterDate
hidePermanentlyOnDate
}: PropTypes.InferProps<typeof FlexBanner.propTypes>) {
if (title === undefined) {
throw new Error('title is required!!!')
Expand Down Expand Up @@ -48,16 +48,16 @@ export function FlexBanner ({
)
}

if (!daysToLive && hidePermanentlyAfterDate instanceof Date) {
if (!daysToLive && hidePermanentlyOnDate instanceof Date) {
setTimeout(() => {
setVisibility(!isShowingBannerPeriodOver(hidePermanentlyAfterDate))
setVisibility(!isShowingBannerPeriodOver(hidePermanentlyOnDate))
}, delayToShowBanner * 2000)
}

if (
!daysToLive &&
(!(hidePermanentlyAfterDate instanceof Date) ||
hidePermanentlyAfterDate === undefined)
(!(hidePermanentlyOnDate instanceof Date) ||
hidePermanentlyOnDate === undefined)
) {
setTimeout(() => {
setVisibility(true)
Expand All @@ -73,9 +73,9 @@ export function FlexBanner ({
}, delayToShowBanner * 1000)
}

if (hidePermanentlyAfterDate instanceof Date) {
if (hidePermanentlyOnDate instanceof Date) {
setTimeout(() => {
setVisibility(!isShowingBannerPeriodOver(hidePermanentlyAfterDate))
setVisibility(!isShowingBannerPeriodOver(hidePermanentlyOnDate))
}, delayToShowBanner * 2000)
}
}, [
Expand All @@ -86,7 +86,7 @@ export function FlexBanner ({
animationTime,
banner,
delayToShowBanner,
hidePermanentlyAfterDate
hidePermanentlyOnDate
])

if (isVisible) {
Expand Down Expand Up @@ -166,7 +166,7 @@ FlexBanner.propTypes = {
mainStyleTitle: PropTypes.object,
mainStyleLink: PropTypes.object,
crossStyle: PropTypes.object,
hidePermanentlyAfterDate: PropTypes.instanceOf(Date)
hidePermanentlyOnDate: PropTypes.instanceOf(Date)
}

FlexBanner.defaultProps = {
Expand Down

0 comments on commit dea8d7a

Please sign in to comment.