Skip to content

Commit

Permalink
Merge pull request #474 from wri/feat/TM-1238-new-image-profile
Browse files Browse the repository at this point in the history
[TM-1238] feat: new image profile Design
  • Loading branch information
dottyy authored Aug 30, 2024
2 parents 91daab1 + fcdafba commit c339ccd
Show file tree
Hide file tree
Showing 15 changed files with 329 additions and 66 deletions.
Binary file added public/images/map-img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions src/components/elements/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,26 @@ import LinkWrapper from "@/components/elements/LinkWrapper/LinkWrapper";
import Text from "@/components/elements/Text/Text";
import Icon, { IconNames } from "@/components/extensive/Icon/Icon";
import { History } from "@/context/routeHistory.provider";
import { TextVariants } from "@/types/common";

export interface BreadcrumbsProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
links: (Omit<History, "path"> & { path?: string })[];
clasNameText?: string;
textVariant?: TextVariants;
}

const Breadcrumbs = ({ className, links, ...props }: BreadcrumbsProps) => {
const Breadcrumbs = ({ className, links, clasNameText, textVariant, ...props }: BreadcrumbsProps) => {
return (
<div {...props} className={classNames(className, "flex items-center gap-3")}>
{links.map((item, index) => (
<Fragment key={`${item.path} + ${index}`}>
<LinkWrapper href={item.path}>
<Text
variant="text-14-bold"
variant={textVariant || "text-14-bold"}
className={classNames(
{ "text-darkCustom opacity-60 hover:underline": !!item.path, "text-darkCustom": !item.path },
"line-clamp-1"
"line-clamp-1",
clasNameText
)}
title={item.title}
>
Expand Down
26 changes: 21 additions & 5 deletions src/components/elements/ImageGallery/ImageGalleryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { DetailedHTMLProps, FC, HTMLAttributes } from "react";
import { MenuItemProps } from "@/components/elements/Menu/Menu";
import Text from "@/components/elements/Text/Text";
import Icon, { IconNames } from "@/components/extensive/Icon/Icon";
import { ModalId } from "@/components/extensive/Modal/ModalConst";
import ModalImageDetails from "@/components/extensive/Modal/ModalImageDetails";
import { useModalContext } from "@/context/modal.provider";

import ImageWithChildren from "../ImageWithChildren/ImageWithChildren";
import Menu from "../Menu/Menu";
Expand All @@ -28,20 +31,30 @@ export interface ImageGalleryItemProps extends DetailedHTMLProps<HTMLAttributes<
}

const ImageGalleryItem: FC<ImageGalleryItemProps> = ({ data, onClickGalleryItem, onDelete, className, ...rest }) => {
const { openModal, closeModal } = useModalContext();
const t = useT();

const handleDelete = () => {
onDelete?.(data.uuid);
};

const openMopdalImageDetail = () => {
openModal(
ModalId.MODAL_IMAGE_DETAIL,
<ModalImageDetails title="IMAGE DETAILS" onClose={() => closeModal(ModalId.MODAL_IMAGE_DETAIL)} />,
true
);
};

const galeryMenu: MenuItemProps[] = [
{
id: "1",
render: () => (
<Text variant="text-12-bold" className="pr-3">
{t("Edit Attributes")}
</Text>
)
),
onClick: openMopdalImageDetail
},
{
id: "2",
Expand Down Expand Up @@ -103,12 +116,15 @@ const ImageGalleryItem: FC<ImageGalleryItemProps> = ({ data, onClickGalleryItem,

<div className="p-4">
<div className="flex items-center justify-between gap-1">
<Text variant="text-14-bold" className="flex items-center gap-1 text-darkCustom">
{data.label.split(":")[0]}:<Text variant="text-14-bold">{data.label.split(":")[1]}</Text>
<Text variant="text-16-bold" className="flex items-center gap-1 text-darkCustom">
{data.label.split(":")[0]}:<Text variant="text-16-bold">{data.label.split(":")[1]}</Text>
</Text>
<div className="rounded-lg p-1 text-darkCustom hover:bg-grey-800 hover:text-primary">
<button
className="rounded-lg p-1 text-darkCustom hover:bg-grey-800 hover:text-primary"
onClick={openMopdalImageDetail}
>
<Icon name={IconNames.EDIT} height={24} width={24} className="" />
</div>
</button>
</div>

{data.subtitle && (
Expand Down
Loading

0 comments on commit c339ccd

Please sign in to comment.