From 86fc69f2a012f9b37e1d2d76535162b81c4ca089 Mon Sep 17 00:00:00 2001 From: Jaco Date: Wed, 4 Jan 2023 08:46:02 +0200 Subject: [PATCH] Minor link adjustments, Account/Address/Referendum (#8684) --- .../page-accounts/src/Accounts/Account.tsx | 18 ++++---- .../page-addresses/src/Contacts/Address.tsx | 18 ++++---- .../src/Referenda/Referendum.tsx | 33 ++++++++------ .../react-components/src/LinkExternal.tsx | 44 +++++++++---------- 4 files changed, 60 insertions(+), 53 deletions(-) diff --git a/packages/page-accounts/src/Accounts/Account.tsx b/packages/page-accounts/src/Accounts/Account.tsx index d213cdefee..fd5907f8c3 100644 --- a/packages/page-accounts/src/Accounts/Account.tsx +++ b/packages/page-accounts/src/Accounts/Account.tsx @@ -741,15 +741,6 @@ function Account ({ account: { address, meta }, className = '', delegation, filt withBalance={BAL_OPTS_EXPANDED} withExtended={false} /> - - - - -
@@ -764,6 +755,15 @@ function Account ({ account: { address, meta }, className = '', delegation, filt + + + + + diff --git a/packages/page-addresses/src/Contacts/Address.tsx b/packages/page-addresses/src/Contacts/Address.tsx index cc58262ee1..74a61ddc2a 100644 --- a/packages/page-addresses/src/Contacts/Address.tsx +++ b/packages/page-addresses/src/Contacts/Address.tsx @@ -267,15 +267,6 @@ function Address ({ address, className = '', filter, isFavorite, toggleFavorite withBalance={BALANCE_OPTS} withExtended={false} /> - - - - -
@@ -286,6 +277,15 @@ function Address ({ address, className = '', filter, isFavorite, toggleFavorite
+ + + + + diff --git a/packages/page-referenda/src/Referenda/Referendum.tsx b/packages/page-referenda/src/Referenda/Referendum.tsx index 66210b2a38..1c87c78653 100644 --- a/packages/page-referenda/src/Referenda/Referendum.tsx +++ b/packages/page-referenda/src/Referenda/Referendum.tsx @@ -409,13 +409,6 @@ function Referendum (props: Props): React.ReactElement { )} - - - {submittedIn && ( <> @@ -423,12 +416,6 @@ function Referendum (props: Props): React.ReactElement { )} - {enactAt && ( - <> -
{enactAt.at ? t('Enact at') : t('Enact after')}
- - - )} {nextAlarm && ( <>
{t('Next alarm')}
@@ -436,6 +423,26 @@ function Referendum (props: Props): React.ReactElement { )}
+ + {enactAt && ( + <> +
{enactAt.at ? t('Enact at') : t('Enact after')}
+ + + )} +
+
+ + + + diff --git a/packages/react-components/src/LinkExternal.tsx b/packages/react-components/src/LinkExternal.tsx index 7b85c12002..9bc11d8305 100644 --- a/packages/react-components/src/LinkExternal.tsx +++ b/packages/react-components/src/LinkExternal.tsx @@ -23,11 +23,7 @@ interface Props { withTitle?: boolean; } -// function shortName (name: string): string { -// return `${name[0]}${name[name.length - 1]}`; -// } - -function genLinks (systemChain: string, { data, hash, isSidebar, isText, type }: Props): React.ReactNode[] { +function genLinks (systemChain: string, { data, hash, isText, type }: Props): React.ReactNode[] { return Object .entries(externalLinks) .map(([name, { chains, create, isActive, logo, paths, url }]): React.ReactNode | null => { @@ -48,12 +44,7 @@ function genLinks (systemChain: string, { data, hash, isSidebar, isText, type }: > {isText ? name - : ( - - ) + : } ); @@ -74,7 +65,7 @@ function LinkExternal ({ className = '', data, hash, isSidebar, isSmall, isText, } return ( -
+
{(isText && !isSmall) &&
{t('View this externally')}
} {withTitle && (
{t('external links')}
@@ -104,24 +95,33 @@ export default React.memo(styled(LinkExternal)` &.isSidebar { text-align: center; + + .links { + img { + height: 2rem; + width: 2rem; + } + } + } + + &:not(.fullColor) { + .links { + img { + filter: grayscale(1) opacity(0.66); + + &:hover { + filter: grayscale(0) opacity(1); + } + } + } } .links { img { border-radius: 50%; cursor: pointer; - filter: grayscale(1) opacity(0.66); height: 1.5rem; width: 1.5rem; - - &.isSidebar { - height: 2rem; - width: 2rem; - } - - &:hover { - filter: grayscale(0) opacity(1); - } } span {