Merge pull request #4473 from omnivore-app/jacksonh/shutdown-banner

Add a shutdown banner
This commit is contained in:
Jackson Harper
2024-11-01 00:52:37 +08:00
committed by GitHub
5 changed files with 26 additions and 12 deletions

View File

@ -2,15 +2,15 @@ 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 (
<>
@ -18,17 +18,27 @@ export const MaintenanceBanner = () => {
<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={() => {

View File

@ -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'

View File

@ -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} />}

View File

@ -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'
@ -207,6 +207,7 @@ const Header = (props: HeaderProps): JSX.Element => {
height: '58px',
}}
>
<ShutdownBanner />
<Button
style="plainIcon"
onClick={(event) => {

View File

@ -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
@ -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={{