Skip to content

Commit

Permalink
10313-MoreIconConversionsAgain (#10315)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparowhawk authored Dec 12, 2024
1 parent bc3e64d commit 608bef9
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 49 deletions.
5 changes: 3 additions & 2 deletions VAMobile/src/components/AttachmentLink.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React, { FC } from 'react'
import { AccessibilityProps, Pressable, PressableProps } from 'react-native'

import { Icon } from '@department-of-veterans-affairs/mobile-component-library'

import { a11yHintProp } from 'utils/accessibility'
import { useTheme } from 'utils/hooks'
import { featureEnabled } from 'utils/remoteConfig'

import Box from './Box'
import LinkWithAnalytics from './LinkWithAnalytics'
import TextView from './TextView'
import VAIcon from './VAIcon'

export type AttachmentLinkProps = {
/** Name of link/attachment */
Expand Down Expand Up @@ -57,7 +58,7 @@ const AttachmentLink: FC<AttachmentLinkProps> = ({
<Pressable {...a11yProps} {...pressableProps}>
<Box flexDirection={'row'} mr={theme.dimensions.gutter}>
<Box mt={theme.dimensions.attachmentIconTopMargin} mr={theme.dimensions.textIconMargin}>
<VAIcon name="PaperClip" width={16} height={16} fill={'link'} />
<Icon name="AttachFile" width={20} height={20} fill={theme.colors.icon.link} />
</Box>
<TextView mr={theme.dimensions.textIconMargin} variant={'MobileBodyLink'}>
{text}
Expand Down
30 changes: 14 additions & 16 deletions VAMobile/src/components/FormWrapper/FormFields/FormAttachments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React, { FC, ReactNode } from 'react'
import { useTranslation } from 'react-i18next'
import { ImagePickerResponse } from 'react-native-image-picker/src/types'

import { Button, ButtonVariants } from '@department-of-veterans-affairs/mobile-component-library'
import { Button, ButtonVariants, Icon } from '@department-of-veterans-affairs/mobile-component-library'
import _ from 'underscore'

import { Box, TextView, VAIcon } from 'components/index'
import { Box, TextView } from 'components/index'
import { NAMESPACE } from 'constants/namespaces'
import { DocumentPickerResponse } from 'screens/BenefitsScreen/BenefitsStackScreens'
import { getFileDisplay } from 'utils/common'
Expand Down Expand Up @@ -45,21 +45,19 @@ const FormAttachments: FC<FormAttachmentsProps> = ({
return (
<Box key={index}>
<Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
flexWrap="wrap"
mt={index !== 0 ? theme.dimensions.condensedMarginBetween : 0}>
<Box display="flex" flexDirection="row" alignItems="center" flexWrap="wrap" justifyContent="space-between">
<VAIcon name="PaperClip" width={16} height={16} fill="spinner" />
<TextView
variant="MobileBodyBold"
ml={theme.dimensions.textIconMargin}
accessibilityLabel={fileSizeA11y ? [fileName, fileSizeA11y].join(' ').trim() : undefined}>
{text}
</TextView>
flexDirection={'row'}
mr={theme.dimensions.gutter}
mt={index !== 0 ? theme.dimensions.condensedMarginBetween : 0}
mb={theme.dimensions.condensedMarginBetween}>
<Box mt={theme.dimensions.attachmentIconTopMargin} mr={theme.dimensions.textIconMargin}>
<Icon name="AttachFile" width={20} height={20} fill={theme.colors.icon.spinner} />
</Box>
<TextView
variant="MobileBodyBold"
ml={theme.dimensions.textIconMargin}
accessibilityLabel={fileSizeA11y ? [fileName, fileSizeA11y].join(' ').trim() : undefined}>
{text}
</TextView>
</Box>
<Button
onPress={() => removeOnPress?.(attachment)}
Expand Down
17 changes: 9 additions & 8 deletions VAMobile/src/components/LabelTag.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { FC } from 'react'
import { AccessibilityRole, Pressable, PressableProps, useWindowDimensions } from 'react-native'

import { Icon, IconProps } from '@department-of-veterans-affairs/mobile-component-library'

import { useTheme } from 'utils/hooks'

import Box, { BoxProps } from './Box'
import TextView from './TextView'
import VAIcon, { VAIconProps } from './VAIcon'

export const LabelTagTypeConstants: {
tagBlue: LabelTagTypes
Expand Down Expand Up @@ -104,20 +105,20 @@ const LabelTag: FC<LabelTagProps> = ({ text, labelType, onPress, a11yHint, a11yL
}
}

const infoIconProps: VAIconProps = {
const infoIconProps: IconProps = {
name: 'Info',
fill: 'tagInfoIcon',
fill2: 'transparent',
height: adjustSize ? 10 : 16,
width: adjustSize ? 10 : 16,
mr: adjustSize ? 5 : 10,
fill: theme.colors.icon.tagInfoIcon,
height: adjustSize ? 13 : 20,
width: adjustSize ? 13 : 20,
}

return (
<Pressable {...pressableProps}>
<Box {...wrapperProps}>
{textView}
<VAIcon {...infoIconProps} />
<Box mr={adjustSize ? 5 : 10}>
<Icon {...infoIconProps} />
</Box>
</Box>
</Pressable>
)
Expand Down
23 changes: 11 additions & 12 deletions VAMobile/src/components/LargeNavButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import ContentLoader, { Rect } from 'react-content-loader/native'
import { useTranslation } from 'react-i18next'
import { Platform, Pressable, PressableStateCallbackType, ViewStyle } from 'react-native'

import { Icon } from '@department-of-veterans-affairs/mobile-component-library'
import { colors } from '@department-of-veterans-affairs/mobile-tokens'

import { Box, TextView, VAIcon } from 'components'
import { Box, TextView } from 'components'
import { NAMESPACE } from 'constants/namespaces'
import { a11yHintProp } from 'utils/accessibility'
import { useTheme } from 'utils/hooks'
Expand Down Expand Up @@ -100,17 +101,15 @@ const LargeNavButton: FC<HomeNavButtonProps> = ({
<></>
)}
</Box>
<VAIcon
flexDirection="row"
alignItems="flex-end"
width={24}
height={24}
name="RightArrowInCircle"
fill={theme.colors.icon.largeNavButton}
fill2={'transparent'}
ml={theme.dimensions.listItemDecoratorMarginLeft}
preventScaling={true}
/>
<Box flexDirection="row" alignItems="flex-end">
<Icon
width={30}
height={30}
name="ArrowCircleRight"
fill={theme.colors.icon.largeNavButton}
preventScaling={true}
/>
</Box>
</Box>
</Pressable>
)
Expand Down
12 changes: 6 additions & 6 deletions VAMobile/src/components/PhotoPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next'
import { Image, Pressable, PressableProps } from 'react-native'
import { Asset } from 'react-native-image-picker/src/types'

import { Icon } from '@department-of-veterans-affairs/mobile-component-library'
import styled from 'styled-components'

import { NAMESPACE } from 'constants/namespaces'
Expand All @@ -12,7 +13,6 @@ import { themeFn } from 'utils/theme'

import Box, { BoxProps } from './Box'
import TextView, { TextViewProps } from './TextView'
import { VAIcon } from './index'

type PhotoPreviewProps = {
/** width of the photo */
Expand Down Expand Up @@ -119,21 +119,21 @@ const PhotoPreview: FC<PhotoPreviewProps> = ({ width, height, image, onDeleteCal
{selected && <Box {...blueOpacity} />}
<Box pt={photoPreviewIconPadding} pr={photoPreviewIconPadding} position="absolute" alignSelf="flex-end">
{selected && (
<VAIcon
name={'Minus'}
<Icon
name={'RemoveCircle'}
width={photoPreviewIconSize}
height={photoPreviewIconSize}
maxWidth={photoPreviewMaxIconSize}
fill={themeColor.icon.photoAdd}
/>
)}
{!selected && (
<VAIcon
name={'Remove'}
<Icon
name={'Cancel'}
width={photoPreviewIconSize}
height={photoPreviewIconSize}
maxWidth={photoPreviewMaxIconSize}
fill={themeColor.icon.deleteFill}
fill={themeColor.icon.error}
/>
)}
</Box>
Expand Down
4 changes: 2 additions & 2 deletions VAMobile/src/components/TextLineWithIcon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ context('TextLineWithIcon', () => {
beforeEach(() => {
const testLine1 = {
text: 'line1',
iconProps: { name: 'PaperClip', width: 16, height: 16, testID: 'PaperClip' } as VAIconProps,
iconProps: { name: 'Trash', width: 16, height: 16, testID: 'Trash' } as VAIconProps,
}
const testLine2 = {
text: 'another line2',
Expand All @@ -30,7 +30,7 @@ context('TextLineWithIcon', () => {
})

it('renders correct VAIcons', () => {
expect(screen.getByTestId('PaperClip')).toBeTruthy()
expect(screen.getByTestId('Trash')).toBeTruthy()
expect(screen.getByTestId('Unread')).toBeTruthy()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { View, ViewStyle } from 'react-native'

import { useIsFocused } from '@react-navigation/native'

import { Icon } from '@department-of-veterans-affairs/mobile-component-library'
import { useIsScreenReaderEnabled } from '@department-of-veterans-affairs/mobile-component-library'

import { useDownloadFileAttachment, useMessage } from 'api/secureMessaging'
Expand All @@ -17,7 +18,6 @@ import {
LabelTagTypeConstants,
LoadingComponent,
TextView,
VAIcon,
} from 'components'
import { NAMESPACE } from 'constants/namespaces'
import { bytesToFinalSizeDisplay, bytesToFinalSizeDisplayA11y } from 'utils/common'
Expand Down Expand Up @@ -166,7 +166,7 @@ function CollapsibleMessage({ message, isInitialMessage, collapsibleMessageRef }
<Box flexDirection={'row'} mr={theme.dimensions.textIconMargin}>
{attachmentBoolean && (
<Box mt={theme.dimensions.attachmentIconTopMargin} mr={theme.dimensions.textIconMargin}>
<VAIcon name={'PaperClip'} fill={'spinner'} width={16} height={16} />
<Icon name={'AttachFile'} fill={theme.colors.icon.spinner} width={20} height={20} />
</Box>
)}
{sentDate && sentDate.length > 1 ? (
Expand Down
2 changes: 1 addition & 1 deletion VAMobile/src/styles/themes/standardTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ let theme: VATheme = {
...colorScheme,
},
dimensions: {
attachmentIconTopMargin: 8,
attachmentIconTopMargin: 6,
borderWidth: 1,
focusedInputBorderWidth: 2,
buttonBorderWidth: 2,
Expand Down

0 comments on commit 608bef9

Please sign in to comment.