From 2b40a50d097874d6cd8e0ab65f39af8cebbd6693 Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:26:35 +0100 Subject: [PATCH 1/5] migrate BlockingView and associated components to ts --- .../{BlockingView.js => BlockingView.tsx} | 71 +++++++------ ...tFoundView.js => FullPageNotFoundView.tsx} | 48 +++++---- .../FullPageOfflineBlockingView.js | 38 ------- .../FullPageOfflineBlockingView.tsx | 31 ++++++ src/components/Text.tsx | 31 +++--- src/components/TextLink.js | 99 ------------------- src/components/TextLink.tsx | 77 +++++++++++++++ 7 files changed, 182 insertions(+), 213 deletions(-) rename src/components/BlockingViews/{BlockingView.js => BlockingView.tsx} (59%) rename src/components/BlockingViews/{FullPageNotFoundView.js => FullPageNotFoundView.tsx} (69%) delete mode 100644 src/components/BlockingViews/FullPageOfflineBlockingView.js create mode 100644 src/components/BlockingViews/FullPageOfflineBlockingView.tsx delete mode 100644 src/components/TextLink.js create mode 100644 src/components/TextLink.tsx diff --git a/src/components/BlockingViews/BlockingView.js b/src/components/BlockingViews/BlockingView.tsx similarity index 59% rename from src/components/BlockingViews/BlockingView.js rename to src/components/BlockingViews/BlockingView.tsx index aec414cdeb74..ede40cfda752 100644 --- a/src/components/BlockingViews/BlockingView.js +++ b/src/components/BlockingViews/BlockingView.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {View} from 'react-native'; +import {SvgProps} from 'react-native-svg'; import AutoEmailLink from '@components/AutoEmailLink'; import Icon from '@components/Icon'; import Text from '@components/Text'; @@ -10,51 +10,52 @@ import Navigation from '@libs/Navigation/Navigation'; import useTheme from '@styles/themes/useTheme'; import useThemeStyles from '@styles/useThemeStyles'; import variables from '@styles/variables'; +import {TranslationPaths} from '@src/languages/types'; -const propTypes = { +type BlockingViewProps = { /** Expensicon for the page */ - icon: PropTypes.func.isRequired, + icon: React.FC; /** Color for the icon (should be from theme) */ - iconColor: PropTypes.string, + iconColor?: string; /** Title message below the icon */ - title: PropTypes.string.isRequired, + title: string; /** Subtitle message below the title */ - subtitle: PropTypes.string, + subtitle?: string; /** Link message below the subtitle */ - linkKey: PropTypes.string, + linkKey?: TranslationPaths; /** Whether we should show a link to navigate elsewhere */ - shouldShowLink: PropTypes.bool, + shouldShowLink?: boolean; /** The custom icon width */ - iconWidth: PropTypes.number, + iconWidth?: number; /** The custom icon height */ - iconHeight: PropTypes.number, + iconHeight?: number; /** Function to call when pressing the navigation link */ - onLinkPress: PropTypes.func, + onLinkPress?: () => void; /** Whether we should embed the link with subtitle */ - shouldEmbedLinkWithSubtitle: PropTypes.bool, + shouldEmbedLinkWithSubtitle?: boolean; }; -const defaultProps = { - iconColor: undefined, - subtitle: '', - shouldShowLink: false, - linkKey: 'notFound.goBackHome', - iconWidth: variables.iconSizeSuperLarge, - iconHeight: variables.iconSizeSuperLarge, - onLinkPress: () => Navigation.dismissModal(), - shouldEmbedLinkWithSubtitle: false, -}; - -function BlockingView(props) { +function BlockingView({ + icon, + iconColor, + title, + subtitle = '', + linkKey = 'notFound.goBackHome', + shouldShowLink = false, + iconWidth = variables.iconSizeSuperLarge, + iconHeight = variables.iconSizeSuperLarge, + onLinkPress = () => Navigation.dismissModal, + shouldEmbedLinkWithSubtitle, +}: BlockingViewProps) { const theme = useTheme(); const styles = useThemeStyles(); const {translate} = useLocalize(); @@ -63,14 +64,14 @@ function BlockingView(props) { <> - {props.shouldShowLink ? ( + {shouldShowLink ? ( - {translate(props.linkKey)} + {translate(linkKey)} ) : null} @@ -80,14 +81,14 @@ function BlockingView(props) { return ( - {props.title} + {title} - {props.shouldEmbedLinkWithSubtitle ? ( + {shouldEmbedLinkWithSubtitle ? ( {renderContent()} ) : ( {renderContent()} @@ -96,8 +97,6 @@ function BlockingView(props) { ); } -BlockingView.propTypes = propTypes; -BlockingView.defaultProps = defaultProps; BlockingView.displayName = 'BlockingView'; export default BlockingView; diff --git a/src/components/BlockingViews/FullPageNotFoundView.js b/src/components/BlockingViews/FullPageNotFoundView.tsx similarity index 69% rename from src/components/BlockingViews/FullPageNotFoundView.js rename to src/components/BlockingViews/FullPageNotFoundView.tsx index b82474aa0694..3893c83dc45a 100644 --- a/src/components/BlockingViews/FullPageNotFoundView.js +++ b/src/components/BlockingViews/FullPageNotFoundView.tsx @@ -1,4 +1,3 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {View} from 'react-native'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; @@ -7,52 +6,51 @@ import useLocalize from '@hooks/useLocalize'; import Navigation from '@libs/Navigation/Navigation'; import useThemeStyles from '@styles/useThemeStyles'; import variables from '@styles/variables'; +import {TranslationPaths} from '@src/languages/types'; import ROUTES from '@src/ROUTES'; import BlockingView from './BlockingView'; -const propTypes = { +type FullPageNotFoundViewProps = { /** Child elements */ - children: PropTypes.node, + children?: React.ReactNode; /** If true, child components are replaced with a blocking "not found" view */ - shouldShow: PropTypes.bool, + shouldShow?: boolean; /** The key in the translations file to use for the title */ - titleKey: PropTypes.string, + titleKey?: TranslationPaths; /** The key in the translations file to use for the subtitle */ - subtitleKey: PropTypes.string, + subtitleKey?: TranslationPaths; /** Whether we should show a link to navigate elsewhere */ - shouldShowLink: PropTypes.bool, + shouldShowLink?: boolean; /** Whether we should show the back button on the header */ - shouldShowBackButton: PropTypes.bool, + shouldShowBackButton?: boolean; /** The key in the translations file to use for the go back link */ - linkKey: PropTypes.string, + linkKey?: TranslationPaths; /** Method to trigger when pressing the back button of the header */ - onBackButtonPress: PropTypes.func, + onBackButtonPress: () => void; /** Function to call when pressing the navigation link */ - onLinkPress: PropTypes.func, -}; - -const defaultProps = { - children: null, - shouldShow: false, - titleKey: 'notFound.notHere', - subtitleKey: 'notFound.pageNotFound', - linkKey: 'notFound.goBackHome', - onBackButtonPress: () => Navigation.goBack(ROUTES.HOME), - shouldShowLink: true, - shouldShowBackButton: true, - onLinkPress: () => Navigation.dismissModal(), + onLinkPress: () => void; }; // eslint-disable-next-line rulesdir/no-negated-variables -function FullPageNotFoundView({children, shouldShow, titleKey, subtitleKey, linkKey, onBackButtonPress, shouldShowLink, shouldShowBackButton, onLinkPress}) { +function FullPageNotFoundView({ + children = null, + shouldShow = false, + titleKey = 'notFound.notHere', + subtitleKey = 'notFound.pageNotFound', + linkKey = 'notFound.goBackHome', + onBackButtonPress = () => Navigation.goBack(ROUTES.HOME), + shouldShowLink = true, + shouldShowBackButton = true, + onLinkPress = () => Navigation.dismissModal, +}: FullPageNotFoundViewProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); if (shouldShow) { @@ -81,8 +79,6 @@ function FullPageNotFoundView({children, shouldShow, titleKey, subtitleKey, link return children; } -FullPageNotFoundView.propTypes = propTypes; -FullPageNotFoundView.defaultProps = defaultProps; FullPageNotFoundView.displayName = 'FullPageNotFoundView'; export default FullPageNotFoundView; diff --git a/src/components/BlockingViews/FullPageOfflineBlockingView.js b/src/components/BlockingViews/FullPageOfflineBlockingView.js deleted file mode 100644 index 5a876ecb8b1c..000000000000 --- a/src/components/BlockingViews/FullPageOfflineBlockingView.js +++ /dev/null @@ -1,38 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import * as Expensicons from '@components/Icon/Expensicons'; -import networkPropTypes from '@components/networkPropTypes'; -import {withNetwork} from '@components/OnyxProvider'; -import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; -import compose from '@libs/compose'; -import BlockingView from './BlockingView'; - -const propTypes = { - /** Child elements */ - children: PropTypes.node.isRequired, - - /** Props to fetch translation features */ - ...withLocalizePropTypes, - - /** Props to detect online status */ - network: networkPropTypes.isRequired, -}; - -function FullPageOfflineBlockingView(props) { - if (props.network.isOffline) { - return ( - - ); - } - - return props.children; -} - -FullPageOfflineBlockingView.propTypes = propTypes; -FullPageOfflineBlockingView.displayName = 'FullPageOfflineBlockingView'; - -export default compose(withLocalize, withNetwork())(FullPageOfflineBlockingView); diff --git a/src/components/BlockingViews/FullPageOfflineBlockingView.tsx b/src/components/BlockingViews/FullPageOfflineBlockingView.tsx new file mode 100644 index 000000000000..c8f5592287f3 --- /dev/null +++ b/src/components/BlockingViews/FullPageOfflineBlockingView.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +import * as Expensicons from '@components/Icon/Expensicons'; +import useLocalize from '@hooks/useLocalize'; +import useNetwork from '@hooks/useNetwork'; +import BlockingView from './BlockingView'; + +type FullPageOfflineBlockingViewProps = { + /** Child elements */ + children: React.ReactNode; +}; + +function FullPageOfflineBlockingView({children}: FullPageOfflineBlockingViewProps) { + const {translate} = useLocalize(); + const {isOffline} = useNetwork(); + + if (isOffline) { + return ( + + ); + } + + return children; +} + +FullPageOfflineBlockingView.displayName = 'FullPageOfflineBlockingView'; + +export default FullPageOfflineBlockingView; diff --git a/src/components/Text.tsx b/src/components/Text.tsx index 58a5cf300699..a289e224fb72 100644 --- a/src/components/Text.tsx +++ b/src/components/Text.tsx @@ -1,28 +1,29 @@ import React, {ForwardedRef} from 'react'; -// eslint-disable-next-line no-restricted-imports import {Text as RNText, TextProps as RNTextProps, StyleSheet} from 'react-native'; import type {TextStyle} from 'react-native'; import fontFamily from '@styles/fontFamily'; import useTheme from '@styles/themes/useTheme'; import variables from '@styles/variables'; +import ChildrenProps from '@src/types/utils/ChildrenProps'; -type TextProps = RNTextProps & { - /** The color of the text */ - color?: string; +type TextProps = RNTextProps & + ChildrenProps & { + /** The color of the text */ + color?: string; - /** The size of the text */ - fontSize?: number; - /** The alignment of the text */ - textAlign?: 'left' | 'right' | 'auto' | 'center' | 'justify'; - /** Any children to display */ - children: React.ReactNode; + /** The size of the text */ + fontSize?: number; - /** The family of the font to use */ - family?: keyof typeof fontFamily; -}; + /** The alignment of the text */ + textAlign?: TextStyle['textAlign']; -function Text({color, fontSize = variables.fontSizeNormal, textAlign = 'left', children = null, family = 'EXP_NEUE', style = {}, ...props}: TextProps, ref: ForwardedRef) { + /** The family of the font to use */ + family?: keyof typeof fontFamily; + }; + +function Text({color, fontSize = variables.fontSizeNormal, textAlign = 'left', children, family = 'EXP_NEUE', style = {}, ...props}: TextProps, ref: ForwardedRef) { const theme = useTheme(); + const componentStyle: TextStyle = { color: color ?? theme.text, fontSize, @@ -34,6 +35,7 @@ function Text({color, fontSize = variables.fontSizeNormal, textAlign = 'left', c if (!componentStyle.lineHeight && componentStyle.fontSize === variables.fontSizeNormal) { componentStyle.lineHeight = variables.fontSizeNormalHeight; } + return ( event.preventDefault(), -}; - -function TextLink(props) { - const styles = useThemeStyles(); - const rest = _.omit(props, _.keys(propTypes)); - const additionalStyles = _.isArray(props.style) ? props.style : [props.style]; - - /** - * @param {Event} event - */ - const openLink = (event) => { - event.preventDefault(); - if (props.onPress) { - props.onPress(); - return; - } - - Link.openExternalLink(props.href); - }; - - /** - * @param {Event} event - */ - const openLinkIfEnterKeyPressed = (event) => { - if (event.key !== 'Enter') { - return; - } - openLink(event); - }; - - return ( - - {props.children} - - ); -} - -TextLink.defaultProps = defaultProps; -TextLink.propTypes = propTypes; -TextLink.displayName = 'TextLink'; - -const TextLinkWithRef = React.forwardRef((props, ref) => ( - -)); - -TextLinkWithRef.displayName = 'TextLinkWithRef'; - -export default TextLinkWithRef; diff --git a/src/components/TextLink.tsx b/src/components/TextLink.tsx new file mode 100644 index 000000000000..fae4a71eeafa --- /dev/null +++ b/src/components/TextLink.tsx @@ -0,0 +1,77 @@ +import React, {ForwardedRef, forwardRef, KeyboardEventHandler, MouseEventHandler} from 'react'; +import {GestureResponderEvent, Text as RNText, StyleProp, TextStyle} from 'react-native'; +import useThemeStyles from '@styles/useThemeStyles'; +import * as Link from '@userActions/Link'; +import CONST from '@src/CONST'; +import Text, {TextProps} from './Text'; + +type LinkProps = { + /** Link to open in new tab */ + href: string; + + onPress?: undefined; +}; + +type PressProps = { + href?: undefined; + + /** Overwrites the default link behavior with a custom callback */ + onPress: () => void; +}; + +type TextLinkProps = (LinkProps | PressProps) & + TextProps & { + /** Additional style props */ + style?: StyleProp; + + /** Callback that is called when mousedown is triggered */ + onMouseDown?: MouseEventHandler; + }; + +function TextLink({href, onPress, children, style, onMouseDown = (event) => event.preventDefault(), ...rest}: TextLinkProps, ref: ForwardedRef) { + const styles = useThemeStyles(); + + const openLink = () => { + if (onPress) { + onPress(); + } else { + Link.openExternalLink(href); + } + }; + + const openLinkOnTap = (event: GestureResponderEvent) => { + event.preventDefault(); + + openLink(); + }; + + const openLinkOnEnterKey: KeyboardEventHandler = (event) => { + if (event.key !== 'Enter') { + return; + } + event.preventDefault(); + + openLink(); + }; + + return ( + + {children} + + ); +} + +TextLink.displayName = 'TextLink'; + +export default forwardRef(TextLink); From 618b9492c7ee0d351e3c582ff7e8320c50e98bf7 Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:21:58 +0100 Subject: [PATCH 2/5] fix review suggestions --- src/components/BlockingViews/FullPageNotFoundView.tsx | 1 + .../BlockingViews/FullPageOfflineBlockingView.tsx | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/BlockingViews/FullPageNotFoundView.tsx b/src/components/BlockingViews/FullPageNotFoundView.tsx index 3893c83dc45a..31cc63ef01da 100644 --- a/src/components/BlockingViews/FullPageNotFoundView.tsx +++ b/src/components/BlockingViews/FullPageNotFoundView.tsx @@ -53,6 +53,7 @@ function FullPageNotFoundView({ }: FullPageNotFoundViewProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); + if (shouldShow) { return ( <> diff --git a/src/components/BlockingViews/FullPageOfflineBlockingView.tsx b/src/components/BlockingViews/FullPageOfflineBlockingView.tsx index c8f5592287f3..5f6cd31227fe 100644 --- a/src/components/BlockingViews/FullPageOfflineBlockingView.tsx +++ b/src/components/BlockingViews/FullPageOfflineBlockingView.tsx @@ -2,14 +2,10 @@ import React from 'react'; import * as Expensicons from '@components/Icon/Expensicons'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; +import ChildrenProps from '@src/types/utils/ChildrenProps'; import BlockingView from './BlockingView'; -type FullPageOfflineBlockingViewProps = { - /** Child elements */ - children: React.ReactNode; -}; - -function FullPageOfflineBlockingView({children}: FullPageOfflineBlockingViewProps) { +function FullPageOfflineBlockingView({children}: ChildrenProps) { const {translate} = useLocalize(); const {isOffline} = useNetwork(); From 0fe0448b794120d495402aa09c5d1ef9170bf6f9 Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:55:56 +0100 Subject: [PATCH 3/5] remove files from another PR --- src/components/Text.tsx | 31 ++++++------ src/components/TextLink.js | 99 +++++++++++++++++++++++++++++++++++++ src/components/TextLink.tsx | 77 ----------------------------- 3 files changed, 113 insertions(+), 94 deletions(-) create mode 100644 src/components/TextLink.js delete mode 100644 src/components/TextLink.tsx diff --git a/src/components/Text.tsx b/src/components/Text.tsx index a289e224fb72..58a5cf300699 100644 --- a/src/components/Text.tsx +++ b/src/components/Text.tsx @@ -1,29 +1,28 @@ import React, {ForwardedRef} from 'react'; +// eslint-disable-next-line no-restricted-imports import {Text as RNText, TextProps as RNTextProps, StyleSheet} from 'react-native'; import type {TextStyle} from 'react-native'; import fontFamily from '@styles/fontFamily'; import useTheme from '@styles/themes/useTheme'; import variables from '@styles/variables'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; -type TextProps = RNTextProps & - ChildrenProps & { - /** The color of the text */ - color?: string; +type TextProps = RNTextProps & { + /** The color of the text */ + color?: string; - /** The size of the text */ - fontSize?: number; + /** The size of the text */ + fontSize?: number; + /** The alignment of the text */ + textAlign?: 'left' | 'right' | 'auto' | 'center' | 'justify'; + /** Any children to display */ + children: React.ReactNode; - /** The alignment of the text */ - textAlign?: TextStyle['textAlign']; + /** The family of the font to use */ + family?: keyof typeof fontFamily; +}; - /** The family of the font to use */ - family?: keyof typeof fontFamily; - }; - -function Text({color, fontSize = variables.fontSizeNormal, textAlign = 'left', children, family = 'EXP_NEUE', style = {}, ...props}: TextProps, ref: ForwardedRef) { +function Text({color, fontSize = variables.fontSizeNormal, textAlign = 'left', children = null, family = 'EXP_NEUE', style = {}, ...props}: TextProps, ref: ForwardedRef) { const theme = useTheme(); - const componentStyle: TextStyle = { color: color ?? theme.text, fontSize, @@ -35,7 +34,6 @@ function Text({color, fontSize = variables.fontSizeNormal, textAlign = 'left', c if (!componentStyle.lineHeight && componentStyle.fontSize === variables.fontSizeNormal) { componentStyle.lineHeight = variables.fontSizeNormalHeight; } - return ( event.preventDefault(), +}; + +function TextLink(props) { + const styles = useThemeStyles(); + const rest = _.omit(props, _.keys(propTypes)); + const additionalStyles = _.isArray(props.style) ? props.style : [props.style]; + + /** + * @param {Event} event + */ + const openLink = (event) => { + event.preventDefault(); + if (props.onPress) { + props.onPress(); + return; + } + + Link.openExternalLink(props.href); + }; + + /** + * @param {Event} event + */ + const openLinkIfEnterKeyPressed = (event) => { + if (event.key !== 'Enter') { + return; + } + openLink(event); + }; + + return ( + + {props.children} + + ); +} + +TextLink.defaultProps = defaultProps; +TextLink.propTypes = propTypes; +TextLink.displayName = 'TextLink'; + +const TextLinkWithRef = React.forwardRef((props, ref) => ( + +)); + +TextLinkWithRef.displayName = 'TextLinkWithRef'; + +export default TextLinkWithRef; diff --git a/src/components/TextLink.tsx b/src/components/TextLink.tsx deleted file mode 100644 index fae4a71eeafa..000000000000 --- a/src/components/TextLink.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import React, {ForwardedRef, forwardRef, KeyboardEventHandler, MouseEventHandler} from 'react'; -import {GestureResponderEvent, Text as RNText, StyleProp, TextStyle} from 'react-native'; -import useThemeStyles from '@styles/useThemeStyles'; -import * as Link from '@userActions/Link'; -import CONST from '@src/CONST'; -import Text, {TextProps} from './Text'; - -type LinkProps = { - /** Link to open in new tab */ - href: string; - - onPress?: undefined; -}; - -type PressProps = { - href?: undefined; - - /** Overwrites the default link behavior with a custom callback */ - onPress: () => void; -}; - -type TextLinkProps = (LinkProps | PressProps) & - TextProps & { - /** Additional style props */ - style?: StyleProp; - - /** Callback that is called when mousedown is triggered */ - onMouseDown?: MouseEventHandler; - }; - -function TextLink({href, onPress, children, style, onMouseDown = (event) => event.preventDefault(), ...rest}: TextLinkProps, ref: ForwardedRef) { - const styles = useThemeStyles(); - - const openLink = () => { - if (onPress) { - onPress(); - } else { - Link.openExternalLink(href); - } - }; - - const openLinkOnTap = (event: GestureResponderEvent) => { - event.preventDefault(); - - openLink(); - }; - - const openLinkOnEnterKey: KeyboardEventHandler = (event) => { - if (event.key !== 'Enter') { - return; - } - event.preventDefault(); - - openLink(); - }; - - return ( - - {children} - - ); -} - -TextLink.displayName = 'TextLink'; - -export default forwardRef(TextLink); From 53ce40255edc8cb021c759735b2bb010a9d23c2d Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:54:50 +0100 Subject: [PATCH 4/5] add review suggested changes --- src/components/BlockingViews/BlockingView.tsx | 4 ++-- src/components/BlockingViews/FullPageNotFoundView.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/BlockingViews/BlockingView.tsx b/src/components/BlockingViews/BlockingView.tsx index ede40cfda752..e48f2a6917c0 100644 --- a/src/components/BlockingViews/BlockingView.tsx +++ b/src/components/BlockingViews/BlockingView.tsx @@ -53,8 +53,8 @@ function BlockingView({ shouldShowLink = false, iconWidth = variables.iconSizeSuperLarge, iconHeight = variables.iconSizeSuperLarge, - onLinkPress = () => Navigation.dismissModal, - shouldEmbedLinkWithSubtitle, + onLinkPress = () => Navigation.dismissModal(), + shouldEmbedLinkWithSubtitle = false, }: BlockingViewProps) { const theme = useTheme(); const styles = useThemeStyles(); diff --git a/src/components/BlockingViews/FullPageNotFoundView.tsx b/src/components/BlockingViews/FullPageNotFoundView.tsx index 31cc63ef01da..733662251515 100644 --- a/src/components/BlockingViews/FullPageNotFoundView.tsx +++ b/src/components/BlockingViews/FullPageNotFoundView.tsx @@ -49,7 +49,7 @@ function FullPageNotFoundView({ onBackButtonPress = () => Navigation.goBack(ROUTES.HOME), shouldShowLink = true, shouldShowBackButton = true, - onLinkPress = () => Navigation.dismissModal, + onLinkPress = () => Navigation.dismissModal(), }: FullPageNotFoundViewProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); From ad34368eb478fc5b9030ce0f2103684b32cdd583 Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Thu, 28 Dec 2023 08:20:57 +0100 Subject: [PATCH 5/5] fix typescript errors --- src/components/BlockingViews/BlockingView.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/BlockingViews/BlockingView.tsx b/src/components/BlockingViews/BlockingView.tsx index 20a065f1a76c..3a038c58d886 100644 --- a/src/components/BlockingViews/BlockingView.tsx +++ b/src/components/BlockingViews/BlockingView.tsx @@ -1,9 +1,8 @@ import React from 'react'; -import {View} from 'react-native'; +import {ImageSourcePropType, View} from 'react-native'; import {SvgProps} from 'react-native-svg'; import AutoEmailLink from '@components/AutoEmailLink'; import Icon from '@components/Icon'; -import sourcePropTypes from '@components/Image/sourcePropTypes'; import Text from '@components/Text'; import TextLink from '@components/TextLink'; import useLocalize from '@hooks/useLocalize'; @@ -14,7 +13,7 @@ import {TranslationPaths} from '@src/languages/types'; type BlockingViewProps = { /** Expensicon for the page */ - icon: React.FC; + icon: React.FC | ImageSourcePropType; /** Color for the icon (should be from theme) */ iconColor?: string;