Skip to content

Commit

Permalink
Merge pull request #4473 from omnivore-app/jacksonh/shutdown-banner
Browse files Browse the repository at this point in the history
Add a shutdown banner
  • Loading branch information
jacksonh authored Oct 31, 2024
2 parents ccc013f + 97b392a commit f16444c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,43 @@ import { usePersistedState } from '../../lib/hooks/usePersistedState'
import { CloseButton } from './CloseButton'
import { HStack, SpanBox } from './LayoutPrimitives'

export const MaintenanceBanner = () => {
export const ShutdownBanner = () => {
const [
showMaintenanceMode,
setShowMaintenanceMode,
isLoadingShowMaintenanceMode,
] = usePersistedState({
key: 'show-maintenance-mode',
isSessionStorage: false,
initialValue: false,
key: 'show-shutdown-mode',
isSessionStorage: true,
initialValue: true,
})
return (
<>
{!isLoadingShowMaintenanceMode && showMaintenanceMode && (
<HStack
css={{
p: '5px',
width: '100%',
position: 'fixed',
top: 0,
left: 0,
width: '100vw',
position: 'absolute',
bg: '#FF5733',
color: '#FFFFFF',
zIndex: '100',
font: '$inter',
gap: '10px',
}}
alignment="center"
alignment="start"
distribution="center"
>
Omnivore will be undergoing maintenance for 30 minutes at 05:00 UTC,
during that time the website and APIs will be unavailable.
Omnivore is shutting down on Nov. 30th.
<a
href="https://blog.omnivore.app/p/details-on-omnivore-shutting-down"
target="_blank"
rel="noreferrer"
>
Read More
</a>
<SpanBox css={{ width: '50px' }} />
<CloseButton
close={() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/templates/AuthLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box, VStack, HStack } from '../elements/LayoutPrimitives'
import { MaintenanceBanner } from '../elements/MaintenanceBanner'
import { ShutdownBanner } from '../elements/ShutdownBanner'
import { OmnivoreNameLogo } from '../elements/images/OmnivoreNameLogo'
import { theme } from '../tokens/stitches.config'
import { GoogleReCaptchaProvider } from '@google-recaptcha/react'
Expand Down
3 changes: 2 additions & 1 deletion packages/web/components/templates/LoginLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import type { LoginFormProps } from './LoginForm'
import { OmnivoreNameLogo } from '../elements/images/OmnivoreNameLogo'

import featureFullWidthImage from '../../public/static/images/login/login-feature-image-full.png'
import { MaintenanceBanner } from '../elements/MaintenanceBanner'
import { ShutdownBanner } from '../elements/ShutdownBanner'

export function LoginLayout(props: LoginFormProps): JSX.Element {
return (
<>
<ShutdownBanner />
<MediumBreakpointBox
smallerLayoutNode={<MobileLoginLayout {...props} />}
largerLayoutNode={<MediumLoginLayout {...props} />}
Expand Down
3 changes: 2 additions & 1 deletion packages/web/components/templates/NavigationLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { useGetViewer } from '../../lib/networking/viewer/useGetViewer'
import { useQueryClient } from '@tanstack/react-query'
import { usePersistedState } from '../../lib/hooks/usePersistedState'
import { CloseButton } from '../elements/CloseButton'
import { MaintenanceBanner } from '../elements/MaintenanceBanner'
import { ShutdownBanner } from '../elements/ShutdownBanner'

export type NavigationSection =
| 'home'
Expand Down Expand Up @@ -207,6 +207,7 @@ const Header = (props: HeaderProps): JSX.Element => {
height: '58px',
}}
>
<ShutdownBanner />
<Button
style="plainIcon"
onClick={(event) => {
Expand Down
2 changes: 2 additions & 0 deletions packages/web/components/templates/SettingsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useVerifyAuth } from '../../lib/hooks/useVerifyAuth'
import Link from 'next/link'
import { CaretLeft } from '@phosphor-icons/react'
import { DEFAULT_HOME_PATH } from '../../lib/navigations'
import { ShutdownBanner } from '../elements/ShutdownBanner'

type SettingsLayoutProps = {
title?: string
Expand Down Expand Up @@ -82,6 +83,7 @@ export function SettingsLayout(props: SettingsLayoutProps): JSX.Element {
css={{ width: '100%', height: '100%', minHeight: '100vh' }}
>
<PageMetaData path="settings" title="Settings" />
<ShutdownBanner />
<VStack css={{ width: '100%', height: '100%' }}>
<Box
css={{
Expand Down

0 comments on commit f16444c

Please sign in to comment.