Skip to content

Commit

Permalink
Merge pull request #2748 from decentdao/remove-banner
Browse files Browse the repository at this point in the history
Remove the "reindexing" banner
  • Loading branch information
johnqh authored Feb 27, 2025
2 parents d5b6372 + 7b3d809 commit 72c0e09
Showing 1 changed file with 6 additions and 39 deletions.
45 changes: 6 additions & 39 deletions src/components/ui/page/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Container, Grid, GridItem, Show, Text } from '@chakra-ui/react';
import { Box, Container, Grid, GridItem, Show } from '@chakra-ui/react';
import { useRef } from 'react';
import { Outlet, useMatches } from 'react-router-dom';
import { Outlet } from 'react-router-dom';
import {
MAX_CONTENT_WIDTH,
SIDEBAR_WIDTH,
Expand All @@ -24,22 +24,12 @@ export function Layout() {

useNavigationScrollReset();

const isReindexing = true;
const matches = useMatches();
const onDao = matches.some(
_match => _match.pathname !== '/' && !_match.pathname.startsWith('/create'),
);

const showReindexingBanner = isReindexing && onDao;

return (
<Grid
templateAreas={{
base: `"banner banner"
"header header"
base: `"header header"
"main main"`,
md: `"banner banner"
"header header"
md: `"header header"
"nav main"
"footer footer"`,
}}
Expand All @@ -50,24 +40,6 @@ export function Layout() {
}}
position="relative"
>
<GridItem area="banner">
{showReindexingBanner ? (
<Box
bg="lilac--2"
textAlign="center"
p={3}
position="fixed"
w="full"
zIndex="2"
fontWeight="bold"
transformOrigin="top"
>
<Text>
Decent&apos;s indexers are rebuilding. We are working to restore services soon.
</Text>
</Box>
) : null}
</GridItem>
<GridItem
area="header"
ref={headerContainerRef}
Expand All @@ -79,7 +51,6 @@ export function Layout() {
w="full"
maxW="100vw"
zIndex="1"
mt={showReindexingBanner ? '48px' : '0px'}
>
<Header headerContainerRef={headerContainerRef} />
</Box>
Expand All @@ -92,19 +63,15 @@ export function Layout() {
flexDirection="column"
position="fixed"
ml={6}
top={showReindexingBanner ? `calc(${HEADER_HEIGHT} + 48px)` : HEADER_HEIGHT}
minHeight={{
base: undefined,
md: `calc(100vh - ${HEADER_HEIGHT} - ${showReindexingBanner ? '48px' : '0px'})`,
}}
top={HEADER_HEIGHT}
minHeight={{ base: undefined, md: `calc(100vh - ${HEADER_HEIGHT})` }}
>
<NavigationLinks />
</GridItem>
</Show>
<GridItem
area="main"
mx={{ base: '0.5rem', md: '1.5rem' }}
mt={showReindexingBanner ? '48px' : '0px'}
>
<Container
maxWidth={MAX_CONTENT_WIDTH}
Expand Down

0 comments on commit 72c0e09

Please sign in to comment.