-
Notifications
You must be signed in to change notification settings - Fork 17
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 #1508 from TomChapmanGov/about_page
about page v1
- Loading branch information
Showing
11 changed files
with
522 additions
and
6 deletions.
There are no files selected for viewing
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
183 changes: 183 additions & 0 deletions
183
epictrack-web/src/components/workPlan/about/AboutContainer.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,183 @@ | ||
import { Box, Grid } from "@mui/material"; | ||
import React, { useContext } from "react"; | ||
import { ETHeading3, ETLink, ETParagraph } from "../../shared"; | ||
import { tabPanelStyle, tabStyle, titleStyle } from "../common/styles"; | ||
import { Palette } from "../../../styles/theme"; | ||
import { ETTabs, ETTab } from "../../shared/tab/Tab"; | ||
import TabPanel from "../../shared/tab/TabPanel"; | ||
import ComingSoon from "../../../routes/ComingSoon"; | ||
import AboutDetails from "./aboutDetails"; | ||
import { ABOUT_RESOURCES } from "../../../constants/application-constant"; | ||
import Icons from "../../icons"; | ||
import { IconProps } from "../../icons/type"; | ||
import { WorkplanContext } from "../WorkPlanContext"; | ||
|
||
const LinkIcon: React.FC<IconProps> = Icons["LinkIcon"]; | ||
|
||
const AboutContainer = () => { | ||
const { work } = useContext(WorkplanContext); | ||
const [selectedTabIndex, setSelectedTabIndex] = React.useState(0); | ||
|
||
const handleTabSelected = (event: React.SyntheticEvent, index: number) => { | ||
setSelectedTabIndex(index); | ||
}; | ||
|
||
return ( | ||
<Grid container columnSpacing={1.5}> | ||
<Grid item xs={8}> | ||
<ETTabs | ||
sx={{ | ||
gap: "2rem", | ||
minHeight: "0px", | ||
height: "100%", | ||
}} | ||
onChange={handleTabSelected} | ||
value={selectedTabIndex} | ||
> | ||
<ETTab | ||
sx={{ | ||
paddingLeft: 0, | ||
...tabStyle, | ||
}} | ||
label="Details" | ||
/> | ||
<ETTab | ||
label="Calender" | ||
sx={{ | ||
...tabStyle, | ||
}} | ||
/> | ||
</ETTabs> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<ETHeading3 | ||
sx={{ | ||
...titleStyle, | ||
}} | ||
color={Palette.primary.main} | ||
> | ||
Resources | ||
</ETHeading3> | ||
</Grid> | ||
<Grid | ||
item | ||
xs={8} | ||
sx={{ | ||
pt: "2rem", | ||
}} | ||
> | ||
<TabPanel | ||
index={0} | ||
value={selectedTabIndex} | ||
sx={{ | ||
...tabPanelStyle, | ||
}} | ||
> | ||
<AboutDetails /> | ||
</TabPanel> | ||
<TabPanel | ||
index={1} | ||
value={selectedTabIndex} | ||
sx={{ | ||
...tabPanelStyle, | ||
}} | ||
> | ||
<ComingSoon /> | ||
</TabPanel> | ||
</Grid> | ||
<Grid | ||
item | ||
xs={4} | ||
sx={{ | ||
pt: "2rem", | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
...tabPanelStyle, | ||
display: "flex", | ||
flexDirection: "column", | ||
gap: "1rem", | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
padding: "1rem 1.5rem", | ||
flexDirection: "column", | ||
alignItems: "flex-start", | ||
gap: ".5rem", | ||
alignSelf: "stretch", | ||
borderRadius: "4px", | ||
backgroundColor: Palette.neutral.bg.light, | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
gap: ".5rem", | ||
alignItems: "center", | ||
}} | ||
> | ||
<LinkIcon fill={`${Palette.primary.accent.main}`} /> | ||
<ETLink | ||
to={`https://projects.eao.gov.bc.ca/projects-list?keywords=${work?.project?.name}`} | ||
target="_blank" | ||
rel="noopener" | ||
style={{ | ||
fontSize: "1rem", | ||
fontWeight: 700, | ||
lineHeight: "1.5rem", | ||
}} | ||
> | ||
Link to EPIC.Public | ||
</ETLink> | ||
</Box> | ||
</Box> | ||
{ABOUT_RESOURCES.map((resource) => { | ||
return ( | ||
<> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
padding: "1rem 1.5rem", | ||
flexDirection: "column", | ||
alignItems: "flex-start", | ||
gap: ".5rem", | ||
alignSelf: "stretch", | ||
borderRadius: "4px", | ||
backgroundColor: Palette.neutral.bg.light, | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
gap: ".5rem", | ||
alignItems: "center", | ||
}} | ||
> | ||
<LinkIcon fill={`${Palette.primary.accent.main}`} /> | ||
<ETLink | ||
to={`${resource.url}`} | ||
target="_blank" | ||
rel="noopener" | ||
style={{ | ||
fontSize: "1rem", | ||
fontWeight: 700, | ||
lineHeight: "1.5rem", | ||
}} | ||
> | ||
{resource.title} | ||
</ETLink> | ||
</Box> | ||
</Box> | ||
</> | ||
); | ||
})} | ||
</Box> | ||
</Grid> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default AboutContainer; |
23 changes: 23 additions & 0 deletions
23
epictrack-web/src/components/workPlan/about/AboutContext.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,23 @@ | ||
import { createContext } from "react"; | ||
import React from "react"; | ||
import { useSearchParams } from "../../../hooks/SearchParams"; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
interface AboutContextProps {} | ||
|
||
interface StatusContainerRouteParams extends URLSearchParams { | ||
work_id: string; | ||
} | ||
|
||
export const AboutContext = createContext<AboutContextProps>({}); | ||
|
||
export const AboutProvider = ({ | ||
children, | ||
}: { | ||
children: JSX.Element | JSX.Element[]; | ||
}) => { | ||
const query = useSearchParams<StatusContainerRouteParams>(); | ||
const workId = React.useMemo(() => query.get("work_id"), [query]); | ||
|
||
return <AboutContext.Provider value={{}}>{children}</AboutContext.Provider>; | ||
}; |
123 changes: 123 additions & 0 deletions
123
epictrack-web/src/components/workPlan/about/aboutDetails/ProjectDetails.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,123 @@ | ||
import { Box, Divider, Grid } from "@mui/material"; | ||
import { useContext } from "react"; | ||
import { WorkplanContext } from "../../WorkPlanContext"; | ||
import { ETCaption1, ETCaption2, GrayBox } from "../../../shared"; | ||
import { Palette } from "../../../../styles/theme"; | ||
import { MONTH_DAY_YEAR } from "../../../../constants/application-constant"; | ||
import dayjs from "dayjs"; | ||
|
||
const ProjectDetails = () => { | ||
const { work } = useContext(WorkplanContext); | ||
return ( | ||
<GrayBox> | ||
<Grid | ||
container | ||
sx={{ | ||
padding: "16px 24px", | ||
}} | ||
> | ||
<Grid item xs={12}> | ||
<ETCaption1 color={Palette.neutral.main}> | ||
PROJECT CREATION DATE | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<ETCaption2 color={Palette.neutral.dark}> | ||
{dayjs(work?.project?.created_at).format(MONTH_DAY_YEAR)} | ||
</ETCaption2> | ||
</Grid> | ||
</Grid> | ||
<Divider style={{ width: "100%" }} /> | ||
<Grid | ||
container | ||
spacing={1} | ||
sx={{ | ||
padding: "16px 24px", | ||
}} | ||
> | ||
<Grid item xs={12}> | ||
<ETCaption1 bold color={Palette.primary.main}> | ||
PROPONENT | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<ETCaption2 color={Palette.neutral.dark}> | ||
{work?.project?.proponent?.name} | ||
</ETCaption2> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<ETCaption1 bold color={Palette.primary.main}> | ||
PROJECT DESCRIPTION | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<ETCaption2 color={Palette.neutral.dark}> | ||
{work?.project?.description} | ||
</ETCaption2> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<ETCaption1 bold color={Palette.primary.main}> | ||
TYPE | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<ETCaption1 bold color={Palette.primary.main}> | ||
SUBTYPE | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<ETCaption1 color={Palette.neutral.dark}> | ||
{work?.project?.type?.name} | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<ETCaption1 color={Palette.neutral.dark}> | ||
{work?.project?.sub_type?.name} | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<ETCaption1 bold color={Palette.primary.main}> | ||
LOCATION DESCRIPTION | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<ETCaption2 color={Palette.neutral.dark}> | ||
{work?.project?.address} | ||
</ETCaption2> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<ETCaption1 bold color={Palette.primary.main}> | ||
ENV REGION | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<ETCaption1 bold color={Palette.primary.main}> | ||
NRS REGION | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<ETCaption1 color={Palette.neutral.dark}> | ||
{work?.project?.region_env?.name} | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<ETCaption1 color={Palette.neutral.dark}> | ||
{work?.project?.region_flnro?.name} | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<ETCaption1 bold color={Palette.primary.main}> | ||
ABBREVIATION | ||
</ETCaption1> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<ETCaption1 color={Palette.neutral.dark}> | ||
{work?.project?.abbreviation} | ||
</ETCaption1> | ||
</Grid> | ||
</Grid> | ||
</GrayBox> | ||
); | ||
}; | ||
|
||
export default ProjectDetails; |
Oops, something went wrong.