feat(catalog row): add post menu button

This commit is contained in:
plebeius.eth
2024-04-13 13:39:15 +02:00
parent 1c125d17a7
commit a6ae543b4a
3 changed files with 77 additions and 6 deletions
@@ -79,11 +79,36 @@
text-decoration: none;
}
.postMenuBtnPadding {
left: 5px;
top: 5px;
position: relative;
}
.postMenuBtn {
position: absolute;
display: inline-block;
padding-left: 5px;
bottom: 5px;
line-height: 1em;
color: var(--catalog-post-menu-btn-color);
opacity: 0;
transition: transform 0.1s;
}
width: 1em;
height: 1em
.post:hover .postMenuBtn {
opacity: var(--catalog-post-menu-btn-opacity);
}
.post:hover .postMenuBtn:hover {
cursor: pointer;
color: var(--catalog-post-menu-btn-hover-color);
opacity: var(--catalog-post-menu-btn-hover-opacity);
}
.postMenuBtn {
/* preserve unicode triangle for button, some browsers will use an emoji */
font-variant: normal;
font-feature-settings: "tnum";
-webkit-font-feature-settings: "tnum"; /* Chrome, Opera, and Safari */
-moz-font-feature-settings: "tnum"; /* Firefox */
font-variant-numeric: tabular-nums;
}
+12 -2
View File
@@ -1,3 +1,4 @@
import { useState } from 'react';
import { Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { Comment } from '@plebbit/plebbit-react-hooks';
@@ -69,6 +70,8 @@ const CatalogPost = ({ post }: { post: Comment }) => {
</div>
);
const [menuBtnRotated, setMenuBtnRotated] = useState(false);
return (
<div className={styles.post}>
{hasThumbnail ? (
@@ -91,8 +94,15 @@ const CatalogPost = ({ post }: { post: Comment }) => {
/ L: <b>{linkCount}</b>
</span>
)}
<span className={styles.postMenuBtn} title='Thread Menu'>
<span className={styles.postMenuBtnPadding}>
<span
className={styles.postMenuBtn}
title='Thread Menu'
onClick={() => setMenuBtnRotated(!menuBtnRotated)}
style={{ transform: menuBtnRotated ? 'rotate(90deg)' : 'rotate(0deg)' }}
>
</span>
</span>
</div>
<Link to={postLink}>
+36
View File
@@ -24,6 +24,12 @@
--body-font-family: arial, helvetica, sans-serif;
--body-font-size: 10pt;
/* catalog post */
--catalog-post-menu-btn-color: navy;
--catalog-post-menu-btn-hover-color: red;
--catalog-post-menu-btn-opacity: 0.5;
--catalog-post-menu-btn-hover-opacity: 1;
/* desktop buttons */
--button-desktop-text-color: #00e;
--button-desktop-text-color-hover: red;
@@ -150,6 +156,12 @@
--body-font-family: arial, helvetica, sans-serif;
--body-font-size: 10pt;
/* catalog post */
--catalog-post-menu-btn-color: navy;
--catalog-post-menu-btn-hover-color: #d00;
--catalog-post-menu-btn-opacity: 0.5;
--catalog-post-menu-btn-hover-opacity: 1;
/* homepage */
--homepage-infobox-text-color: #000;
--homepage-infobox-bar-text-color: #000;
@@ -270,6 +282,12 @@
--board-title-font-size: 32px;
--board-address-font-size: 10pt;
/* catalog post */
--catalog-post-menu-btn-color: navy;
--catalog-post-menu-btn-hover-color: red;
--catalog-post-menu-btn-opacity: 0.5;
--catalog-post-menu-btn-hover-opacity: 1;
/* desktop buttons */
--button-desktop-text-color: #00e;
--button-desktop-text-color-hover: red;
@@ -385,6 +403,12 @@
--homepage-box-bar-background-color: #98e;
--homepage-box-bar-text-color-hover: #fff;
/* catalog post */
--catalog-post-menu-btn-color: navy;
--catalog-post-menu-btn-hover-color: red;
--catalog-post-menu-btn-opacity: 0.5;
--catalog-post-menu-btn-hover-opacity: 1;
/* desktop buttons */
--button-desktop-text-color: #34345c;
--button-text-decoration: underline;
@@ -497,6 +521,12 @@
--board-title-font-family: Tahoma, sans-serif;
--board-address-font-size: x-small;
/* catalog post */
--catalog-post-menu-btn-color: #5f89ac;
--catalog-post-menu-btn-hover-color: #5f89ac;
--catalog-post-menu-btn-opacity: 0.5;
--catalog-post-menu-btn-hover-opacity: 1;
/* desktop buttons */
--button-desktop-text-color: #81a2be;
--button-desktop-text-color-hover: #5f89ac;
@@ -610,6 +640,12 @@
--board-title-text-color: #004a99;
--board-address-font-size: x-small;
/* catalog post */
--catalog-post-menu-btn-color: #f60;
--catalog-post-menu-btn-hover-color: #f30;
--catalog-post-menu-btn-opacity: 0.5;
--catalog-post-menu-btn-hover-opacity: 1;
/* desktop buttons */
--button-desktop-text-color: #f60;
--button-desktop-text-color-hover: #f30;