Skip to content

Commit

Permalink
maintenance UI for finalized alert (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
yatharth-b authored Feb 26, 2024
1 parent dbaa5aa commit a9de232
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 35 deletions.
83 changes: 50 additions & 33 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ import useThemeFromStorage from '../../data/hooks/useThemeFromStorage';
import { DESKTOP_BREAKPOINT } from '../../constants';
import useScreenWidth from '../../hooks/useScreenWidth';
import InformationModal from '../InformationModal';
import Maintenance from './maintenance';

import 'react-virtualized/styles.css';
import './stylesheet.scss';

const date = new Date(
new Date().toLocaleString('en-US', { timeZone: 'America/New_York' })
);

const websiteDown =
date.getFullYear() === 2024 &&
date.getMonth() + 1 === 2 &&
date.getDate() === 26;

export default function App(): React.ReactElement {
// Grab the current theme (light/dark) from local storage.
// This hook returns the memoized context value.
Expand All @@ -35,45 +45,52 @@ export default function App(): React.ReactElement {
{/* To bring the website down for maintenance purposes,
insert <Maintenance /> here and disable everything below.
See https://github.com/gt-scheduler/website/pull/194 for reference. */}
<ErrorBoundary
fallback={(error, errorInfo): React.ReactElement => (
<AppSkeleton>
<SkeletonContent>
<ErrorHeader />
<ErrorDisplay
errorDetails={
<ReactErrorDetails error={error} errorInfo={errorInfo} />
}
>
<div>
There was en error somewhere in the core application logic
and it can&apos;t continue.
</div>
<div>
Try refreshing the page to see if it fixes the issue.
</div>
</ErrorDisplay>
</SkeletonContent>
</AppSkeleton>
)}
>
<AppNavigation>
{/* AppDataLoader is in charge of ensuring that there are valid values
{websiteDown ? (
<Maintenance />
) : (
<ErrorBoundary
fallback={(error, errorInfo): React.ReactElement => (
<AppSkeleton>
<SkeletonContent>
<ErrorHeader />
<ErrorDisplay
errorDetails={
<ReactErrorDetails
error={error}
errorInfo={errorInfo}
/>
}
>
<div>
There was en error somewhere in the core application
logic and it can&apos;t continue.
</div>
<div>
Try refreshing the page to see if it fixes the issue.
</div>
</ErrorDisplay>
</SkeletonContent>
</AppSkeleton>
)}
>
<AppNavigation>
{/* AppDataLoader is in charge of ensuring that there are valid values
for the Terms and Term contexts before rendering its children.
If any data is still loading,
then it displays an "app skeleton" with a spinner.
If there was an error while loading
then it displays an error screen. */}
<AppDataLoader>
<AppContent />
</AppDataLoader>
</AppNavigation>
<Feedback />
<AppDataLoader>
<AppContent />
</AppDataLoader>
</AppNavigation>
<Feedback />

{/* Display a popup when first visiting the site */}
{/* Include <InformationModal /> or <MaintenanceModal /> here */}
<InformationModal />
</ErrorBoundary>
{/* Display a popup when first visiting the site */}
{/* Include <InformationModal /> or <MaintenanceModal /> here */}
<InformationModal />
</ErrorBoundary>
)}
</TooltipProvider>
</AppCSSRoot>
</ThemeContext.Provider>
Expand Down
3 changes: 1 addition & 2 deletions src/components/App/maintenance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export default function Maintenance(): React.ReactElement {
</h1>
<p>
GT Scheduler is currently undergoing maintenance. <br />
We’ll resume service to assist 2023 Summer and Fall registration
starting <span>Friday, March 17, 2023</span>.
We’ll resume service to assist registration and scheduling soon.
</p>
<p>
We appreciate your continued support and patience. For any
Expand Down

0 comments on commit a9de232

Please sign in to comment.