From 941d2efeb1b97a3cdf96c680ea3f5316bc881b8b Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 16 Sep 2023 14:48:31 +0800 Subject: [PATCH] Convert posting stats box into a link to account page --- src/components/account-info.css | 6 +++ src/components/account-info.jsx | 89 +++++++++++++++++---------------- 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/src/components/account-info.css b/src/components/account-info.css index 0722deca..f28f507b 100644 --- a/src/components/account-info.css +++ b/src/components/account-info.css @@ -196,6 +196,8 @@ .account-container .account-metadata-box { overflow: hidden; border-radius: 16px; + display: block; + text-decoration: none; & > * { margin-bottom: 2px; @@ -308,6 +310,10 @@ --size: 8px; --original-color: var(--link-color); + &:is(:hover, :focus-within) { + background-color: var(--link-bg-hover-color); + } + .posting-stats-bar { height: var(--size); border-radius: var(--size); diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index df708925..7b77a2f7 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -648,58 +648,63 @@ function RelatedActions({ info, instance, authenticated, standalone }) { const [showAddRemoveLists, setShowAddRemoveLists] = useState(false); const hasPostingStats = postingStats?.total >= 3; + const accountLink = instance ? `/${instance}/a/${id}` : `/a/${id}`; return ( <> {hasPostingStats && ( -
- {hasPostingStats && ( -
-
-
-
- {postingStats.daysSinceLastPost < 365 - ? `Last ${postingStats.total} posts in the past + { + states.showAccount = false; + }} + > +
+
+
+
+ {postingStats.daysSinceLastPost < 365 + ? `Last ${postingStats.total} posts in the past ${postingStats.daysSinceLastPost} day${ - postingStats.daysSinceLastPost > 1 ? 's' : '' - }` - : ` + postingStats.daysSinceLastPost > 1 ? 's' : '' + }` + : ` Last ${postingStats.total} posts in the past year(s) `} -
-
-
- - {' '} - Original - {' '} - - {' '} - Replies - {' '} - - {' '} - Boosts - -
+
+
+
+ + {' '} + Original + {' '} + + {' '} + Replies + {' '} + + {' '} + Boosts +
- )} -
+
+ )}