mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-24 18:25:41 +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;
|
||||
}, [statuses.length, limit]);
|
||||
|
||||
const hasManyStatuses = statuses.length > 40;
|
||||
|
||||
return (
|
||||
<div class="deck-backdrop">
|
||||
<Link href={closeLink}></Link>
|
||||
|
@ -229,8 +231,8 @@ function StatusPage({ id }) {
|
|||
</Link>
|
||||
)}
|
||||
{descendant && replies?.length > 0 && (
|
||||
<details class="replies">
|
||||
<summary>
|
||||
<details class="replies" open={!hasManyStatuses}>
|
||||
<summary hidden={!hasManyStatuses}>
|
||||
{replies.length} repl{replies.length === 1 ? 'y' : 'ies'}
|
||||
</summary>
|
||||
<ul>
|
||||
|
|
Loading…
Reference in a new issue