diff --git a/src/app.css b/src/app.css index bd087ac7..75ca6250 100644 --- a/src/app.css +++ b/src/app.css @@ -1093,6 +1093,10 @@ body:has(.status-deck) .media-post-link { line-height: 1.2; /* border-bottom: 1px solid var(--outline-color); */ } +.szh-menu__header.plain { + margin-bottom: 0; + background-color: transparent; +} .szh-menu__header * { vertical-align: middle; } @@ -1155,11 +1159,11 @@ body:has(.status-deck) .media-post-link { overflow: hidden; } .szh-menu .menu-double-lines { - white-space: normal; + white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; - overflow: hidden; + overflow: hidden !important; } .szh-menu .menu-double-lines span { white-space: normal; diff --git a/src/pages/status.jsx b/src/pages/status.jsx index 06d965f8..329b6c55 100644 --- a/src/pages/status.jsx +++ b/src/pages/status.jsx @@ -1,6 +1,6 @@ import './status.css'; -import { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu'; +import { Menu, MenuDivider, MenuHeader, MenuItem } from '@szhsin/react-menu'; import debounce from 'just-debounce-it'; import pRetry from 'p-retry'; import { useEffect, useMemo, useRef, useState } from 'preact/hooks'; @@ -322,6 +322,17 @@ function StatusPage() { '/:instance?/s/:id', ); + const postInstance = useMemo(() => { + if (!heroStatus) return; + const { url } = heroStatus; + if (!url) return; + return new URL(url).hostname; + }, [heroStatus]); + const postSameInstance = useMemo(() => { + if (!postInstance) return; + return postInstance === instance; + }, [postInstance, instance]); + const closeLink = useMemo(() => { const { prevLocation } = snapStates; const pathname = @@ -564,7 +575,6 @@ function StatusPage() { Refresh - { // Click all buttons with class .spoiler but not .spoiling @@ -581,6 +591,24 @@ function StatusPage() { {' '} Show all sensitive content + + Experimental + { + const statusURL = getInstanceStatusURL(heroStatus.url); + if (statusURL) { + navigate(statusURL); + } else { + alert('Unable to switch'); + } + }} + > + + + Switch to post's instance ({postInstance}) + + )}