Skip to content

Commit

Permalink
addresses some open items from Carson
Browse files Browse the repository at this point in the history
  • Loading branch information
brentkulwicki committed Sep 26, 2023
1 parent c3dede7 commit 4ed8aac
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ mutation CreateMedia($input: UploadProgressReportMedia!) {
items {
id
variant {
key
label
responsibleRole
...variant
}
category
}
Expand Down
26 changes: 12 additions & 14 deletions src/scenes/ProgressReports/EditForm/Steps/Media/MediaStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,18 @@ export const MediaStep: StepComponent = ({ report }) => {
{...getInputProps()}
name={`upload-media-${variant.key}`}
/>
<Box sx={{ display: 'block' }} key={variant.key}>
<VariantMediaAccordion
deleteMedia={deleteMedia}
openFileBrowser={openFileBrowser}
response={{
item: report.media.items.filter(
(item) => item.variant.key === variant.key
),
uploadVariant: variant,
}}
sensitivity={report.parent.sensitivity}
initiallyOpen={false}
/>
</Box>
<VariantMediaAccordion
deleteMedia={deleteMedia}
openFileBrowser={openFileBrowser}
response={{
item: report.media.items.filter(
(item) => item.variant.key === variant.key
),
uploadVariant: variant,
}}
sensitivity={report.parent.sensitivity}
initiallyOpen={false}
/>
</Fragment>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,23 +265,21 @@ export const VariantMediaAccordion = ({
<RoleIcon variantRole={response.uploadVariant.responsibleRole} />
<span>{response.uploadVariant.label}</span>
</AccordionSummary>
<AccordionDetails>
<Box sx={{ display: 'flex', p: '0px 16px' }}>
<ImageBox
media={response.item}
openFileBrowser={openFileBrowser}
deleteMedia={deleteCurrentMedia}
sensitivity={sensitivity}
/>
<MediaInfoForm
initialValues={{
category: response.item[0]?.category,
caption: response.item[0]?.media?.caption,
id: response.item[0]?.id,
}}
disabled={!response.item}
/>
</Box>
<AccordionDetails sx={{ display: 'flex', p: '0px 16px' }}>
<ImageBox
media={response.item}
openFileBrowser={openFileBrowser}
deleteMedia={deleteCurrentMedia}
sensitivity={sensitivity}
/>
<MediaInfoForm
initialValues={{
category: response.item[0]?.category,
caption: response.item[0]?.media?.caption,
id: response.item[0]?.id,
}}
disabled={!response.item}
/>
</AccordionDetails>
</Accordion>
);
Expand Down

0 comments on commit 4ed8aac

Please sign in to comment.