Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10313-MoreIconConversionsAgain #10315

Merged
merged 6 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,8 @@ import { View, ViewStyle } from 'react-native'

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

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

import { useDownloadFileAttachment, useMessage } from 'api/secureMessaging'
import { SecureMessagingAttachment, SecureMessagingMessageAttributes } from 'api/types'
import {
Expand All @@ -15,7 +17,6 @@ import {
LabelTagTypeConstants,
LoadingComponent,
TextView,
VAIcon,
} from 'components'
import { NAMESPACE } from 'constants/namespaces'
import { bytesToFinalSizeDisplay, bytesToFinalSizeDisplayA11y } from 'utils/common'
Expand Down Expand Up @@ -164,7 +165,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
Loading