Skip to content

Commit

Permalink
Fix: rebase errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderleegs committed Oct 3, 2022
1 parent 7fc749c commit 9753295
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/layouts/SiteDashboard/SiteDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const SiteDashboard = (): JSX.Element => {
} = useGetCollaboratorsStatistics(siteName)

return (
<SiteViewLayout overflow="hidden">
<SiteViewLayout siteName={siteName} overflow="hidden">
<Container maxW="container.xl" minH="100vh">
{/* Heading section */}
<Flex px="4rem">
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/layouts/SiteEditLayout/SiteEditHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { useStagingUrl } from "hooks/settingsHooks"

import { NavImage } from "assets"

export const SiteViewHeader = (): JSX.Element => {
export const SiteEditHeader = (): JSX.Element => {
const { isOpen, onOpen, onClose } = useDisclosure()
const { siteName } = useParams<{ siteName: string }>()
const { data: stagingUrl, isLoading } = useStagingUrl({ siteName })
Expand Down
16 changes: 9 additions & 7 deletions src/layouts/layouts/SiteViewLayout/SiteViewHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { Flex, Icon, Spacer, Text, HStack } from "@chakra-ui/react"
import { IconButton } from "@opengovsg/design-system-react"
import { BiArrowBack, BiBell } from "react-icons/bi"
import { AvatarMenu } from "components/Header/AvatarMenu"
import { NotificationMenu } from "components/Header/NotificationMenu"
import { BiArrowBack } from "react-icons/bi"
import { Link as RouterLink } from "react-router-dom"

import { useLoginContext } from "contexts/LoginContext"

// TODO: This is a temporary header for a site view page
export const SiteViewHeader = (): JSX.Element => {
export const SiteViewHeader = (siteName: string): JSX.Element => {
const { displayedName } = useLoginContext()
return (
<Flex
py="0.625rem"
Expand All @@ -30,11 +35,8 @@ export const SiteViewHeader = (): JSX.Element => {
</HStack>
<Spacer />
<HStack>
<IconButton
aria-label="Notifications"
variant="clear"
icon={<Icon as={BiBell} fontSize="1.25rem" fill="icon.secondary" />}
/>
<NotificationMenu siteName={siteName} />
<AvatarMenu name={displayedName} />
</HStack>
</Flex>
)
Expand Down
7 changes: 5 additions & 2 deletions src/layouts/layouts/SiteViewLayout/SiteViewLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const GRID_LAYOUT: Pick<
gridTemplateRows: "4rem 1fr",
}

export const SiteViewLayout = ({ children }: StackProps): JSX.Element => {
export const SiteViewLayout = ({
siteName,
children,
}: StackProps & { siteName: string }): JSX.Element => {
return (
<>
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
Expand All @@ -31,7 +34,7 @@ export const SiteViewLayout = ({ children }: StackProps): JSX.Element => {
top={0}
zIndex="sticky"
>
<SiteViewHeader />
<SiteViewHeader siteName={siteName} />
</GridItem>
{/* main bottom section */}
<SiteViewContent p="2rem">{children}</SiteViewContent>
Expand Down

0 comments on commit 9753295

Please sign in to comment.