mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 02:35:39 +03:00
Auto-open details and hide summary button
Only show toggle comments button if there are many statuses
This commit is contained in:
parent
141f4a94dc
commit
681dfaaaff
1 changed files with 4 additions and 2 deletions
|
@ -175,6 +175,8 @@ function StatusPage({ id }) {
|
||||||
return statuses.length - limit;
|
return statuses.length - limit;
|
||||||
}, [statuses.length, limit]);
|
}, [statuses.length, limit]);
|
||||||
|
|
||||||
|
const hasManyStatuses = statuses.length > 40;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="deck-backdrop">
|
<div class="deck-backdrop">
|
||||||
<Link href={closeLink}></Link>
|
<Link href={closeLink}></Link>
|
||||||
|
@ -229,8 +231,8 @@ function StatusPage({ id }) {
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
{descendant && replies?.length > 0 && (
|
{descendant && replies?.length > 0 && (
|
||||||
<details class="replies">
|
<details class="replies" open={!hasManyStatuses}>
|
||||||
<summary>
|
<summary hidden={!hasManyStatuses}>
|
||||||
{replies.length} repl{replies.length === 1 ? 'y' : 'ies'}
|
{replies.length} repl{replies.length === 1 ? 'y' : 'ies'}
|
||||||
</summary>
|
</summary>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
Loading…
Reference in a new issue