mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-01-19 03:56:05 +01:00
hide upload image button when user can not edit pack
This commit is contained in:
parent
f4bf351743
commit
4618ab5cdc
1 changed files with 52 additions and 48 deletions
|
@ -330,54 +330,58 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
</Box>
|
</Box>
|
||||||
<Box direction="Column" gap="100">
|
{images.length === 0 && !canEdit ? null : (
|
||||||
<Text size="L400">Images</Text>
|
<Box direction="Column" gap="100">
|
||||||
<SequenceCard
|
<Text size="L400">Images</Text>
|
||||||
style={{ padding: config.space.S300 }}
|
{canEdit && (
|
||||||
variant="SurfaceVariant"
|
<SequenceCard
|
||||||
direction="Column"
|
style={{ padding: config.space.S300 }}
|
||||||
gap="400"
|
variant="SurfaceVariant"
|
||||||
>
|
direction="Column"
|
||||||
<SettingTile
|
gap="400"
|
||||||
title="Upload Images"
|
>
|
||||||
description="Select images from your storage to upload them in pack."
|
<SettingTile
|
||||||
after={
|
title="Upload Images"
|
||||||
<Button
|
description="Select images from your storage to upload them in pack."
|
||||||
variant="Secondary"
|
after={
|
||||||
fill="Soft"
|
<Button
|
||||||
size="300"
|
variant="Secondary"
|
||||||
radii="300"
|
fill="Soft"
|
||||||
type="button"
|
size="300"
|
||||||
outlined
|
radii="300"
|
||||||
onClick={() => pickFiles('image/*')}
|
type="button"
|
||||||
>
|
outlined
|
||||||
<Text size="B300">Select</Text>
|
onClick={() => pickFiles('image/*')}
|
||||||
</Button>
|
>
|
||||||
}
|
<Text size="B300">Select</Text>
|
||||||
/>
|
</Button>
|
||||||
</SequenceCard>
|
}
|
||||||
{files.map((file) => (
|
/>
|
||||||
<SequenceCard
|
</SequenceCard>
|
||||||
key={file.name}
|
)}
|
||||||
style={{ padding: config.space.S300 }}
|
{files.map((file) => (
|
||||||
variant="SurfaceVariant"
|
<SequenceCard
|
||||||
direction="Column"
|
key={file.name}
|
||||||
gap="400"
|
style={{ padding: config.space.S300 }}
|
||||||
>
|
variant="SurfaceVariant"
|
||||||
<ImageTileUpload file={file}>
|
direction="Column"
|
||||||
{(uploadAtom) => (
|
gap="400"
|
||||||
<CompactUploadCardRenderer
|
>
|
||||||
uploadAtom={uploadAtom}
|
<ImageTileUpload file={file}>
|
||||||
onRemove={handleUploadRemove}
|
{(uploadAtom) => (
|
||||||
onComplete={handleUploadComplete}
|
<CompactUploadCardRenderer
|
||||||
/>
|
uploadAtom={uploadAtom}
|
||||||
)}
|
onRemove={handleUploadRemove}
|
||||||
</ImageTileUpload>
|
onComplete={handleUploadComplete}
|
||||||
</SequenceCard>
|
/>
|
||||||
))}
|
)}
|
||||||
{uploadedImages.map(renderImage)}
|
</ImageTileUpload>
|
||||||
{images.map(renderImage)}
|
</SequenceCard>
|
||||||
</Box>
|
))}
|
||||||
|
{uploadedImages.map(renderImage)}
|
||||||
|
{images.map(renderImage)}
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue