diff --git a/src/assets/icons/image-icon.svg b/src/assets/icons/image-icon.svg new file mode 100644 index 000000000..4968120d8 --- /dev/null +++ b/src/assets/icons/image-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/elements/Button/Button.tsx b/src/components/elements/Button/Button.tsx index 996841b70..bea3f069d 100644 --- a/src/components/elements/Button/Button.tsx +++ b/src/components/elements/Button/Button.tsx @@ -28,7 +28,8 @@ export interface IButtonProps extends Omit, "as"> { | "white-toggle" | "white-border" | "orange" - | "transparent-toggle"; + | "transparent-toggle" + | "white-button-map"; fullWidth?: boolean; shallow?: boolean; } @@ -151,6 +152,11 @@ const Button: FC = props => { container: "group bg-transparent px-3 py-1 rounded", span: "text-14-light text-darkCustom-100" }; + case "white-button-map": + return { + container: "h-fit rounded-lg bg-white px-4 py-2 shadow hover:bg-neutral-200", + span: "flex items-center gap-2" + }; default: return { container: "", span: "" }; } diff --git a/src/components/elements/Map-mapbox/Map.tsx b/src/components/elements/Map-mapbox/Map.tsx index cb7c8049c..1b5b9bcc9 100644 --- a/src/components/elements/Map-mapbox/Map.tsx +++ b/src/components/elements/Map-mapbox/Map.tsx @@ -22,6 +22,7 @@ import type { TooltipType } from "./Map.d"; import CheckPolygonControl from "./MapControls/CheckPolygonControl"; import EditControl from "./MapControls/EditControl"; import { FilterControl } from "./MapControls/FilterControl"; +import ImageCheck from "./MapControls/ImageCheck"; import ImageControl from "./MapControls/ImageControl"; import PolygonCheck from "./MapControls/PolygonCheck"; import { StyleControl } from "./MapControls/StyleControl"; @@ -274,8 +275,9 @@ export const MapContainer = ({ - - + + + diff --git a/src/components/elements/Map-mapbox/MapControls/ImageCheck.tsx b/src/components/elements/Map-mapbox/MapControls/ImageCheck.tsx new file mode 100644 index 000000000..98e6fc1ad --- /dev/null +++ b/src/components/elements/Map-mapbox/MapControls/ImageCheck.tsx @@ -0,0 +1,23 @@ +import { useT } from "@transifex/react"; +import { useState } from "react"; + +import Button from "../../Button/Button"; +import Checkbox from "../../Inputs/Checkbox/Checkbox"; +import Text from "../../Text/Text"; +import { MiniGallery } from "./MiniGallery"; + +const ImageCheck = () => { + const t = useT(); + const [viewImages, setViewImages] = useState(false); + return ( +
+ + +
+ ); +}; + +export default ImageCheck; diff --git a/src/components/elements/Map-mapbox/MapControls/MiniGallery.tsx b/src/components/elements/Map-mapbox/MapControls/MiniGallery.tsx new file mode 100644 index 000000000..c14aa84de --- /dev/null +++ b/src/components/elements/Map-mapbox/MapControls/MiniGallery.tsx @@ -0,0 +1,63 @@ +import { useT } from "@transifex/react"; +import classNames from "classnames"; +import React, { Dispatch, SetStateAction } from "react"; +import { Navigation } from "swiper"; + +import Carousel from "@/components/extensive/Carousel/Carousel"; +import Icon from "@/components/extensive/Icon/Icon"; +import { IconNames } from "@/components/extensive/Icon/Icon"; +import { dataImageGallery } from "@/components/extensive/Modal/ModalContent/MockedData"; +import ModalImageGallery from "@/components/extensive/Modal/ModalImageGallery"; +import { useModalContext } from "@/context/modal.provider"; + +import ImageWithPlaceholder from "../../ImageWithPlaceholder/ImageWithPlaceholder"; +import Text from "../../Text/Text"; + +export const MiniGallery = ({ + viewImages, + setViewImages +}: { + viewImages: boolean; + setViewImages: Dispatch>; +}) => { + const { openModal, closeModal } = useModalContext(); + + const openFormModalHandlerImageGallery = () => { + openModal(); + }; + const t = useT(); + return ( +
+
+ ( + + )} + modules={[Navigation]} + slidesPerView={1} + spaceBetween={10} + hidePaginationBullet + smallSwiperButtons + /> + +
+ +
+ ); +}; diff --git a/src/components/elements/Map-mapbox/MapControls/ViewImageCarousel.tsx b/src/components/elements/Map-mapbox/MapControls/ViewImageCarousel.tsx index 8196394b4..6337c97ab 100644 --- a/src/components/elements/Map-mapbox/MapControls/ViewImageCarousel.tsx +++ b/src/components/elements/Map-mapbox/MapControls/ViewImageCarousel.tsx @@ -1,23 +1,14 @@ import { t } from "@transifex/native"; -import classNames from "classnames"; -import { Dispatch, SetStateAction } from "react"; -import { Navigation } from "swiper"; -import Carousel from "@/components/extensive/Carousel/Carousel"; import Icon, { IconNames } from "@/components/extensive/Icon/Icon"; import { dataImageGallery } from "@/components/extensive/Modal/ModalContent/MockedData"; import ModalImageGallery from "@/components/extensive/Modal/ModalImageGallery"; import { useModalContext } from "@/context/modal.provider"; +import Button from "../../Button/Button"; import Text from "../../Text/Text"; -const ViewImageCarousel = ({ - viewImages, - setViewImages -}: { - viewImages: boolean; - setViewImages: Dispatch>; -}) => { +const ViewImageCarousel = () => { const { openModal, closeModal } = useModalContext(); const openFormModalHandlerImageGallery = () => { @@ -26,42 +17,10 @@ const ViewImageCarousel = ({ return (
-
-
- } - modules={[Navigation]} - slidesPerView={1} - spaceBetween={10} - hidePaginationBullet - smallSwiperButtons - /> - -
- -
- +
); }; diff --git a/src/components/extensive/Icon/Icon.tsx b/src/components/extensive/Icon/Icon.tsx index 84043b6e1..8f838b48a 100644 --- a/src/components/extensive/Icon/Icon.tsx +++ b/src/components/extensive/Icon/Icon.tsx @@ -154,7 +154,8 @@ export enum IconNames { IC_DRAFT = "ic_draft", IC_NEEDS_MORE_INFORMATION = "ic_needs-more-information", IC_SUBMITTED = "ic_submitted", - IC_ARROW_COLLAPSE = "ic-arrow-collapse" + IC_ARROW_COLLAPSE = "ic-arrow-collapse", + IMAGE_ICON = "image-icon" } export interface IconProps { diff --git a/src/components/extensive/Modal/ModalContent/MockedData.ts b/src/components/extensive/Modal/ModalContent/MockedData.ts index ebc75687b..f9a29cfe3 100644 --- a/src/components/extensive/Modal/ModalContent/MockedData.ts +++ b/src/components/extensive/Modal/ModalContent/MockedData.ts @@ -23,27 +23,45 @@ export const dataImageGallery = [ images: [ { id: "1", - src: "/Images/image-modal-main.png" + src: "/Images/image-modal-main.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" }, { id: "2", - src: "/Images/image-modal-1.png" + src: "/Images/image-modal-1.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" }, { id: "3", - src: "/Images/image-modal-2.png" + src: "/Images/image-modal-2.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" }, { id: "4", - src: "/Images/image-modal-3.png" + src: "/Images/image-modal-3.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" }, { id: "5", - src: "/Images/image-modal-4.png" + src: "/Images/image-modal-4.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" }, { id: "6", - src: "/Images/image-modal-5.png" + src: "/Images/image-modal-5.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" } ] }, @@ -53,27 +71,45 @@ export const dataImageGallery = [ images: [ { id: "1", - src: "/Images/image-modal-main.png" + src: "/Images/image-modal-main.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" }, { id: "2", - src: "/Images/image-modal-1.png" + src: "/Images/image-modal-1.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" }, { id: "3", - src: "/Images/image-modal-2.png" + src: "/Images/image-modal-2.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" }, { id: "4", - src: "/Images/image-modal-3.png" + src: "/Images/image-modal-3.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" }, { id: "5", - src: "/Images/image-modal-4.png" + src: "/Images/image-modal-4.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" }, { id: "6", - src: "/Images/image-modal-5.png" + src: "/Images/image-modal-5.png", + title: "TerraMatch Sample", + dateCreated: "December 29, 2024", + geoTag: "Not Geo-Referenced" } ] } diff --git a/src/components/extensive/Modal/ModalImageGallery.tsx b/src/components/extensive/Modal/ModalImageGallery.tsx index 4ee677a99..c5cd25754 100644 --- a/src/components/extensive/Modal/ModalImageGallery.tsx +++ b/src/components/extensive/Modal/ModalImageGallery.tsx @@ -14,6 +14,9 @@ import { ModalBaseImageGallery } from "./ModalsBases"; export interface ImageItem { id: string; src: string; + title: string; + dateCreated: string; + geoTag: string; } export interface TabImagesItem { @@ -87,16 +90,41 @@ const ModalImageGallery: FC = ({ setSelectedImage={setSelectedImage} carouselItem={item => (
-
- - {selectedImage + 1} {t("of")} {tabItems.find(tab => tab.id === selectedTab)?.images.length} +
+ + { + tabItems + .find(tab => tab.id === selectedTab) + ?.images.find((_, index: number) => index === selectedImage)?.title + } + + + { + tabItems + .find(tab => tab.id === selectedTab) + ?.images.find((_, index: number) => index === selectedImage)?.dateCreated + } + +
+
+ + { + tabItems + .find(tab => tab.id === selectedTab) + ?.images.find((_, index: number) => index === selectedImage)?.geoTag + }
+ /> +
+ + {selectedImage + 1} of {tabItems.find(tab => tab.id === selectedTab)?.images.length} + +
)} items={tabItems.find(tab => tab.id === selectedTab)?.images ?? []} diff --git a/tailwind.config.js b/tailwind.config.js index f56091ccd..98ae2d35a 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -131,6 +131,7 @@ module.exports = { 700: "#092C3C", 600: "#33525c", 250: "#11093C", + 200: "#E6E9EC", 100: "#cfe6f4", 50: "#f1fafd", 10: "#eaf7fc" @@ -172,7 +173,11 @@ module.exports = { DEFAULT: "#FCFBE8", 500: "#F3EFB0" }, - red: "#FF6464" + red: { + DEFAULT: "#FF6464", + 100: "#CBC8D2", + 200: "#E42222" + } }, boxShadow: { DEFAULT: "0px 4px 16px rgba(0, 0, 0, 0.12)",