style(reply modal): add background color to c/parentCid

This commit is contained in:
plebeius.eth
2024-05-09 22:55:57 +02:00
parent f26bcfeced
commit 6a49363fc0
3 changed files with 29 additions and 5 deletions
@@ -71,13 +71,20 @@
cursor: pointer; 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 { .parentCid {
color: var(--post-form-field-input-color); color: var(--post-form-field-input-color);
position: absolute; position: absolute;
top: 4px;
left: 5px;
text-decoration: underline; text-decoration: underline;
pointer-events: none;
} }
@media (max-width: 640px) { @media (max-width: 640px) {
+15 -1
View File
@@ -63,6 +63,16 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => {
} }
}, [isMobile, scrollY]); }, [isMobile, scrollY]);
const parentCidRef = useRef<HTMLSpanElement>(null);
const parentCidWrapperRef = useRef<HTMLDivElement>(null);
useEffect(() => {
if (parentCidRef.current && parentCidRef.current) {
const cidWidth = parentCidRef.current.offsetWidth;
parentCidRef.current.style.width = `${cidWidth}px`;
}
}, [parentCid]);
const modalContent = ( const modalContent = (
<div className={styles.container} ref={nodeRef}> <div className={styles.container} ref={nodeRef}>
<div className={`replyModalHandle ${styles.title}`}> <div className={`replyModalHandle ${styles.title}`}>
@@ -89,7 +99,11 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => {
<input type='text' ref={urlRef} placeholder={_.capitalize(t('link'))} onChange={(e) => setContent.link(e.target.value)} /> <input type='text' ref={urlRef} placeholder={_.capitalize(t('link'))} onChange={(e) => setContent.link(e.target.value)} />
</div> </div>
<div className={styles.content}> <div className={styles.content}>
<span className={styles.parentCid}>{`c/${parentCid && Plebbit.getShortCid(parentCid)}`}</span> <span className={styles.parentCidWrapper} ref={parentCidWrapperRef}>
<span className={styles.parentCid} ref={parentCidRef}>
{`c/${parentCid && Plebbit.getShortCid(parentCid)}`}
</span>
</span>
<textarea <textarea
cols={48} cols={48}
rows={4} rows={4}
+4 -1
View File
@@ -278,7 +278,7 @@
--post-form-field-input-appearance: none; --post-form-field-input-appearance: none;
--post-form-field-input-outline: none; --post-form-field-input-outline: none;
--post-form-field-input-focus-border: 1px solid #98e; --post-form-field-input-focus-border: 1px solid #98e;
--post-form-field-input-color: #c5c8c6; --post-form-field-input-color: #000;
/* post mobile */ /* post mobile */
--post-mobile-background-color: #d6daf0; --post-mobile-background-color: #d6daf0;
@@ -410,6 +410,7 @@
--post-form-field-border: none; --post-form-field-border: none;
--post-form-field-title-font-weight: 700; --post-form-field-title-font-weight: 700;
--post-form-field-title-font-size: 16px; --post-form-field-title-font-size: 16px;
--post-form-field-input-color: #000;
/* post mobile */ /* post mobile */
--post-mobile-background-color: #f5e9e1; --post-mobile-background-color: #f5e9e1;
@@ -551,6 +552,7 @@
--post-form-field-border: none; --post-form-field-border: none;
--post-form-field-title-font-weight: 700; --post-form-field-title-font-weight: 700;
--post-form-field-title-font-size: 16px; --post-form-field-title-font-size: 16px;
--post-form-field-input-color: #000;
/* post mobile */ /* post mobile */
--post-mobile-background-color: #d6daf0; --post-mobile-background-color: #d6daf0;
@@ -868,6 +870,7 @@
--post-form-field-input-appearance: none; --post-form-field-input-appearance: none;
--post-form-field-input-outline: none; --post-form-field-input-outline: none;
--post-form-field-input-focus-border: 1px solid #ea8; --post-form-field-input-focus-border: 1px solid #ea8;
--post-form-field-input-color: #000;
/* quotelink */ /* quotelink */
--post-quotelink-text-color: #f60; --post-quotelink-text-color: #f60;