-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#217] add dRep directory page and nav items
- Loading branch information
Showing
18 changed files
with
150 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Box, BoxProps } from "@mui/material"; | ||
import { FC } from "react"; | ||
|
||
export const ContentBox: FC<BoxProps> = ({ children, ...props }) => ( | ||
<Box maxWidth={1290} mx="auto" {...props}> | ||
{children} | ||
</Box> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Box, BoxProps } from "@mui/material"; | ||
import { FC } from "react"; | ||
|
||
export const PagePaddingBox: FC<BoxProps> = ({ children, ...props }) => ( | ||
<Box px={{ xxs: 2, md: 5 }} {...props}> | ||
{children} | ||
</Box> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
govtool/frontend/src/components/molecules/AutomatedVotingCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { useScreenDimension } from "@hooks"; | ||
import { FC } from "react"; | ||
import { Typography, PagePaddingBox, ContentBox } from "@/components/atoms"; | ||
|
||
interface PageTitleProps { | ||
title: string; | ||
} | ||
|
||
export const PageTitle: FC<PageTitleProps> = ({ title }) => { | ||
const { isMobile } = useScreenDimension(); | ||
|
||
return ( | ||
<PagePaddingBox | ||
borderBottom={(theme) => `1px solid ${theme.palette.neutralWhite}`} | ||
py={3} | ||
> | ||
<ContentBox> | ||
<Typography variant={isMobile ? "title1" : "headline5"}> | ||
{title} | ||
</Typography> | ||
</ContentBox> | ||
</PagePaddingBox> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
govtool/frontend/src/components/organisms/DRepDirectoryContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { FC } from "react"; | ||
|
||
interface DRepDirectoryContentProps { | ||
isConnected?: boolean; | ||
} | ||
|
||
export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({ | ||
isConnected, | ||
}) => ( | ||
<> | ||
<p>DRepDirectory</p> | ||
<p> | ||
connected: | ||
{String(!!isConnected)} | ||
</p> | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useTranslation } from "@hooks"; | ||
import { checkIsWalletConnected } from "@/utils"; | ||
import { Background, PagePaddingBox, ContentBox } from "@/components/atoms"; | ||
import { DRepDirectoryContent, TopNav } from "@/components/organisms"; | ||
import { PageTitle } from "@/components/molecules"; | ||
|
||
export const DRepDirectory = () => { | ||
const { t } = useTranslation(); | ||
|
||
const isConnected = !checkIsWalletConnected(); | ||
|
||
if (isConnected) { | ||
return ( | ||
<PagePaddingBox py={2}> | ||
<DRepDirectoryContent isConnected /> | ||
</PagePaddingBox> | ||
); | ||
} | ||
|
||
return ( | ||
<Background> | ||
<TopNav /> | ||
|
||
<PageTitle title={t("dRepDirectory.title")} /> | ||
|
||
<PagePaddingBox py={2}> | ||
<ContentBox> | ||
<DRepDirectoryContent /> | ||
</ContentBox> | ||
</PagePaddingBox> | ||
</Background> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters