fix(Modal invite / image fix ): fix display : scrollable horizontaly

This commit is contained in:
Laurian-Dufrechou
2023-05-20 20:13:09 +02:00
parent f8308254ae
commit 6cb47c25e9
2 changed files with 13 additions and 8 deletions
@@ -120,9 +120,6 @@ export default function ModalInviteBar({
<Grid <Grid
{...getRootProps()} {...getRootProps()}
templateColumns={`repeat(${notificationMatch?.length}, 50%)`} templateColumns={`repeat(${notificationMatch?.length}, 50%)`}
// templateColumns={`repeat(auto-fill, ${notificationMatch?.length})`}
// make all items be in the same line and make it scrollable horizontally
gap={6} gap={6}
> >
{!isError && !error {!isError && !error
@@ -131,13 +131,20 @@ export default function ModalModifyImages(props) {
<ModalCloseButton /> <ModalCloseButton />
<ModalBody> <ModalBody>
<Grid <Grid
templateColumns={`repeat(${listImage.length + 1}, 1fr)`} templateColumns={`repeat(${listImage.length + 1}, 50%)`}
gap={5} gap={5}
> >
{listImage.map((image, index) => ( {listImage.map((image, index) => (
<GridItem key={index}> <GridItem key={index}>
<Flex direction={"column"} gap={"1rem"}> <Flex
<Image src={image} /> bg={"purple.100"}
height={"100%"}
direction={"column"}
gap={"1rem"}
justifyContent={"space-between"}
borderRadius={"0.5rem"}
>
<Image src={image} borderRadius={"0.5rem"} />
<Button <Button
id={index.toString()} id={index.toString()}
colorScheme={"red"} colorScheme={"red"}
@@ -151,11 +158,12 @@ export default function ModalModifyImages(props) {
{listImage.length < 5 && ( {listImage.length < 5 && (
<GridItem width={"100%"}> <GridItem width={"100%"}>
<Input <Input
bg={"purple.100"}
type={"file"} type={"file"}
height={"100%"}
accept={"image/png, image/jpeg, image/webp"} accept={"image/png, image/jpeg, image/webp"}
onInput={({ target }) => { onInput={({ target }) => {
if (target.files[0]) return; if (target.files[0] === undefined) return;
const date = new Date(); const date = new Date();
const time = date.getTime(); const time = date.getTime();