Skip to content

Commit 9de1049

Browse files
committed
#3369 proper merge
1 parent 5e13088 commit 9de1049

3 files changed

Lines changed: 22 additions & 27 deletions

File tree

src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/PartReview/PartReviewComponents/PartPreviewCard.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function PartPreviewCard({ partPreview, projectName, redirectUrl }: PartP
2121
<Link component={RouterLink} to={redirectUrl} sx={{ textDecoration: 'none', color: 'inherit' }}>
2222
<Card
2323
sx={{
24-
maxWidth: 400,
24+
maxWidth: '30vw',
2525
border: '0.5px solid rgb(193, 193, 193)',
2626
borderRadius: '8px',
2727
bgcolor: grey[800],
@@ -40,25 +40,20 @@ export function PartPreviewCard({ partPreview, projectName, redirectUrl }: PartP
4040
{previewImageId && previewUrl ? (
4141
<Box
4242
sx={{
43-
height: 200,
43+
height: '15vw',
4444
display: 'flex',
4545
alignItems: 'center',
4646
justifyContent: 'center',
4747
border: '0.5px solid rgb(193, 193, 193)',
4848
bgcolor: grey[600]
4949
}}
5050
>
51-
<Box
52-
component="img"
53-
sx={{ display: 'block', maxWidth: '200px', mb: 1 }}
54-
alt={`${commonName} Preview`}
55-
src={previewUrl}
56-
/>
51+
<Box component="img" sx={{ display: 'block', mb: 1 }} alt={`${commonName} Preview`} src={previewUrl} />
5752
</Box>
5853
) : (
5954
<Box
6055
sx={{
61-
height: 200,
56+
height: '15vw',
6257
display: 'flex',
6358
alignItems: 'center',
6459
justifyContent: 'center',

src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/PartReview/PartsReviewPage.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -305,23 +305,6 @@ const PartsReviewPage = ({ project }: { project: Project }) => {
305305
<Grid item xs={12}>
306306
{/* The guide should be toggled off by default for admins, heads, and leads and toggled on for all other roles */}
307307
{showSubmissionGuide && <SubmissionGuide />}
308-
<Typography variant="h4" sx={{ mb: 2 }}>
309-
{`${filteredParts?.length === parts.length ? 'All ' : ''} Parts for ${project.name}`}
310-
</Typography>
311-
<Grid item md={4} sm={6} xs={12}>
312-
{/* sort parts by most recently created */}
313-
{filteredParts
314-
?.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime())
315-
.map((part, _index) => (
316-
<PartPreviewCard
317-
partPreview={part}
318-
projectName={project.abbreviation ?? project.name}
319-
redirectUrl={`/projects/${wbsPipe(project.wbsNum)}/part/${part.index}`}
320-
/>
321-
))}
322-
</Grid>
323-
{/* temporary test component to show that parts are being displayed */}
324-
325308
<Grid container spacing={2}>
326309
{(partsForMeToReview ?? []).length > 0 && (
327310
<PartsToReview
@@ -348,6 +331,23 @@ const PartsReviewPage = ({ project }: { project: Project }) => {
348331
/>
349332
)}
350333
</Grid>
334+
<Typography variant="h4" sx={{ mb: 2 }}>
335+
{`${filteredParts?.length === parts.length ? 'All ' : ''} Parts for ${project.name}`}
336+
</Typography>
337+
<Grid container spacing={2}>
338+
{/* sort parts by most recently created */}
339+
{filteredParts
340+
?.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime())
341+
.map((part, _index) => (
342+
<Grid item md={4} sm={6} xs={12}>
343+
<PartPreviewCard
344+
partPreview={part}
345+
projectName={project.abbreviation ?? project.name}
346+
redirectUrl={`/projects/${wbsPipe(project.wbsNum)}/part/${part.index}`}
347+
/>
348+
</Grid>
349+
))}
350+
</Grid>
351351
</Grid>
352352
</Grid>
353353
</Box>

src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/PartReview/PartsToReview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Project, PartPreview } from 'shared';
22
import { Box } from '@mui/system';
33
import { Grid, Typography } from '@mui/material';
44
import { wbsPipe } from 'shared';
5-
import PartDisplay from '../../../PartPage/components/PartDisplay';
5+
import PartDisplay from '../../../PartPage/PartPageComponents/PartDisplay';
66

77
interface PartsToReviewProps {
88
project: Project;

0 commit comments

Comments
 (0)