-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new design for view gallery and images
- Loading branch information
1 parent
4c69db4
commit 15c0e9f
Showing
10 changed files
with
194 additions
and
68 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/components/elements/Map-mapbox/MapControls/ImageCheck.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<div className="relarive"> | ||
<MiniGallery viewImages={viewImages} setViewImages={setViewImages} /> | ||
<Button variant="white-button-map" className="flex items-center gap-2" onClick={() => setViewImages(!viewImages)}> | ||
<Checkbox name={""} className="leading-3" checked={viewImages} /> | ||
<Text variant="text-12-bold"> {t("Images")}</Text> | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ImageCheck; |
63 changes: 63 additions & 0 deletions
63
src/components/elements/Map-mapbox/MapControls/MiniGallery.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<SetStateAction<boolean>>; | ||
}) => { | ||
const { openModal, closeModal } = useModalContext(); | ||
|
||
const openFormModalHandlerImageGallery = () => { | ||
openModal(<ModalImageGallery onClose={closeModal} tabItems={dataImageGallery} title={""} />); | ||
}; | ||
const t = useT(); | ||
return ( | ||
<div | ||
className={classNames("absolute right-1/2 bottom-full h-[250px] w-[200px] rounded-lg bg-white p-2", { | ||
hidden: !viewImages | ||
})} | ||
> | ||
<div className="relative h-[calc(100%_-_48px)]"> | ||
<Carousel | ||
className="test mb-2 h-full" | ||
swiperClassName="h-full" | ||
swiperSlideClassName="h-full" | ||
items={dataImageGallery[0].images} | ||
carouselItem={item => ( | ||
<ImageWithPlaceholder className="h-full" alt={t("Image not available")} imageUrl={item.src} /> | ||
)} | ||
modules={[Navigation]} | ||
slidesPerView={1} | ||
spaceBetween={10} | ||
hidePaginationBullet | ||
smallSwiperButtons | ||
/> | ||
<button | ||
onClick={() => setViewImages(false)} | ||
className="absolute right-1 top-1 z-10 rounded bg-grey-750 p-1 drop-shadow-md" | ||
> | ||
<Icon name={IconNames.CLEAR} className="h-4 w-4 text-darkCustom-100" /> | ||
</button> | ||
</div> | ||
<button onClick={openFormModalHandlerImageGallery}> | ||
<Text variant="text-12-bold">TerraMatch Sample</Text> | ||
<Text variant="text-12-light"> December 29, 2023</Text> | ||
</button> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters