Skip to content

Commit

Permalink
[C-3918] Fix wallet and dev-apps icons (#7749)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers authored Feb 29, 2024
1 parent a4bbe1c commit 23072cd
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 74 deletions.
27 changes: 19 additions & 8 deletions packages/harmony/src/components/hint/Hint.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
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 (
<Paper
role='alert'
backgroundColor='surface2'
ph='l'
pv='m'
backgroundColor='surface2'
alignItems='center'
gap='l'
direction='column'
gap='m'
shadow='flat'
border='strong'
{...other}
>
<Icon size='l' color='default' />
<Text variant='body' color='default'>
{children}
</Text>
<Flex gap='l' alignItems='center'>
<Icon size='l' color='default' />
<Text variant='body' color='default'>
{children}
</Text>
</Flex>
{actions ? (
<Flex pl='unit10' gap='l'>
{actions}
</Flex>
) : null}
</Paper>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -192,11 +187,6 @@ export const AudioBreakdownDrawer = () => {
<View style={styles.sectionDescription}>
<Text style={styles.description} weight='bold'>
{messages.linkedWalletsDescription}
<IconInfo
style={styles.infoIcon}
height={spacing(3)}
width={spacing(3)}
/>
</Text>
</View>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ const useSyles = makeStyles(({ palette, spacing }) => ({
fontSize: 14
},
copyIcon: {
lineHeight: 16,
marginBottom: 2,
color: palette.neutralLight4,
marginLeft: 10
}
}))
Expand Down Expand Up @@ -77,7 +74,7 @@ export const Wallet = (props: WalletProps) => {
<Text style={styles.walletAddress} weight='demiBold'>
{displayAddress(address)}
</Text>
<IconCopy style={styles.copyIcon} height={16} width={16} />
<IconCopy style={styles.copyIcon} size='s' color='subdued' />
</View>
</TouchableWithoutFeedback>
</Animated.View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -55,20 +57,17 @@ export const AppDetailsPage = (props: AppDetailsPageProps) => {
return (
<div className={styles.root}>
{!apiSecret ? null : (
<div className={styles.secretNotice}>
<span className={styles.noticeTextRoot}>
<IconWarning className={styles.noticeIcon} />
<p className={styles.noticeText}>{messages.secretReminder}</p>
</span>
<a
target='_blank'
href={AUDIUS_SDK_LINK}
className={styles.readTheDocs}
rel='noreferrer'
>
{messages.readTheDocs}
</a>
</div>
<Hint
icon={IconError}
actions={
// TODO: use variant='visible' when migrated to harmony
<ExternalLink to={AUDIUS_SDK_LINK} className={styles.readTheDocs}>
{messages.readTheDocs}
</ExternalLink>
}
>
{messages.secretReminder}
</Hint>
)}
<h4 className={styles.appName}>{name}</h4>
{!description ? null : (
Expand All @@ -88,7 +87,7 @@ export const AppDetailsPage = (props: AppDetailsPageProps) => {
onClick={copyApiKey}
aria-label={messages.copyApiKeyLabel}
color='subdued'
icon={IconCopyPlain}
icon={IconCopy}
/>
</Toast>
</span>
Expand All @@ -105,7 +104,7 @@ export const AppDetailsPage = (props: AppDetailsPageProps) => {
onClick={copySecret}
aria-label={messages.copyApiKeyLabel}
color='subdued'
icon={IconCopyPlain}
icon={IconCopy}
/>
</Toast>
</span>
Expand Down

0 comments on commit 23072cd

Please sign in to comment.