From 144ff4217e1a515bf8c785f33335efdd16d07003 Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Thu, 29 Feb 2024 12:06:12 -0800 Subject: [PATCH 1/2] [C-3918] Fix wallet and dev-apps icons --- packages/harmony/src/components/hint/Hint.tsx | 25 +++++++++---- .../AudioBreakdownDrawer.tsx | 10 ----- .../audio-breakdown-drawer/Wallet.tsx | 5 +-- .../DeveloperApps/AppDetailsPage.module.css | 33 ----------------- .../desktop/DeveloperApps/AppDetailsPage.tsx | 37 +++++++++---------- 5 files changed, 36 insertions(+), 74 deletions(-) diff --git a/packages/harmony/src/components/hint/Hint.tsx b/packages/harmony/src/components/hint/Hint.tsx index eb6b593af72..7c5c953e186 100644 --- a/packages/harmony/src/components/hint/Hint.tsx +++ b/packages/harmony/src/components/hint/Hint.tsx @@ -1,32 +1,41 @@ +import { ReactNode } from 'react' + import type { IconComponent } from 'components/icon' +import { Flex } from 'components/layout' import { Paper, PaperProps } from 'components/layout/Paper' import { Text } from 'components/text' type HintProps = { icon: IconComponent + actions?: ReactNode } & PaperProps /* * A way of informing the user of important details in line in a prominent way. */ export const Hint = (props: HintProps) => { - const { icon: Icon, children, ...other } = props + const { icon: Icon, children, actions, ...other } = props return ( - - - {children} - + + + + {children} + + + + {actions} + ) } diff --git a/packages/mobile/src/components/audio-breakdown-drawer/AudioBreakdownDrawer.tsx b/packages/mobile/src/components/audio-breakdown-drawer/AudioBreakdownDrawer.tsx index 45589446cd9..652a2270559 100644 --- a/packages/mobile/src/components/audio-breakdown-drawer/AudioBreakdownDrawer.tsx +++ b/packages/mobile/src/components/audio-breakdown-drawer/AudioBreakdownDrawer.tsx @@ -10,12 +10,10 @@ import BN from 'bn.js' import { View } from 'react-native' import { useSelector } from 'react-redux' -import { IconInfo } from '@audius/harmony-native' import { GradientText } from 'app/components/core' import { AppDrawer } from 'app/components/drawer' import Text from 'app/components/text' import { makeStyles } from 'app/styles' -import { spacing } from 'app/styles/spacing' import { Wallet } from './Wallet' const { getAccountBalance } = walletSelectors @@ -70,9 +68,6 @@ const useStyles = makeStyles(({ palette, spacing, typography }) => ({ color: palette.neutralLight4, fontSize: spacing(3) }, - infoIcon: { - marginLeft: 8 - }, walletsHeader: { flexDirection: 'row', justifyContent: 'space-between', @@ -192,11 +187,6 @@ export const AudioBreakdownDrawer = () => { {messages.linkedWalletsDescription} - diff --git a/packages/mobile/src/components/audio-breakdown-drawer/Wallet.tsx b/packages/mobile/src/components/audio-breakdown-drawer/Wallet.tsx index 4bb36d89ff0..7b39d5160fe 100644 --- a/packages/mobile/src/components/audio-breakdown-drawer/Wallet.tsx +++ b/packages/mobile/src/components/audio-breakdown-drawer/Wallet.tsx @@ -40,9 +40,6 @@ const useSyles = makeStyles(({ palette, spacing }) => ({ fontSize: 14 }, copyIcon: { - lineHeight: 16, - marginBottom: 2, - color: palette.neutralLight4, marginLeft: 10 } })) @@ -77,7 +74,7 @@ export const Wallet = (props: WalletProps) => { {displayAddress(address)} - + diff --git a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/AppDetailsPage.module.css b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/AppDetailsPage.module.css index 24d8822d9d6..759fdf32d3b 100644 --- a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/AppDetailsPage.module.css +++ b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/AppDetailsPage.module.css @@ -4,41 +4,8 @@ gap: var(--unit-6); } -.secretNotice { - background-color: var(--neutral-light-9); - border: 1px solid var(--netural-light-7); - border-radius: var(--unit-2); - display: flex; - flex-direction: column; - gap: var(--unit-3); - padding: var(--unit-3) var(--unit-4); -} - -.noticeIcon { - height: var(--unit-8); - width: var(--unit-8); -} - -.noticeTextRoot { - display: inline-flex; - align-items: center; - gap: var(--unit-4); -} - -.noticeText { - font-size: var(--font-l); - font-weight: var(--font-medium); - line-height: 1.3; -} - .readTheDocs { - /* left-aligns link with title */ - margin-left: calc(var(--unit-5) + var(--unit-4)); - align-self: flex-start; - font-size: var(--font-m); - font-weight: var(--font-medium); color: var(--secondary); - text-align: left; text-decoration: underline !important; } diff --git a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/AppDetailsPage.tsx b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/AppDetailsPage.tsx index 5d7e0ba9a7c..ed7bdf515a4 100644 --- a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/AppDetailsPage.tsx +++ b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/AppDetailsPage.tsx @@ -1,13 +1,15 @@ import { useCallback } from 'react' import { - IconCopy as IconCopyPlain, - IconError as IconWarning, + IconCopy, + IconError, IconCaretRight, - IconButton + IconButton, + Hint } from '@audius/harmony' import { Divider } from 'components/divider' +import { ExternalLink } from 'components/link' import Toast from 'components/toast/Toast' import { MountPlacement } from 'components/types' import { copyToClipboard } from 'utils/clipboardUtil' @@ -55,20 +57,17 @@ export const AppDetailsPage = (props: AppDetailsPageProps) => { return (
{!apiSecret ? null : ( -
- - -

{messages.secretReminder}

-
- - {messages.readTheDocs} - -
+ + {messages.readTheDocs} + + } + > + {messages.secretReminder} + )}

{name}

{!description ? null : ( @@ -88,7 +87,7 @@ export const AppDetailsPage = (props: AppDetailsPageProps) => { onClick={copyApiKey} aria-label={messages.copyApiKeyLabel} color='subdued' - icon={IconCopyPlain} + icon={IconCopy} /> @@ -105,7 +104,7 @@ export const AppDetailsPage = (props: AppDetailsPageProps) => { onClick={copySecret} aria-label={messages.copyApiKeyLabel} color='subdued' - icon={IconCopyPlain} + icon={IconCopy} /> From 50c80f0f115f9790b02855509b5df2b8d4dde853 Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Thu, 29 Feb 2024 12:09:46 -0800 Subject: [PATCH 2/2] Conditionally render actions --- packages/harmony/src/components/hint/Hint.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/harmony/src/components/hint/Hint.tsx b/packages/harmony/src/components/hint/Hint.tsx index 7c5c953e186..7887ada0b11 100644 --- a/packages/harmony/src/components/hint/Hint.tsx +++ b/packages/harmony/src/components/hint/Hint.tsx @@ -33,9 +33,11 @@ export const Hint = (props: HintProps) => { {children} - - {actions} - + {actions ? ( + + {actions} + + ) : null} ) }