-
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.
Merge pull request #525 from IntersectMBO/gov-actions-new
New Gov Actions
- Loading branch information
Showing
59 changed files
with
2,590 additions
and
1,615 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 was deleted.
Oops, something went wrong.
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
49 changes: 49 additions & 0 deletions
49
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,49 @@ | ||
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" | ||
data-testid="external-modal-button" | ||
> | ||
<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
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,62 @@ | ||
import { NavLink, To } from "react-router-dom"; | ||
import { Box } from "@mui/material"; | ||
import Divider from "@mui/material/Divider"; | ||
|
||
import { useScreenDimension, useTranslation } from "@hooks"; | ||
import { Typography } from "@atoms"; | ||
|
||
type BreadcrumbsProps = { | ||
elementOne: string; | ||
elementOnePath: To; | ||
elementTwo: string; | ||
isDataMissing: boolean; | ||
}; | ||
|
||
export const Breadcrumbs = ({ | ||
elementOne, | ||
elementOnePath, | ||
elementTwo, | ||
isDataMissing, | ||
}: BreadcrumbsProps) => { | ||
const { t } = useTranslation(); | ||
const { isMobile } = useScreenDimension(); | ||
|
||
return ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
alignItems: "center", | ||
margin: `2px 0 ${isMobile ? "44px" : "24px"}`, | ||
}} | ||
> | ||
<NavLink to={elementOnePath} style={{ textDecorationColor: "#0033AD" }}> | ||
<Typography | ||
color="primary" | ||
variant="caption" | ||
sx={{ | ||
whiteSpace: "nowrap", | ||
}} | ||
> | ||
{elementOne} | ||
</Typography> | ||
</NavLink> | ||
<Divider | ||
orientation="vertical" | ||
flexItem | ||
color="textBlack" | ||
sx={{ margin: "0 6px" }} | ||
/> | ||
<Typography | ||
variant="caption" | ||
sx={{ | ||
fontWeight: 500, | ||
whiteSpace: "nowrap", | ||
overflow: "hidden", | ||
textOverflow: "ellipsis", | ||
}} | ||
> | ||
{isDataMissing ? t("govActions.dataMissing") : elementTwo} | ||
</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
Oops, something went wrong.