Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a shutdown banner #4473

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading