Skip to content

Commit

Permalink
[C-3877] Remove web icon component (#7674)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers authored Feb 22, 2024
1 parent 58c7e47 commit 40edef7
Show file tree
Hide file tree
Showing 39 changed files with 103 additions and 287 deletions.
10 changes: 1 addition & 9 deletions packages/harmony/src/components/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@ import type { ComponentType, SVGProps } from 'react'

import type { IconColors } from '../foundations/color/semantic'
import type { ShadowOptions } from '../foundations/shadows'

export const iconSizes = {
xs: 14,
s: 16,
m: 20,
l: 24,
xl: 30,
'2xl': 32
}
import { iconSizes } from '../foundations/spacing'

type IconSize = keyof typeof iconSizes

Expand Down
10 changes: 10 additions & 0 deletions packages/harmony/src/foundations/spacing/spacing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,15 @@ export const spacing = {
'5xl': 128
}

export const iconSizes = {
xs: 14,
s: 16,
m: 20,
l: 24,
xl: 30,
'2xl': 32,
'3xl': 40
}

export type Spacing = typeof spacing
export type SpacingOptions = keyof Spacing
11 changes: 1 addition & 10 deletions packages/harmony/src/foundations/theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@ import { colorTheme } from '../color'
import { CornerRadius, cornerRadius } from '../corner-radius'
import { Motion, motion, Spring, spring } from '../motion'
import { Shadows, shadows } from '../shadows'
import { Spacing, spacing } from '../spacing'
import { Spacing, spacing, iconSizes } from '../spacing'
import { typography } from '../typography'
import type { Typography } from '../typography'

import type { Theme } from './types'

const iconSizes = {
xs: 14,
s: 16,
m: 20,
l: 24,
xl: 30,
'2xl': 32
}

const commonFoundations = {
shadows,
typography,
Expand Down
1 change: 0 additions & 1 deletion packages/stems/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import './assets/styles/shadows.css'
import './assets/styles/transforms.css'
import './assets/styles/layers.css'

// export * from './components/Icons'
export * from './styles/colors'
export * from './styles/types'
export * from './utils/styles'
Expand Down
33 changes: 0 additions & 33 deletions packages/web/src/components/Icon/Icon.module.css

This file was deleted.

60 changes: 0 additions & 60 deletions packages/web/src/components/Icon/Icon.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/web/src/components/Icon/index.ts

This file was deleted.

7 changes: 3 additions & 4 deletions packages/web/src/components/data-entry/ContextualMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
} from 'formik'
import { useToggle } from 'react-use'

import { Icon } from 'components/Icon'
import { HelperText } from 'components/data-entry/HelperText'
import { Tile } from 'components/tile'
import { Text } from 'components/typography'
Expand Down Expand Up @@ -115,10 +114,10 @@ type SelectedValueProps = {
}

export const SelectedValue = (props: SelectedValueProps) => {
const { label, icon, children } = props
const { label, icon: Icon, children } = props
return (
<span className={styles.selectedValue}>
{icon ? <Icon icon={icon} size='small' /> : null}
{Icon ? <Icon size='s' color='default' /> : null}
{label ? <Text strength='strong'>{label}</Text> : null}
{children}
</span>
Expand Down Expand Up @@ -189,7 +188,7 @@ export const ContextualMenu = <FormValues extends FormikValues = FormikValues>(
<Text className={styles.title} variant='title' size='large'>
{label}
</Text>
<Icon icon={IconCaretRight} color='neutralLight4' />
<IconCaretRight color='subdued' size='s' />
</div>
<Text className={styles.description}>{description}</Text>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
IconInfo
} from '@audius/harmony'

import { Icon } from 'components/Icon'
import { Text } from 'components/typography'

import { HelpCallout } from '../help-callout/HelpCallout'
Expand Down Expand Up @@ -42,7 +41,7 @@ export const LeavingAudiusModal = () => {
size={'small'}
>
<ModalHeader>
<ModalTitle icon={<Icon icon={IconInfo} />} title={messages.title} />
<ModalTitle icon={<IconInfo />} title={messages.title} />
</ModalHeader>
<ModalContent className={styles.content}>
<Text>{messages.body}</Text>
Expand Down
5 changes: 2 additions & 3 deletions packages/web/src/components/nav/desktop/NavPopupMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import cn from 'classnames'
import { useDispatch } from 'react-redux'

import { make } from 'common/store/analytics/actions'
import { Icon } from 'components/Icon'
import { AudioBalancePill } from 'components/audio-balance-pill/AUDIOBalancePill'
import { NotificationDot } from 'components/notification-dot'
import { USDCBalancePill } from 'components/usdc-balance-pill/USDCBalancePill'
Expand Down Expand Up @@ -88,7 +87,7 @@ const NavPopupMenu = () => {
</div>
),
onClick: () => navigate(PAYMENTS_PAGE),
icon: <Icon icon={IconDonate} />,
icon: <IconDonate size='s' />,
iconClassName: styles.payAndEarnIcon
}
: null
Expand Down Expand Up @@ -156,7 +155,7 @@ const NavPopupMenu = () => {
ref={anchorRef}
onClick={() => triggerPopup()}
>
<Icon icon={IconKebabHorizontal} />
<IconKebabHorizontal size='s' />
</div>
{showNotificationBubble ? (
<NotificationDot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
border: none;
}

.title {
align-items: center;
display: flex;
gap: var(--unit-2);
justify-content: center;
letter-spacing: 0.5px;
}

.content {
padding: 0 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,17 @@ import {
ModalHeader,
ModalFooter,
Flex,
IconCart
IconCart,
ModalTitle
} from '@audius/harmony'
import cn from 'classnames'
import { Formik, useField, useFormikContext } from 'formik'
import { useDispatch, useSelector } from 'react-redux'
import { toFormikValidationSchema } from 'zod-formik-adapter'

import { useHistoryContext } from 'app/HistoryProvider'
import { Icon } from 'components/Icon'
import { ModalForm } from 'components/modal-form/ModalForm'
import { LockedTrackDetailsTile } from 'components/track/LockedTrackDetailsTile'
import { Text } from 'components/typography'
import { USDCManualTransfer } from 'components/usdc-manual-transfer/USDCManualTransfer'
import { useIsMobile } from 'hooks/useIsMobile'
import { useIsUSDCEnabled } from 'hooks/useIsUSDCEnabled'
Expand Down Expand Up @@ -128,16 +127,7 @@ const RenderForm = ({
onClose={onClose}
showDismissButton={!isMobile}
>
<Text
variant='label'
color='neutralLight2'
size='xLarge'
strength='strong'
className={styles.title}
>
<Icon size='large' icon={IconCart} />
{messages.completePurchase}
</Text>
<ModalTitle icon={<IconCart />} title={messages.completePurchase} />
</ModalHeader>
<ModalContentPages
contentClassName={styles.content}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import {
import { PurchaseMethod, PurchaseVendor } from '@audius/common/models'
import { IntKeys, FeatureFlags } from '@audius/common/services'
import { PurchaseContentStage } from '@audius/common/store'
import { Flex, IconCheck } from '@audius/harmony'
import { Flex, IconValidationCheck } from '@audius/harmony'
import { useField } from 'formik'

import { Icon } from 'components/Icon'
import { PaymentMethod } from 'components/payment-method/PaymentMethod'
import { Text } from 'components/typography'

Expand All @@ -25,7 +24,6 @@ import { usePurchaseSummaryValues } from '../hooks/usePurchaseSummaryValues'

import { PayExtraFormSection } from './PayExtraFormSection'
import { PayToUnlockInfo } from './PayToUnlockInfo'
import styles from './PurchaseContentFormFields.module.css'
import { PurchaseSummaryTable } from './PurchaseSummaryTable'

const messages = {
Expand Down Expand Up @@ -96,9 +94,7 @@ export const PurchaseContentFormFields = ({
if (isPurchased) {
return (
<Flex alignItems='center' justifyContent='center' gap='m' p='m'>
<div className={styles.completionCheck}>
<Icon icon={IconCheck} size='xxSmall' color='white' />
</div>
<IconValidationCheck size='m' />
<Text variant='heading' size='small'>
{messages.purchaseSuccessful}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { formatPrice } from '@audius/common/utils'
import { Button, IconCaretRight, IconError, PlainButton } from '@audius/harmony'

import { make } from 'common/store/analytics/actions'
import { Icon } from 'components/Icon'
import { TwitterShareButton } from 'components/twitter-share-button/TwitterShareButton'
import { Text } from 'components/typography'
import { fullTrackPage } from 'utils/route'
Expand All @@ -39,7 +38,7 @@ const ContentPurchaseError = ({
}) => {
return (
<Text className={styles.errorContainer} color='accentRed'>
<Icon icon={IconError} size='medium' />
<IconError size='m' color='danger' />
{usePurchaseContentErrorMessage(code)}
</Text>
)
Expand Down
Loading

0 comments on commit 40edef7

Please sign in to comment.