-
Notifications
You must be signed in to change notification settings - Fork 5
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 #29 from jadmsaadaot/SUBMIT-task#236
Add project details page
- Loading branch information
Showing
17 changed files
with
406 additions
and
101 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,7 @@ | ||
import { styled, Typography } from "@mui/material"; | ||
|
||
export const Caption2 = styled(Typography)<{ bold?: boolean }>(({ bold }) => ({ | ||
fontSize: 14, | ||
lineHeight: "16px", | ||
fontWeight: bold ? 700 : 400, | ||
})); |
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 { theme } from "@/styles/theme"; | ||
import { Box, Typography } from "@mui/material"; | ||
import React from "react"; | ||
|
||
type BannerProps = { | ||
children?: React.ReactNode; | ||
}; | ||
export const Banner = ({ children }: BannerProps) => { | ||
return ( | ||
<Box | ||
position="relative" | ||
bgcolor="#F0F8FF" | ||
zIndex={theme.zIndex.appBar - 10} | ||
height={76} | ||
display={"flex"} | ||
alignItems={"center"} | ||
px={9.5} | ||
> | ||
<Typography variant="h3" color="initial" fontWeight={600}> | ||
{children} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Grid, GridProps } from "@mui/material"; | ||
import { YellowBar } from "../Shared/YellowBar"; | ||
|
||
export const GridContainer = ({ children, ...rest }: GridProps) => { | ||
return ( | ||
<Grid | ||
container | ||
direction="row" | ||
justifyContent="flex-start" | ||
alignItems="flex-start" | ||
px={9.5} | ||
py={7} | ||
spacing={0} | ||
{...rest} | ||
> | ||
<Grid item xs={12}> | ||
<YellowBar /> | ||
</Grid> | ||
{children} | ||
</Grid> | ||
); | ||
}; |
88 changes: 88 additions & 0 deletions
88
submit-web/src/components/registration/addProjects/ProjectCard/ManagementPlan.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,88 @@ | ||
import { Box, Paper, Typography } from "@mui/material"; | ||
import { styled } from "@mui/system"; | ||
import { BCDesignTokens } from "epic.theme"; | ||
import { ProjectStatus } from "../ProjectStatus"; | ||
import { PROJECT_STATUS } from "./constants"; | ||
|
||
const CARD_HEIGHT = 301; | ||
const CARD_WIDTH = 380; | ||
const HEADER_HEIGHT = 54; | ||
const BODY_HEIGHT = 247; | ||
|
||
const CardInnerBox = styled(Box)({ | ||
display: "flex", | ||
alignItems: "flex-start", | ||
justifyContent: "center", | ||
flexDirection: "column", | ||
height: "100%", | ||
padding: "0 12px", | ||
}); | ||
|
||
export const ManagementPlan = () => { | ||
return ( | ||
<Paper | ||
sx={{ | ||
width: CARD_WIDTH, | ||
height: CARD_HEIGHT, | ||
border: `4px solid ${BCDesignTokens.themeGold100}`, | ||
borderRadius: "6px", | ||
}} | ||
> | ||
<Box | ||
bgcolor={BCDesignTokens.surfaceColorPrimaryButtonDefault} | ||
sx={{ | ||
display: "flex", | ||
alignItems: "center", | ||
justifyContent: "flex-start", | ||
borderRadius: "3px 3px 0 0", | ||
}} | ||
height={HEADER_HEIGHT} | ||
> | ||
<Typography | ||
variant="h5" | ||
fontWeight={600} | ||
px={2} | ||
color={BCDesignTokens.typographyColorPrimaryInvert} | ||
> | ||
Project Name | ||
</Typography> | ||
</Box> | ||
<Box height={BODY_HEIGHT}> | ||
<Box | ||
sx={{ | ||
padding: "36px 12px 12px 12px", | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
borderRadius: "3px", | ||
border: `1px solid #F2F2F2`, | ||
boxShadow: "0px 1px 2px rgba(0, 0, 0, 0.1)", | ||
}} | ||
height={187} | ||
> | ||
<Box height={"50%"}> | ||
<CardInnerBox> | ||
<Typography variant="h4" fontWeight={400}> | ||
Management Plans | ||
</Typography> | ||
<ProjectStatus status={PROJECT_STATUS.POST_DECISION} /> | ||
</CardInnerBox> | ||
</Box> | ||
<Box height={"50%"}> | ||
<CardInnerBox | ||
sx={{ | ||
borderTop: `1px solid #F2F2F2`, | ||
}} | ||
> | ||
<Typography variant="body1"> | ||
You will be able to submit Managements Plans for this Project. | ||
</Typography> | ||
</CardInnerBox> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Paper> | ||
); | ||
}; |
3 changes: 3 additions & 0 deletions
3
submit-web/src/components/registration/addProjects/ProjectCard/constants.ts
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,3 @@ | ||
export const PROJECT_STATUS = { | ||
POST_DECISION: "Post Decision", | ||
}; |
16 changes: 16 additions & 0 deletions
16
submit-web/src/components/registration/addProjects/ProjectCard/index.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,16 @@ | ||
import { Case, Switch } from "react-if"; | ||
import { ManagementPlan } from "./ManagementPlan"; | ||
import { PROJECT_STATUS } from "./constants"; | ||
|
||
type ProjectCardProps = { | ||
status: string; | ||
}; | ||
export const ProjectCard = ({ status }: ProjectCardProps) => { | ||
return ( | ||
<Switch> | ||
<Case condition={status === PROJECT_STATUS.POST_DECISION}> | ||
<ManagementPlan /> | ||
</Case> | ||
</Switch> | ||
); | ||
}; |
29 changes: 29 additions & 0 deletions
29
submit-web/src/components/registration/addProjects/ProjectStatus.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,29 @@ | ||
import { Caption2 } from "@/components/Shared/Typographies"; | ||
import { Case, Default, Switch } from "react-if"; | ||
import ModeStandbyIcon from "@mui/icons-material/ModeStandby"; | ||
import { Stack } from "@mui/material"; | ||
import { PROJECT_STATUS } from "./ProjectCard/constants"; | ||
|
||
type ProjectStatusProps = { | ||
status: string; | ||
}; | ||
export const ProjectStatus = ({ status }: ProjectStatusProps) => { | ||
return ( | ||
<Switch> | ||
<Case condition={status === PROJECT_STATUS.POST_DECISION}> | ||
<Stack | ||
spacing={1} | ||
direction="row" | ||
alignItems={"center"} | ||
color={"#947BB6"} | ||
> | ||
<ModeStandbyIcon /> | ||
<Caption2 color={"#947BB6"}>Post-Decision</Caption2> | ||
</Stack> | ||
</Case> | ||
<Default> | ||
<Caption2>{status}</Caption2> | ||
</Default> | ||
</Switch> | ||
); | ||
}; |
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.