-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4341 from omnivore-app/feat/web-maintenance-banner
Add a maintenance mode banner
- Loading branch information
Showing
5 changed files
with
53 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { usePersistedState } from '../../lib/hooks/usePersistedState' | ||
import { CloseButton } from './CloseButton' | ||
import { HStack, SpanBox } from './LayoutPrimitives' | ||
|
||
export const MaintenanceBanner = () => { | ||
const [ | ||
showMaintenanceMode, | ||
setShowMaintenanceMode, | ||
isLoadingShowMaintenanceMode, | ||
] = usePersistedState({ | ||
key: 'show-maintenance-mode', | ||
isSessionStorage: false, | ||
initialValue: true, | ||
}) | ||
return ( | ||
<> | ||
{!isLoadingShowMaintenanceMode && showMaintenanceMode && ( | ||
<HStack | ||
css={{ | ||
p: '5px', | ||
width: '100%', | ||
position: 'fixed', | ||
bg: '#FF5733', | ||
color: '#FFFFFF', | ||
zIndex: '100', | ||
}} | ||
alignment="center" | ||
distribution="center" | ||
> | ||
Omnivore will be undergoing maintenance for 30 minutes at 04:00 UTC, | ||
during that time the website and APIs will be unavailable. | ||
<SpanBox css={{ width: '50px' }} /> | ||
<CloseButton | ||
close={() => { | ||
setShowMaintenanceMode(false) | ||
}} | ||
/> | ||
</HStack> | ||
)} | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters