From 70f6bb3d609bd974cf7d18148975c88cb48e56a7 Mon Sep 17 00:00:00 2001 From: pratikAgspert Date: Thu, 26 Sep 2024 16:31:16 +0530 Subject: [PATCH] update: ui --- src/components/CarouselComponent.jsx | 4 +- src/components/generic/DraggableDrawer.jsx | 2 +- src/components/top-level/AddContentButton.jsx | 22 ++--- src/components/top-level/ContentBuilder.jsx | 17 +++- src/components/top-level/ContentCard.jsx | 93 +++++++++++++------ src/components/top-level/content-builder.jsx | 2 +- 6 files changed, 93 insertions(+), 47 deletions(-) diff --git a/src/components/CarouselComponent.jsx b/src/components/CarouselComponent.jsx index 9c79dda..1c41b94 100644 --- a/src/components/CarouselComponent.jsx +++ b/src/components/CarouselComponent.jsx @@ -51,10 +51,10 @@ const CarouselComponent = ({ productData, defaultSheetData }) => { sliderRef.current.slickPrev(); } }; - console.log("state carousel", productData) + console.log("state carousel", productData); return ( - + {productData?.map((dataset) => { return ( diff --git a/src/components/generic/DraggableDrawer.jsx b/src/components/generic/DraggableDrawer.jsx index 1355e86..89f806f 100644 --- a/src/components/generic/DraggableDrawer.jsx +++ b/src/components/generic/DraggableDrawer.jsx @@ -28,7 +28,7 @@ export default function DraggableDrawer({ }) { const { height } = useWindowSize(); const level = React.useMemo( - () => [0, -(height - 80), -(height - 80)], + () => [0, -(height - 160), -(height - 160)], [height] ); diff --git a/src/components/top-level/AddContentButton.jsx b/src/components/top-level/AddContentButton.jsx index 5c975ec..30c6413 100644 --- a/src/components/top-level/AddContentButton.jsx +++ b/src/components/top-level/AddContentButton.jsx @@ -1,17 +1,15 @@ /* eslint-disable react/prop-types */ -import React, { useState } from 'react'; +import React, { useState } from "react"; import { IconButton, Menu, MenuButton, MenuList, MenuItem, -} from '@chakra-ui/react'; -import { AddIcon } from '@chakra-ui/icons'; +} from "@chakra-ui/react"; +import { AddIcon } from "@chakra-ui/icons"; - - -const AddContentButton= ({ onAdd }) => { +const AddContentButton = ({ onAdd }) => { return ( { isRound /> - onAdd('360_image')}>360° Image - onAdd('360_video')}>360° Video - onAdd('Header')}>Header - onAdd('Media Content')}>Media Content + onAdd("360_image")}>360° Image + onAdd("360_video")}>360° Video + onAdd("header")}>Header + onAdd("media_content")}> + Media Content + ); }; -export default AddContentButton; \ No newline at end of file +export default AddContentButton; diff --git a/src/components/top-level/ContentBuilder.jsx b/src/components/top-level/ContentBuilder.jsx index 5b0dfb3..ffcec7a 100644 --- a/src/components/top-level/ContentBuilder.jsx +++ b/src/components/top-level/ContentBuilder.jsx @@ -251,10 +251,17 @@ const ContentBuilder = () => { return ( - - + + + {contents.map((content) => ( { - + { const handleMediaChange = (newMedia) => { onUpdate({ - data: [{ - ...data[0], - image_url: newMedia[0] - }] + data: [ + { + ...data[0], + image_url: newMedia[0], + }, + ], }); }; @@ -24,33 +33,63 @@ const ContentCard = ({ id, type, header, data, onUpdate, onDelete }) => { {type} - } size="sm" /> - onUpdate({ isActive: !data[0]?.isActive })} /> + } + size="sm" + /> + onUpdate({ isActive: !data[0]?.isActive })} + /> - - + + } + size="sm" + ml={2} + onClick={() => inputRef.current.focus()} + /> + + )} + + {type === "360_image" && ( + - } - size="sm" - ml={2} - onClick={() => inputRef.current.focus()} + )} + + {type === "360_video" && ( + + )} + + {type === "media_content" && ( + - - + )} ); }; -export default ContentCard; \ No newline at end of file +export default ContentCard; diff --git a/src/components/top-level/content-builder.jsx b/src/components/top-level/content-builder.jsx index 64e1273..5a5e54d 100644 --- a/src/components/top-level/content-builder.jsx +++ b/src/components/top-level/content-builder.jsx @@ -4,7 +4,7 @@ import ContentBuilder from "./ContentBuilder"; const ContentBuilderPage = () => { return ( - + );