mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-17 07:41:35 +03:00
New feature: "Show all sensitive content" menu
This commit is contained in:
parent
aaeca7dd03
commit
ae90b41aae
4 changed files with 41 additions and 2 deletions
|
@ -818,6 +818,9 @@ button.carousel-dot:is(.active, [disabled].active) {
|
||||||
.szh-menu .szh-menu__item {
|
.szh-menu .szh-menu__item {
|
||||||
padding: 8px 16px !important;
|
padding: 8px 16px !important;
|
||||||
}
|
}
|
||||||
|
.szh-menu .szh-menu__item * {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
.szh-menu
|
.szh-menu
|
||||||
.szh-menu__item:not(.szh-menu__item--disabled, .szh-menu__item--hover) {
|
.szh-menu__item:not(.szh-menu__item--disabled, .szh-menu__item--hover) {
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
|
|
|
@ -325,7 +325,7 @@ function Status({
|
||||||
<p>{spoilerText}</p>
|
<p>{spoilerText}</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="light spoiler"
|
class={`light spoiler ${showSpoiler ? 'spoiling' : ''}`}
|
||||||
type="button"
|
type="button"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -376,7 +376,7 @@ function Status({
|
||||||
)}
|
)}
|
||||||
{!spoilerText && sensitive && !!mediaAttachments.length && (
|
{!spoilerText && sensitive && !!mediaAttachments.length && (
|
||||||
<button
|
<button
|
||||||
class="plain spoiler"
|
class={`plain spoiler ${showSpoiler ? 'spoiling' : ''}`}
|
||||||
type="button"
|
type="button"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
|
@ -169,6 +169,13 @@ button,
|
||||||
color: var(--button-text-color);
|
color: var(--button-text-color);
|
||||||
backdrop-filter: blur(12px) invert(0.25);
|
backdrop-filter: blur(12px) invert(0.25);
|
||||||
}
|
}
|
||||||
|
:is(button, .button).plain4 {
|
||||||
|
background-color: transparent;
|
||||||
|
color: var(--text-insignificant-color);
|
||||||
|
}
|
||||||
|
:is(button, .button).plain4:not(:disabled, .disabled):is(:hover, :focus) {
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
:is(button, .button).light {
|
:is(button, .button).light {
|
||||||
background-color: var(--bg-faded-color);
|
background-color: var(--bg-faded-color);
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import './status.css';
|
import './status.css';
|
||||||
|
|
||||||
|
import { Menu, MenuItem } from '@szhsin/react-menu';
|
||||||
import debounce from 'just-debounce-it';
|
import debounce from 'just-debounce-it';
|
||||||
import pRetry from 'p-retry';
|
import pRetry from 'p-retry';
|
||||||
import { useEffect, useMemo, useRef, useState } from 'preact/hooks';
|
import { useEffect, useMemo, useRef, useState } from 'preact/hooks';
|
||||||
|
@ -472,6 +473,34 @@ function StatusPage() {
|
||||||
</h1>
|
</h1>
|
||||||
<div class="header-side">
|
<div class="header-side">
|
||||||
<Loader hidden={uiState !== 'loading'} />
|
<Loader hidden={uiState !== 'loading'} />
|
||||||
|
<Menu
|
||||||
|
align="end"
|
||||||
|
portal={{
|
||||||
|
// Need this, else the menu click will cause scroll jump
|
||||||
|
target: scrollableRef.current,
|
||||||
|
}}
|
||||||
|
menuButton={
|
||||||
|
<button type="button" class="button plain4">
|
||||||
|
<Icon icon="more" alt="Actions" size="xl" />
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
// Click all buttons with class .spoiler but not .spoiling
|
||||||
|
const buttons = Array.from(
|
||||||
|
scrollableRef.current.querySelectorAll(
|
||||||
|
'button.spoiler:not(.spoiling)',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
buttons.forEach((button) => {
|
||||||
|
button.click();
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon icon="eye-open" /> <span>Show all sensitive content</span>
|
||||||
|
</MenuItem>
|
||||||
|
</Menu>
|
||||||
<Link class="button plain deck-close" to={closeLink}>
|
<Link class="button plain deck-close" to={closeLink}>
|
||||||
<Icon icon="x" size="xl" />
|
<Icon icon="x" size="xl" />
|
||||||
</Link>
|
</Link>
|
||||||
|
|
Loading…
Add table
Reference in a new issue