diff --git a/src/components/board-banner/board-banner.tsx b/src/components/board-banner/board-banner.tsx index f04ff400..d6c3648f 100644 --- a/src/components/board-banner/board-banner.tsx +++ b/src/components/board-banner/board-banner.tsx @@ -10,8 +10,7 @@ const totalBanners = 57; const ImageBanner = () => { const [imagePath] = useState(() => { const randomBannerIndex = Math.floor(Math.random() * totalBanners) + 1; - const cacheBuster = new Date().getTime(); - return `assets/banners/banner-${randomBannerIndex}.jpg?cacheBuster=${cacheBuster}`; + return `/assets/banners/banner-${randomBannerIndex}.jpg`; }); return ; @@ -28,20 +27,19 @@ const BoardBanner = () => { const subplebbitAddress = params?.subplebbitAddress || accountComment?.subplebbitAddress; const subplebbit = useSubplebbit({ subplebbitAddress }); - const displayAddress = - subplebbit?.address && subplebbit?.address.length > 10 && !subplebbit?.address.includes('.') ? subplebbit?.address.slice(0, 13).concat('...') : subplebbit?.address; + const { address, shortAddress } = subplebbit || {}; const multisubMetadata = useMultisubMetadata(); const title = isInAllView ? multisubMetadata?.title : isInSubscriptionsView ? 'Subscriptions' : subplebbit?.title; - const subtitle = isInAllView ? 'p/all' : isInSubscriptionsView ? 'p/subscriptions' : `p/${subplebbit?.address}`; + const subtitle = isInAllView ? 'p/all' : isInSubscriptionsView ? 'p/subscriptions' : `p/${address}`; return (
- +
-
{title || `p/${displayAddress}`}
+
{title || `p/${shortAddress}`}
{subtitle}

diff --git a/src/components/catalog-row/catalog-row.module.css b/src/components/catalog-row/catalog-row.module.css index d28ba1c8..e97bb7c5 100644 --- a/src/components/catalog-row/catalog-row.module.css +++ b/src/components/catalog-row/catalog-row.module.css @@ -79,36 +79,20 @@ text-decoration: none; } -.postMenuBtnPadding { - left: 5px; - top: 5px; - position: relative; +.post .postMenu { + visibility: hidden; } -.postMenuBtn { - position: absolute; - bottom: 5px; - line-height: 1em; - color: var(--catalog-post-menu-btn-color); - opacity: 0; - transition: transform 0.1s; +.post:hover .postMenu { + visibility: visible; } -.post:hover .postMenuBtn { - opacity: var(--catalog-post-menu-btn-opacity); +.loadingSkeleton { + width: 150px; + height: 150px; + display: inline-block; } -.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; +.fileDeleted { + image-rendering: pixelated; } \ No newline at end of file diff --git a/src/components/catalog-row/catalog-row.tsx b/src/components/catalog-row/catalog-row.tsx index db5cc4ca..766cd4ff 100644 --- a/src/components/catalog-row/catalog-row.tsx +++ b/src/components/catalog-row/catalog-row.tsx @@ -1,47 +1,31 @@ -import { useEffect, useState } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Comment } from '@plebbit/plebbit-react-hooks'; +import styles from './catalog-row.module.css'; import { getCommentMediaInfo, getHasThumbnail } from '../../lib/utils/media-utils'; import { isAllView } from '../../lib/utils/view-utils'; import useFetchGifFirstFrame from '../../hooks/use-fetch-gif-first-frame'; import useCountLinksInReplies from '../../hooks/use-count-links-in-replies'; -import styles from './catalog-row.module.css'; +import PostMenuDesktop from '../post/post-desktop/post-menu-desktop/'; -export const CatalogPostMedia = ({ commentMediaInfo }: { commentMediaInfo: any }) => { +import React, { useState } from 'react'; + +interface CatalogPostMediaProps { + commentMediaInfo: any; + isOutOfFeed?: boolean; + linkWidth?: number; + linkHeight?: number; +} + +export const CatalogPostMedia = ({ commentMediaInfo, isOutOfFeed, linkWidth, linkHeight }: CatalogPostMediaProps) => { const { patternThumbnailUrl, thumbnail, type, url } = commentMediaInfo || {}; const iframeThumbnail = patternThumbnailUrl || thumbnail; const gifFrameUrl = useFetchGifFirstFrame(type === 'gif' ? url : undefined); - let thumbnailComponent: React.ReactNode = null; - - if (type === 'image') { - thumbnailComponent = ; - } else if (type === 'video') { - thumbnailComponent = thumbnail ? :