mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(catalog row): add post menu button
This commit is contained in:
@@ -79,11 +79,36 @@
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.postMenuBtnPadding {
|
||||||
|
left: 5px;
|
||||||
|
top: 5px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.postMenuBtn {
|
.postMenuBtn {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: inline-block;
|
bottom: 5px;
|
||||||
padding-left: 5px;
|
line-height: 1em;
|
||||||
|
color: var(--catalog-post-menu-btn-color);
|
||||||
|
opacity: 0;
|
||||||
|
transition: transform 0.1s;
|
||||||
|
}
|
||||||
|
|
||||||
width: 1em;
|
.post:hover .postMenuBtn {
|
||||||
height: 1em
|
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;
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { useState } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Comment } from '@plebbit/plebbit-react-hooks';
|
import { Comment } from '@plebbit/plebbit-react-hooks';
|
||||||
@@ -69,6 +70,8 @@ const CatalogPost = ({ post }: { post: Comment }) => {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [menuBtnRotated, setMenuBtnRotated] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.post}>
|
<div className={styles.post}>
|
||||||
{hasThumbnail ? (
|
{hasThumbnail ? (
|
||||||
@@ -91,8 +94,15 @@ const CatalogPost = ({ post }: { post: Comment }) => {
|
|||||||
/ L: <b>{linkCount}</b>
|
/ L: <b>{linkCount}</b>
|
||||||
</span>
|
</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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<Link to={postLink}>
|
<Link to={postLink}>
|
||||||
|
|||||||
@@ -24,6 +24,12 @@
|
|||||||
--body-font-family: arial, helvetica, sans-serif;
|
--body-font-family: arial, helvetica, sans-serif;
|
||||||
--body-font-size: 10pt;
|
--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 */
|
/* desktop buttons */
|
||||||
--button-desktop-text-color: #00e;
|
--button-desktop-text-color: #00e;
|
||||||
--button-desktop-text-color-hover: red;
|
--button-desktop-text-color-hover: red;
|
||||||
@@ -150,6 +156,12 @@
|
|||||||
--body-font-family: arial, helvetica, sans-serif;
|
--body-font-family: arial, helvetica, sans-serif;
|
||||||
--body-font-size: 10pt;
|
--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 */
|
||||||
--homepage-infobox-text-color: #000;
|
--homepage-infobox-text-color: #000;
|
||||||
--homepage-infobox-bar-text-color: #000;
|
--homepage-infobox-bar-text-color: #000;
|
||||||
@@ -270,6 +282,12 @@
|
|||||||
--board-title-font-size: 32px;
|
--board-title-font-size: 32px;
|
||||||
--board-address-font-size: 10pt;
|
--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 */
|
/* desktop buttons */
|
||||||
--button-desktop-text-color: #00e;
|
--button-desktop-text-color: #00e;
|
||||||
--button-desktop-text-color-hover: red;
|
--button-desktop-text-color-hover: red;
|
||||||
@@ -385,6 +403,12 @@
|
|||||||
--homepage-box-bar-background-color: #98e;
|
--homepage-box-bar-background-color: #98e;
|
||||||
--homepage-box-bar-text-color-hover: #fff;
|
--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 */
|
/* desktop buttons */
|
||||||
--button-desktop-text-color: #34345c;
|
--button-desktop-text-color: #34345c;
|
||||||
--button-text-decoration: underline;
|
--button-text-decoration: underline;
|
||||||
@@ -497,6 +521,12 @@
|
|||||||
--board-title-font-family: Tahoma, sans-serif;
|
--board-title-font-family: Tahoma, sans-serif;
|
||||||
--board-address-font-size: x-small;
|
--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 */
|
/* desktop buttons */
|
||||||
--button-desktop-text-color: #81a2be;
|
--button-desktop-text-color: #81a2be;
|
||||||
--button-desktop-text-color-hover: #5f89ac;
|
--button-desktop-text-color-hover: #5f89ac;
|
||||||
@@ -610,6 +640,12 @@
|
|||||||
--board-title-text-color: #004a99;
|
--board-title-text-color: #004a99;
|
||||||
--board-address-font-size: x-small;
|
--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 */
|
/* desktop buttons */
|
||||||
--button-desktop-text-color: #f60;
|
--button-desktop-text-color: #f60;
|
||||||
--button-desktop-text-color-hover: #f30;
|
--button-desktop-text-color-hover: #f30;
|
||||||
|
|||||||
Reference in New Issue
Block a user