-
-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add close button, fix layout, refactor (#8755)
This PR consists of cleanup for the project status modal as well as adding the missing button. I've added inline comments to explain the different steps. It now looks like this: ![image](https://github.com/user-attachments/assets/29a3c0b7-770c-4019-aaed-b363c5804138)
- Loading branch information
1 parent
395a4b6
commit b4e2d5d
Showing
9 changed files
with
282 additions
and
240 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.
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
7 changes: 7 additions & 0 deletions
7
frontend/src/component/project/Project/ProjectStatus/ProjectHealthGrid.styles.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,7 @@ | ||
import { styled } from '@mui/material'; | ||
|
||
export const HealthGridTile = styled('article')(({ theme }) => ({ | ||
backgroundColor: theme.palette.envAccordion.expanded, | ||
padding: theme.spacing(3), | ||
borderRadius: theme.shape.borderRadiusExtraLarge, | ||
})); |
57 changes: 57 additions & 0 deletions
57
frontend/src/component/project/Project/ProjectStatus/ProjectHealthGrid.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,57 @@ | ||
import { ProjectHealth } from './ProjectHealth'; | ||
import { styled } from '@mui/material'; | ||
import { StaleFlags } from './StaleFlags'; | ||
import { ProjectResources } from './ProjectResources'; | ||
|
||
const onNarrowGrid = (css: object) => ({ | ||
'@container (max-width: 650px)': css, | ||
'@supports not (container-type: inline-size)': { | ||
'@media (max-width: 712px)': css, | ||
}, | ||
}); | ||
|
||
const HealthContainer = styled('div')({ | ||
containerType: 'inline-size', | ||
}); | ||
|
||
const HealthGrid = styled('div')(({ theme }) => ({ | ||
display: 'grid', | ||
gridTemplateAreas: ` | ||
"health resources" | ||
"stale resources" | ||
`, | ||
gridTemplateColumns: 'repeat(2, minmax(300px, 1fr))', | ||
gap: theme.spacing(1, 2), | ||
...onNarrowGrid({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: theme.spacing(1), | ||
}), | ||
})); | ||
|
||
const Tile = styled('div', { | ||
shouldForwardProp: (prop) => prop !== 'gridArea', | ||
})<{ gridArea: string }>(({ theme, gridArea }) => ({ | ||
gridArea, | ||
'&>*': { | ||
height: '100%', | ||
}, | ||
})); | ||
|
||
export const ProjectHealthGrid = () => { | ||
return ( | ||
<HealthContainer> | ||
<HealthGrid> | ||
<Tile gridArea='health'> | ||
<ProjectHealth /> | ||
</Tile> | ||
<Tile gridArea='stale'> | ||
<StaleFlags /> | ||
</Tile> | ||
<Tile gridArea='resources'> | ||
<ProjectResources /> | ||
</Tile> | ||
</HealthGrid> | ||
</HealthContainer> | ||
); | ||
}; |
Oops, something went wrong.