From 6a49363fc0be0a7e3df90bea36f4d045db97c34b Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Thu, 9 May 2024 22:55:57 +0200 Subject: [PATCH] style(reply modal): add background color to c/parentCid --- .../reply-modal/reply-modal.module.css | 13 ++++++++++--- src/components/reply-modal/reply-modal.tsx | 16 +++++++++++++++- src/themes.css | 5 ++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/components/reply-modal/reply-modal.module.css b/src/components/reply-modal/reply-modal.module.css index e0cd4bbe..bb6f689b 100644 --- a/src/components/reply-modal/reply-modal.module.css +++ b/src/components/reply-modal/reply-modal.module.css @@ -71,13 +71,20 @@ cursor: pointer; } +.parentCidWrapper { + position: absolute; + background-color: var(--post-form-field-input-background-color, white); + width: 105px; + height: 15px; + left: 1px; + top: 1px; + padding: 5px; +} + .parentCid { color: var(--post-form-field-input-color); position: absolute; - top: 4px; - left: 5px; text-decoration: underline; - pointer-events: none; } @media (max-width: 640px) { diff --git a/src/components/reply-modal/reply-modal.tsx b/src/components/reply-modal/reply-modal.tsx index e7748f2d..8d2050e4 100644 --- a/src/components/reply-modal/reply-modal.tsx +++ b/src/components/reply-modal/reply-modal.tsx @@ -63,6 +63,16 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => { } }, [isMobile, scrollY]); + const parentCidRef = useRef(null); + const parentCidWrapperRef = useRef(null); + + useEffect(() => { + if (parentCidRef.current && parentCidRef.current) { + const cidWidth = parentCidRef.current.offsetWidth; + parentCidRef.current.style.width = `${cidWidth}px`; + } + }, [parentCid]); + const modalContent = (
@@ -89,7 +99,11 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => { setContent.link(e.target.value)} />
- {`c/${parentCid && Plebbit.getShortCid(parentCid)}`} + + + {`c/${parentCid && Plebbit.getShortCid(parentCid)}`} + +