-
Notifications
You must be signed in to change notification settings - Fork 7
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 #1751 from Northeastern-Electric-Racing/feature/Ch…
…ange-Request-Redesign Feature/change request redesign
- Loading branch information
Showing
29 changed files
with
840 additions
and
579 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* This file is part of NER's FinishLine and licensed under GNU AGPLv3. | ||
* See the LICENSE file in the repository root folder for details. | ||
*/ | ||
|
||
import Chip from '@mui/material/Chip'; | ||
import { green, blue, red, grey, purple } from '@mui/material/colors'; | ||
import { ChangeRequestStatus } from 'shared'; | ||
import { ChangeRequestStatusTextPipe } from '../utils/enum-pipes'; | ||
|
||
const determineChangeRequestStatusPillColor = (status: ChangeRequestStatus) => { | ||
switch (status) { | ||
case ChangeRequestStatus.Implemented: | ||
return blue[600]; | ||
case ChangeRequestStatus.Accepted: | ||
return green[600]; | ||
case ChangeRequestStatus.Denied: | ||
return red[400]; | ||
case ChangeRequestStatus.Open: | ||
return purple[400]; | ||
default: | ||
return grey[500]; | ||
} | ||
}; | ||
|
||
const ChangeRequestStatusPill = ({ status }: { status: ChangeRequestStatus }) => { | ||
const statusPillColor = determineChangeRequestStatusPillColor(status); | ||
return ( | ||
<Chip | ||
size="small" | ||
label={ChangeRequestStatusTextPipe(status)} | ||
variant="filled" | ||
sx={{ | ||
fontSize: 12, | ||
color: 'white', | ||
backgroundColor: statusPillColor, | ||
width: 100 | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default ChangeRequestStatusPill; |
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 { Chip } from '@mui/material'; | ||
import { ChangeRequestType } from 'shared'; | ||
import { ChangeRequestTypeTextPipe } from '../utils/enum-pipes'; | ||
import { red } from '@mui/material/colors'; | ||
|
||
const ChangeRequestTypePill = ({ type }: { type: ChangeRequestType }) => { | ||
return ( | ||
<Chip | ||
size="small" | ||
label={ChangeRequestTypeTextPipe(type)} | ||
variant="filled" | ||
sx={{ | ||
fontSize: 12, | ||
color: 'white', | ||
backgroundColor: red[600], | ||
width: 100 | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default ChangeRequestTypePill; |
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,34 @@ | ||
/* | ||
* This file is part of NER's FinishLine and licensed under GNU AGPLv3. | ||
* See the LICENSE file in the repository root folder for details. | ||
*/ | ||
|
||
import Typography from '@mui/material/Typography'; | ||
import { Grid } from '@mui/material'; | ||
import { ReactNode } from 'react'; | ||
|
||
interface InfoBlockProps { | ||
title: string; | ||
icon?: ReactNode; | ||
} | ||
|
||
/** | ||
* Custom component for a consistent page-building block. | ||
* @param title The title of the block on the page | ||
* @param children The children of the block | ||
*/ | ||
const InfoBlock: React.FC<InfoBlockProps> = ({ title, icon, children }) => { | ||
return ( | ||
<Grid container spacing={1}> | ||
<Grid item xs={12} display="flex" gap="5px" alignItems="center"> | ||
<Typography sx={{ fontWeight: 'bold', fontSize: '19px' }}>{title}</Typography> | ||
{icon} | ||
</Grid> | ||
<Grid item xs={12}> | ||
{children} | ||
</Grid> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default InfoBlock; |
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
Oops, something went wrong.