From 20b8743c47772175e9705059a833d83a7b822f66 Mon Sep 17 00:00:00 2001 From: DmitrySychugov Date: Wed, 28 Aug 2024 20:29:46 +0500 Subject: [PATCH] Client: ItemIcon: extended the component for room logo cover --- packages/client/src/components/ItemIcon.js | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/packages/client/src/components/ItemIcon.js b/packages/client/src/components/ItemIcon.js index 40b0bdbd1f..a210483d42 100644 --- a/packages/client/src/components/ItemIcon.js +++ b/packages/client/src/components/ItemIcon.js @@ -24,12 +24,20 @@ // content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode +import React, { useState } from "react"; import SecuritySvgUrl from "PUBLIC_DIR/images/security.svg?url"; import { inject, observer } from "mobx-react"; import styled, { css } from "styled-components"; import { Base } from "@docspace/shared/themes"; import { NoUserSelect } from "@docspace/shared/utils"; import { RoomIcon } from "@docspace/shared/components/room-icon"; +import { IconButton } from "@docspace/shared/components/icon-button"; +import { DropDown } from "@docspace/shared/components/drop-down"; +import { DropDownItem } from "@docspace/shared/components/drop-down-item"; + +import EditPenSvgUrl from "PUBLIC_DIR/images/icons/12/pen-edit.react.svg?url"; +import PenSvgUrl from "PUBLIC_DIR/images/pencil.react.svg?url"; +import UploadPenSvgUrl from "PUBLIC_DIR/images/actions.upload.react.svg?url"; const IconWrapper = styled.div` ${(props) => @@ -60,6 +68,25 @@ const IconWrapper = styled.div` } `; +const EditWrapper = styled.div` + display: flex; + align-items: center; + justify-content: center; + width: 24px; + height: 24px; + background-color: #eceef1; // add global color + border-radius: 50%; + position: absolute; + bottom: -6px; + right: -6px; + + .open-edit-logo-icon { + &:hover { + cursor: pointer; + } + } +`; + IconWrapper.defaultProps = { theme: Base }; const EncryptedFileIcon = styled.div` @@ -81,9 +108,20 @@ const ItemIcon = ({ color, isArchive, badgeUrl, + size, + withEditing, }) => { const isLoadedRoomIcon = !!logo?.medium; const showDefaultRoomIcon = !isLoadedRoomIcon && isRoom; + const [editLogoOpen, setEditLogoOpen] = useState(false); + + const toggleEditLogo = () => { + setEditLogoOpen(!editLogoOpen); + }; + + const closeEditLogo = () => { + setEditLogoOpen(false); + }; return ( <> @@ -91,12 +129,42 @@ const ItemIcon = ({ + {withEditing && ( + + + + shareEmail(activeLink[0])} + /> + shareTwitter(activeLink[0])} + /> + + + )} {isPrivacy && fileExst && }