From 4ee2c36801c8f55f2a488d98cf86831af08e3548 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 25 Mar 2023 08:46:32 +0100 Subject: [PATCH] Change design of account rows in web UI Port ef127c964a60f365129bc97a2cb2fc6d12ba6407 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/components/account.jsx | 55 ++++++++++++++++--- .../glitch/styles/components/accounts.scss | 23 ++++++-- .../glitch/styles/components/status.scss | 6 +- 3 files changed, 69 insertions(+), 15 deletions(-) diff --git a/app/javascript/flavours/glitch/components/account.jsx b/app/javascript/flavours/glitch/components/account.jsx index 701c6be71561ba..40f1c780676ade 100644 --- a/app/javascript/flavours/glitch/components/account.jsx +++ b/app/javascript/flavours/glitch/components/account.jsx @@ -13,8 +13,9 @@ import { DisplayName } from './display_name'; import { IconButton } from './icon_button'; import Permalink from './permalink'; import { RelativeTimestamp } from './relative_timestamp'; - - +import { counterRenderer } from 'flavours/glitch/components/common_counter'; +import ShortNumber from 'flavours/glitch/components/short_number'; +import Icon from 'flavours/glitch/components/icon'; const messages = defineMessages({ follow: { id: 'account.follow', defaultMessage: 'Follow' }, @@ -28,6 +29,26 @@ const messages = defineMessages({ block: { id: 'account.block', defaultMessage: 'Block @{name}' }, }); +class VerifiedBadge extends React.PureComponent { + + static propTypes = { + link: PropTypes.string.isRequired, + verifiedAt: PropTypes.string.isRequired, + }; + + render () { + const { link } = this.props; + + return ( + + + + + ); + } + +} + class Account extends ImmutablePureComponent { static propTypes = { @@ -82,7 +103,11 @@ class Account extends ImmutablePureComponent {
- + +
+ + +
@@ -136,18 +161,32 @@ class Account extends ImmutablePureComponent { } } - let mute_expires_at; + let muteTimeRemaining; + if (account.get('mute_expires_at')) { - mute_expires_at =
; + muteTimeRemaining = <>· ; + } + + let verification; + + const firstVerifiedField = account.get('fields').find(item => !!item.get('verified_at')); + + if (firstVerifiedField) { + verification = <>· ; } return (
-
- {mute_expires_at} - +
+ +
+ +
+ + {verification} {muteTimeRemaining} +
diff --git a/app/javascript/flavours/glitch/styles/components/accounts.scss b/app/javascript/flavours/glitch/styles/components/accounts.scss index e68c6cac0463a3..5e8c7155154e6e 100644 --- a/app/javascript/flavours/glitch/styles/components/accounts.scss +++ b/app/javascript/flavours/glitch/styles/components/accounts.scss @@ -12,10 +12,12 @@ text-decoration: none; font-size: 14px; - &--with-note { - strong { - display: inline; - } + .display-name { + margin-bottom: 4px; + } + + .display-name strong { + display: inline; } } @@ -764,6 +766,19 @@ } } +.verified-badge { + display: inline-flex; + align-items: center; + color: $valid-value-color; + gap: 4px; + + a { + color: inherit; + font-weight: 500; + text-decoration: none; + } +} + .moved-account-banner, .follow-request-banner, .account-memorial-banner { diff --git a/app/javascript/flavours/glitch/styles/components/status.scss b/app/javascript/flavours/glitch/styles/components/status.scss index 0b720637de2ef5..85e3165a88c0ef 100644 --- a/app/javascript/flavours/glitch/styles/components/status.scss +++ b/app/javascript/flavours/glitch/styles/components/status.scss @@ -626,7 +626,7 @@ .status__display-name, .account__display-name { - strong { + .display-name strong { color: $primary-text-color; } } @@ -641,12 +641,12 @@ a.status__display-name, .reply-indicator__display-name, .detailed-status__display-name, .account__display-name { - &:hover strong { + &:hover .display-name strong { text-decoration: underline; } } -.account__display-name strong { +.account__display-name .display-name strong { display: block; overflow: hidden; text-overflow: ellipsis;