-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
574918f
commit 6b56c6d
Showing
43 changed files
with
1,825 additions
and
943 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
48 changes: 48 additions & 0 deletions
48
govtool/frontend/src/components/atoms/ExternalModalButton.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,48 @@ | ||
import { Typography } from "@mui/material"; | ||
|
||
import { Button } from "@atoms"; | ||
import { ICONS } from "@consts"; | ||
import { useModal } from "@context"; | ||
|
||
export const ExternalModalButton = ({ | ||
label, | ||
url, | ||
}: { | ||
label: string; | ||
url: string; | ||
}) => { | ||
const { openModal } = useModal(); | ||
|
||
return ( | ||
<Button | ||
onClick={() => { | ||
openModal({ | ||
type: "externalLink", | ||
state: { | ||
externalLink: url, | ||
}, | ||
}); | ||
}} | ||
sx={{ | ||
p: 0, | ||
mb: 4, | ||
":hover": { | ||
backgroundColor: "transparent", | ||
}, | ||
}} | ||
disableRipple | ||
variant="text" | ||
> | ||
<Typography variant="body1" fontWeight={500} color="primary"> | ||
{label} | ||
</Typography> | ||
<img | ||
alt="external link" | ||
src={ICONS.externalLinkIcon} | ||
height="20" | ||
width="20" | ||
style={{ marginLeft: "8px" }} | ||
/> | ||
</Button> | ||
); | ||
}; |
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,45 @@ | ||
import { Box } from "@mui/material"; | ||
|
||
import { Typography } from "@atoms"; | ||
import { openInNewTab } from "@utils"; | ||
import { ICONS } from "@consts"; | ||
|
||
type IconLinkProps = { | ||
label: string; | ||
navTo: string; | ||
isSmall?: boolean; | ||
}; | ||
|
||
export const IconLink = ({ label, navTo, isSmall }: IconLinkProps) => { | ||
const openLink = () => openInNewTab(navTo); | ||
|
||
return ( | ||
<Box | ||
onClick={openLink} | ||
sx={{ | ||
alignItems: "center", | ||
cursor: "pointer", | ||
display: "flex", | ||
flexDirection: "row", | ||
overflow: "hidden", | ||
}} | ||
> | ||
<img alt="link" height={16} src={ICONS.link} width={16} /> | ||
<Typography | ||
color="primary" | ||
fontWeight={400} | ||
sx={{ | ||
ml: 0.5, | ||
overflow: "hidden", | ||
textOverflow: "ellipsis", | ||
...(isSmall && { | ||
fontSize: 14, | ||
lineHeight: "20px", | ||
}), | ||
}} | ||
> | ||
{label} | ||
</Typography> | ||
</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
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,40 @@ | ||
import { Box } from "@mui/material"; | ||
import ChevronRightIcon from "@mui/icons-material/ChevronRight"; | ||
|
||
import { theme } from "@/theme"; | ||
|
||
interface Props { | ||
disabled: boolean; | ||
onClick: (e: any) => void; | ||
left?: boolean; | ||
} | ||
|
||
export const SliderArrow = ({ disabled, onClick, left }: Props) => { | ||
const { | ||
palette: { primaryBlue, arcticWhite, lightBlue }, | ||
} = theme; | ||
|
||
return ( | ||
<Box | ||
onClick={onClick} | ||
sx={{ | ||
width: "44px", | ||
height: "44px", | ||
borderRadius: "50%", | ||
border: `1px solid ${lightBlue}`, | ||
backgroundColor: arcticWhite, | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
cursor: "pointer", | ||
}} | ||
> | ||
<ChevronRightIcon | ||
sx={{ | ||
transform: `rotate(${left ? 180 : 0}deg)`, | ||
color: disabled ? "#C1BED3" : primaryBlue, | ||
}} | ||
/> | ||
</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
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
60 changes: 60 additions & 0 deletions
60
govtool/frontend/src/components/molecules/DataMissingInfoBox.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,60 @@ | ||
import { Box, Link } from "@mui/material"; | ||
|
||
import { Typography } from "@atoms"; | ||
import { useTranslation } from "@hooks"; | ||
import { openInNewTab } from "@utils"; | ||
|
||
export const DataMissingInfoBox = () => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Box | ||
sx={{ | ||
mb: 4, | ||
pr: 6, | ||
}} | ||
> | ||
<Typography | ||
sx={{ | ||
fontSize: "18px", | ||
fontWeight: 500, | ||
color: "errorRed", | ||
mb: 0.5, | ||
}} | ||
> | ||
{/* TODO: Text to confirm/change */} | ||
The data that was originally used when this Governance Action was | ||
created has been formatted incorrectly. | ||
</Typography> | ||
<Typography | ||
sx={{ | ||
fontWeight: 400, | ||
color: "errorRed", | ||
mb: 0.5, | ||
}} | ||
> | ||
{/* TODO: Text to confirm/change */} | ||
GovTool uses external sources for Governance Action data, and these | ||
sources are maintained by the proposers of the Actions. This error means | ||
that GovTool cannot locate the data on the URL specified when the | ||
Governance Action was originally posted. | ||
</Typography> | ||
<Link | ||
onClick={() => | ||
// TODO: Add the correct link | ||
openInNewTab( | ||
"https://docs.sanchogov.tools/how-to-use-the-govtool/getting-started/get-a-compatible-wallet" | ||
) | ||
} | ||
sx={{ | ||
fontFamily: "Poppins", | ||
fontSize: "16px", | ||
lineHeight: "24px", | ||
cursor: "pointer", | ||
}} | ||
> | ||
{t("learnMore")} | ||
</Link> | ||
</Box> | ||
); | ||
}; |
Oops, something went wrong.