From 4732fb775043172bd11f87914b0e4dfab182ea46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Tue, 12 Dec 2023 09:27:11 +0000 Subject: [PATCH 1/6] Rename QRShare files to TS --- .../QRShareWithDownload/{index.native.js => index.native.tsx} | 0 .../QRShare/QRShareWithDownload/{index.js => index.tsx} | 0 ...{getQrCodeDownloadFileName.js => getQrCodeDownloadFileName.ts} | 0 src/components/QRShare/{index.js => index.tsx} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename src/components/QRShare/QRShareWithDownload/{index.native.js => index.native.tsx} (100%) rename src/components/QRShare/QRShareWithDownload/{index.js => index.tsx} (100%) rename src/components/QRShare/{getQrCodeDownloadFileName.js => getQrCodeDownloadFileName.ts} (100%) rename src/components/QRShare/{index.js => index.tsx} (100%) diff --git a/src/components/QRShare/QRShareWithDownload/index.native.js b/src/components/QRShare/QRShareWithDownload/index.native.tsx similarity index 100% rename from src/components/QRShare/QRShareWithDownload/index.native.js rename to src/components/QRShare/QRShareWithDownload/index.native.tsx diff --git a/src/components/QRShare/QRShareWithDownload/index.js b/src/components/QRShare/QRShareWithDownload/index.tsx similarity index 100% rename from src/components/QRShare/QRShareWithDownload/index.js rename to src/components/QRShare/QRShareWithDownload/index.tsx diff --git a/src/components/QRShare/getQrCodeDownloadFileName.js b/src/components/QRShare/getQrCodeDownloadFileName.ts similarity index 100% rename from src/components/QRShare/getQrCodeDownloadFileName.js rename to src/components/QRShare/getQrCodeDownloadFileName.ts diff --git a/src/components/QRShare/index.js b/src/components/QRShare/index.tsx similarity index 100% rename from src/components/QRShare/index.js rename to src/components/QRShare/index.tsx From 1de06fc1f2d7567cb06dd5e516ca39593ec19572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Tue, 19 Dec 2023 11:53:33 +0000 Subject: [PATCH 2/6] Migrate QRShare to TS --- src/components/QRCode.tsx | 16 +++---- .../QRShareWithDownload/index.native.tsx | 29 ++++--------- .../QRShare/QRShareWithDownload/index.tsx | 29 ++++--------- .../QRShare/QRShareWithDownload/types.ts | 5 +++ .../QRShare/getQrCodeDownloadFileName.ts | 2 +- src/components/QRShare/index.tsx | 32 +++++--------- src/components/QRShare/types.ts | 42 +++++++++++++++++++ 7 files changed, 85 insertions(+), 70 deletions(-) create mode 100644 src/components/QRShare/QRShareWithDownload/types.ts create mode 100644 src/components/QRShare/types.ts diff --git a/src/components/QRCode.tsx b/src/components/QRCode.tsx index 99a3a1f64118..19c4f3898267 100644 --- a/src/components/QRCode.tsx +++ b/src/components/QRCode.tsx @@ -1,12 +1,13 @@ -import React, {Ref} from 'react'; -import {ImageSourcePropType} from 'react-native'; +import React from 'react'; +import {ImageSourcePropType, NativeMethods} from 'react-native'; import QRCodeLibrary from 'react-native-qrcode-svg'; +import {Svg} from 'react-native-svg'; import useTheme from '@hooks/useTheme'; import CONST from '@src/CONST'; -type LogoRatio = typeof CONST.QR.DEFAULT_LOGO_SIZE_RATIO | typeof CONST.QR.EXPENSIFY_LOGO_SIZE_RATIO; +type QRCodeLogoRatio = typeof CONST.QR.DEFAULT_LOGO_SIZE_RATIO | typeof CONST.QR.EXPENSIFY_LOGO_SIZE_RATIO; -type LogoMarginRatio = typeof CONST.QR.DEFAULT_LOGO_MARGIN_RATIO | typeof CONST.QR.EXPENSIFY_LOGO_MARGIN_RATIO; +type QRCodeLogoMarginRatio = typeof CONST.QR.DEFAULT_LOGO_MARGIN_RATIO | typeof CONST.QR.EXPENSIFY_LOGO_MARGIN_RATIO; type QRCodeProps = { /** The QR code URL */ @@ -19,10 +20,10 @@ type QRCodeProps = { logo?: ImageSourcePropType; /** The size ratio of logo to QR code */ - logoRatio?: LogoRatio; + logoRatio?: QRCodeLogoRatio; /** The size ratio of margin around logo to QR code */ - logoMarginRatio?: LogoMarginRatio; + logoMarginRatio?: QRCodeLogoMarginRatio; /** The QRCode size */ size?: number; @@ -37,7 +38,7 @@ type QRCodeProps = { * Function to retrieve the internal component ref and be able to call it's * methods */ - getRef?: (ref: Ref) => Ref; + getRef?: (ref: Svg & NativeMethods) => Svg & NativeMethods; }; function QRCode({url, logo, getRef, size = 120, color, backgroundColor, logoRatio = CONST.QR.DEFAULT_LOGO_SIZE_RATIO, logoMarginRatio = CONST.QR.DEFAULT_LOGO_MARGIN_RATIO}: QRCodeProps) { @@ -61,3 +62,4 @@ function QRCode({url, logo, getRef, size = 120, color, backgroundColor, logoRati QRCode.displayName = 'QRCode'; export default QRCode; +export type {QRCodeLogoMarginRatio, QRCodeLogoRatio}; diff --git a/src/components/QRShare/QRShareWithDownload/index.native.tsx b/src/components/QRShare/QRShareWithDownload/index.native.tsx index e64c7b69df4a..91e473bba1fb 100644 --- a/src/components/QRShare/QRShareWithDownload/index.native.tsx +++ b/src/components/QRShare/QRShareWithDownload/index.native.tsx @@ -1,19 +1,20 @@ -import React, {forwardRef, useImperativeHandle, useRef} from 'react'; +import React, {ForwardedRef, forwardRef, useImperativeHandle, useRef} from 'react'; import ViewShot from 'react-native-view-shot'; import getQrCodeFileName from '@components/QRShare/getQrCodeDownloadFileName'; -import {qrShareDefaultProps, qrSharePropTypes} from '@components/QRShare/propTypes'; +import {QRShareProps} from '@components/QRShare/types'; import useNetwork from '@hooks/useNetwork'; import fileDownload from '@libs/fileDownload'; import QRShare from '..'; +import QRShareWithDownloadHandle from './types'; -function QRShareWithDownload({innerRef, ...props}) { +function QRShareWithDownload(props: QRShareProps, ref: ForwardedRef) { const {isOffline} = useNetwork(); - const qrCodeScreenshotRef = useRef(null); + const qrCodeScreenshotRef = useRef(null); useImperativeHandle( - innerRef, + ref, () => ({ - download: () => qrCodeScreenshotRef.current.capture().then((uri) => fileDownload(uri, getQrCodeFileName(props.title))), + download: () => qrCodeScreenshotRef.current?.capture?.().then((uri) => fileDownload(uri, getQrCodeFileName(props.title))), }), [props.title], ); @@ -23,24 +24,12 @@ function QRShareWithDownload({innerRef, ...props}) { ); } -QRShareWithDownload.propTypes = qrSharePropTypes; -QRShareWithDownload.defaultProps = qrShareDefaultProps; QRShareWithDownload.displayName = 'QRShareWithDownload'; -const QRShareWithDownloadWithRef = forwardRef((props, ref) => ( - -)); - -QRShareWithDownloadWithRef.displayName = 'QRShareWithDownloadWithRef'; - -export default QRShareWithDownloadWithRef; +export default forwardRef(QRShareWithDownload); diff --git a/src/components/QRShare/QRShareWithDownload/index.tsx b/src/components/QRShare/QRShareWithDownload/index.tsx index bf18a8eedaa4..beedf7ab0fb8 100644 --- a/src/components/QRShare/QRShareWithDownload/index.tsx +++ b/src/components/QRShare/QRShareWithDownload/index.tsx @@ -1,22 +1,23 @@ -import React, {forwardRef, useImperativeHandle, useRef} from 'react'; +import React, {ForwardedRef, forwardRef, useImperativeHandle, useRef} from 'react'; import getQrCodeFileName from '@components/QRShare/getQrCodeDownloadFileName'; -import {qrShareDefaultProps, qrSharePropTypes} from '@components/QRShare/propTypes'; +import {QRShareHandle, QRShareProps} from '@components/QRShare/types'; import useNetwork from '@hooks/useNetwork'; import fileDownload from '@libs/fileDownload'; import QRShare from '..'; +import QRShareWithDownloadHandle from './types'; -function QRShareWithDownload({innerRef, ...props}) { +function QRShareWithDownload(props: QRShareProps, ref: ForwardedRef) { const {isOffline} = useNetwork(); - const qrShareRef = useRef(null); + const qrShareRef = useRef(null); useImperativeHandle( - innerRef, + ref, () => ({ download: () => new Promise((resolve, reject) => { // eslint-disable-next-line es/no-optional-chaining const svg = qrShareRef.current?.getSvg(); - if (svg == null) { + if (!svg) { return reject(); } @@ -31,23 +32,11 @@ function QRShareWithDownload({innerRef, ...props}) { ref={qrShareRef} // eslint-disable-next-line react/jsx-props-no-spreading {...props} - logo={isOffline ? null : props.logo} + logo={isOffline ? undefined : props.logo} /> ); } -QRShareWithDownload.propTypes = qrSharePropTypes; -QRShareWithDownload.defaultProps = qrShareDefaultProps; QRShareWithDownload.displayName = 'QRShareWithDownload'; -const QRShareWithDownloadWithRef = forwardRef((props, ref) => ( - -)); - -QRShareWithDownloadWithRef.displayName = 'QRShareWithDownloadWithRef'; - -export default QRShareWithDownloadWithRef; +export default forwardRef(QRShareWithDownload); diff --git a/src/components/QRShare/QRShareWithDownload/types.ts b/src/components/QRShare/QRShareWithDownload/types.ts new file mode 100644 index 000000000000..c5df9cba55e2 --- /dev/null +++ b/src/components/QRShare/QRShareWithDownload/types.ts @@ -0,0 +1,5 @@ +type QRShareWithDownloadHandle = { + download: () => Promise | undefined; +}; + +export default QRShareWithDownloadHandle; diff --git a/src/components/QRShare/getQrCodeDownloadFileName.ts b/src/components/QRShare/getQrCodeDownloadFileName.ts index c1e73a1794fb..7041eac2b4b4 100644 --- a/src/components/QRShare/getQrCodeDownloadFileName.ts +++ b/src/components/QRShare/getQrCodeDownloadFileName.ts @@ -1,3 +1,3 @@ -const getQrCodeDownloadFileName = (title) => `${title}-ShareCode.png`; +const getQrCodeDownloadFileName = (title: string): string => `${title}-ShareCode.png`; export default getQrCodeDownloadFileName; diff --git a/src/components/QRShare/index.tsx b/src/components/QRShare/index.tsx index f644db844e53..0372b0a383c6 100644 --- a/src/components/QRShare/index.tsx +++ b/src/components/QRShare/index.tsx @@ -1,30 +1,30 @@ -import React, {forwardRef, useImperativeHandle, useRef, useState} from 'react'; -import {View} from 'react-native'; -import _ from 'underscore'; +import React, {ForwardedRef, forwardRef, useImperativeHandle, useRef, useState} from 'react'; +import {LayoutChangeEvent, NativeMethods, View} from 'react-native'; +import {Svg} from 'react-native-svg'; import ExpensifyWordmark from '@assets/images/expensify-wordmark.svg'; import QRCode from '@components/QRCode'; import Text from '@components/Text'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; -import {qrShareDefaultProps, qrSharePropTypes} from './propTypes'; +import {QRShareHandle, QRShareProps} from './types'; -function QRShare({innerRef, url, title, subtitle, logo, logoRatio, logoMarginRatio}) { +function QRShare({url, title, subtitle, logo, logoRatio, logoMarginRatio}: QRShareProps, ref: ForwardedRef) { const styles = useThemeStyles(); const theme = useTheme(); const [qrCodeSize, setQrCodeSize] = useState(1); - const svgRef = useRef(null); + const svgRef = useRef(); useImperativeHandle( - innerRef, + ref, () => ({ getSvg: () => svgRef.current, }), [], ); - const onLayout = (event) => { + const onLayout = (event: LayoutChangeEvent) => { const containerWidth = event.nativeEvent.layout.width - variables.qrShareHorizontalPadding * 2 || 0; setQrCodeSize(Math.max(1, containerWidth)); }; @@ -60,7 +60,7 @@ function QRShare({innerRef, url, title, subtitle, logo, logoRatio, logoMarginRat {title} - {!_.isEmpty(subtitle) && ( + {subtitle && ( ( - -)); - -QRShareWithRef.displayName = 'QRShareWithRef'; - -export default QRShareWithRef; +export default forwardRef(QRShare); diff --git a/src/components/QRShare/types.ts b/src/components/QRShare/types.ts new file mode 100644 index 000000000000..a1757f882619 --- /dev/null +++ b/src/components/QRShare/types.ts @@ -0,0 +1,42 @@ +import {ImageSourcePropType, NativeMethods} from 'react-native'; +import {Svg} from 'react-native-svg'; +import {QRCodeLogoMarginRatio, QRCodeLogoRatio} from '@components/QRCode'; + +type QRShareProps = { + /** + * The QR code URL + */ + url: string; + + /** + * The title that is displayed below the QR Code (usually the user or report name) + */ + title: string; + + /** + * The subtitle which will be shown below the title (usually user email or workspace name) + * */ + subtitle?: string; + + /** + * The logo which will be display in the middle of the QR code + */ + // logo: PropTypes.oneOfType([PropTypes.shape({uri: PropTypes.string}), PropTypes.number, PropTypes.string]), + logo?: ImageSourcePropType; + + /** + * The size ratio of logo to QR code + */ + logoRatio?: QRCodeLogoRatio; + + /** + * The size ratio of margin around logo to QR code + */ + logoMarginRatio?: QRCodeLogoMarginRatio; +}; + +type QRShareHandle = { + getSvg: () => (Svg & NativeMethods) | undefined; +}; + +export type {QRShareHandle, QRShareProps}; From 71c493ecd93482e8e9ecd001b20e90c51c726b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Wed, 20 Dec 2023 12:05:06 +0000 Subject: [PATCH 3/6] Simplify typings --- src/components/QRCode.tsx | 4 ++-- src/components/QRShare/index.tsx | 4 ++-- src/components/QRShare/types.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/QRCode.tsx b/src/components/QRCode.tsx index 19c4f3898267..d059da36e963 100644 --- a/src/components/QRCode.tsx +++ b/src/components/QRCode.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {ImageSourcePropType, NativeMethods} from 'react-native'; +import {ImageSourcePropType} from 'react-native'; import QRCodeLibrary from 'react-native-qrcode-svg'; import {Svg} from 'react-native-svg'; import useTheme from '@hooks/useTheme'; @@ -38,7 +38,7 @@ type QRCodeProps = { * Function to retrieve the internal component ref and be able to call it's * methods */ - getRef?: (ref: Svg & NativeMethods) => Svg & NativeMethods; + getRef?: (ref: Svg) => Svg; }; function QRCode({url, logo, getRef, size = 120, color, backgroundColor, logoRatio = CONST.QR.DEFAULT_LOGO_SIZE_RATIO, logoMarginRatio = CONST.QR.DEFAULT_LOGO_MARGIN_RATIO}: QRCodeProps) { diff --git a/src/components/QRShare/index.tsx b/src/components/QRShare/index.tsx index 0372b0a383c6..298ee7f23015 100644 --- a/src/components/QRShare/index.tsx +++ b/src/components/QRShare/index.tsx @@ -1,5 +1,5 @@ import React, {ForwardedRef, forwardRef, useImperativeHandle, useRef, useState} from 'react'; -import {LayoutChangeEvent, NativeMethods, View} from 'react-native'; +import {LayoutChangeEvent, View} from 'react-native'; import {Svg} from 'react-native-svg'; import ExpensifyWordmark from '@assets/images/expensify-wordmark.svg'; import QRCode from '@components/QRCode'; @@ -14,7 +14,7 @@ function QRShare({url, title, subtitle, logo, logoRatio, logoMarginRatio}: QRSha const theme = useTheme(); const [qrCodeSize, setQrCodeSize] = useState(1); - const svgRef = useRef(); + const svgRef = useRef(); useImperativeHandle( ref, diff --git a/src/components/QRShare/types.ts b/src/components/QRShare/types.ts index a1757f882619..753aab6ba966 100644 --- a/src/components/QRShare/types.ts +++ b/src/components/QRShare/types.ts @@ -1,4 +1,4 @@ -import {ImageSourcePropType, NativeMethods} from 'react-native'; +import {ImageSourcePropType} from 'react-native'; import {Svg} from 'react-native-svg'; import {QRCodeLogoMarginRatio, QRCodeLogoRatio} from '@components/QRCode'; @@ -36,7 +36,7 @@ type QRShareProps = { }; type QRShareHandle = { - getSvg: () => (Svg & NativeMethods) | undefined; + getSvg: () => Svg | undefined; }; export type {QRShareHandle, QRShareProps}; From 5ec10c8a5d0259bc496f67b82b2b0742e836a38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Wed, 20 Dec 2023 12:09:18 +0000 Subject: [PATCH 4/6] Remove comment --- src/components/QRShare/types.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/QRShare/types.ts b/src/components/QRShare/types.ts index 753aab6ba966..3b964296ca4c 100644 --- a/src/components/QRShare/types.ts +++ b/src/components/QRShare/types.ts @@ -21,7 +21,6 @@ type QRShareProps = { /** * The logo which will be display in the middle of the QR code */ - // logo: PropTypes.oneOfType([PropTypes.shape({uri: PropTypes.string}), PropTypes.number, PropTypes.string]), logo?: ImageSourcePropType; /** From 3ab46b8dfb31440137a9f47dadf79a1807270c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Wed, 20 Dec 2023 12:33:37 +0000 Subject: [PATCH 5/6] Minor fix to avoid console errors when subtitle is empty string --- src/components/QRShare/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/QRShare/index.tsx b/src/components/QRShare/index.tsx index 298ee7f23015..0f39c96c82be 100644 --- a/src/components/QRShare/index.tsx +++ b/src/components/QRShare/index.tsx @@ -60,7 +60,7 @@ function QRShare({url, title, subtitle, logo, logoRatio, logoMarginRatio}: QRSha {title} - {subtitle && ( + {!!subtitle && ( Date: Mon, 8 Jan 2024 09:36:35 +0000 Subject: [PATCH 6/6] Fix imports and remove propTypes file --- .../QRShareWithDownload/index.native.tsx | 7 +-- .../QRShare/QRShareWithDownload/index.tsx | 7 +-- src/components/QRShare/index.tsx | 10 +++-- src/components/QRShare/propTypes.js | 45 ------------------- src/components/QRShare/types.ts | 6 +-- 5 files changed, 17 insertions(+), 58 deletions(-) delete mode 100644 src/components/QRShare/propTypes.js diff --git a/src/components/QRShare/QRShareWithDownload/index.native.tsx b/src/components/QRShare/QRShareWithDownload/index.native.tsx index 91e473bba1fb..d1d9f13147f1 100644 --- a/src/components/QRShare/QRShareWithDownload/index.native.tsx +++ b/src/components/QRShare/QRShareWithDownload/index.native.tsx @@ -1,11 +1,12 @@ -import React, {ForwardedRef, forwardRef, useImperativeHandle, useRef} from 'react'; +import type {ForwardedRef} from 'react'; +import React, {forwardRef, useImperativeHandle, useRef} from 'react'; import ViewShot from 'react-native-view-shot'; import getQrCodeFileName from '@components/QRShare/getQrCodeDownloadFileName'; -import {QRShareProps} from '@components/QRShare/types'; +import type {QRShareProps} from '@components/QRShare/types'; import useNetwork from '@hooks/useNetwork'; import fileDownload from '@libs/fileDownload'; import QRShare from '..'; -import QRShareWithDownloadHandle from './types'; +import type QRShareWithDownloadHandle from './types'; function QRShareWithDownload(props: QRShareProps, ref: ForwardedRef) { const {isOffline} = useNetwork(); diff --git a/src/components/QRShare/QRShareWithDownload/index.tsx b/src/components/QRShare/QRShareWithDownload/index.tsx index beedf7ab0fb8..4a327e9c9249 100644 --- a/src/components/QRShare/QRShareWithDownload/index.tsx +++ b/src/components/QRShare/QRShareWithDownload/index.tsx @@ -1,10 +1,11 @@ -import React, {ForwardedRef, forwardRef, useImperativeHandle, useRef} from 'react'; +import type {ForwardedRef} from 'react'; +import React, {forwardRef, useImperativeHandle, useRef} from 'react'; import getQrCodeFileName from '@components/QRShare/getQrCodeDownloadFileName'; -import {QRShareHandle, QRShareProps} from '@components/QRShare/types'; +import type {QRShareHandle, QRShareProps} from '@components/QRShare/types'; import useNetwork from '@hooks/useNetwork'; import fileDownload from '@libs/fileDownload'; import QRShare from '..'; -import QRShareWithDownloadHandle from './types'; +import type QRShareWithDownloadHandle from './types'; function QRShareWithDownload(props: QRShareProps, ref: ForwardedRef) { const {isOffline} = useNetwork(); diff --git a/src/components/QRShare/index.tsx b/src/components/QRShare/index.tsx index de4afbd7e871..c7e9e7637a6c 100644 --- a/src/components/QRShare/index.tsx +++ b/src/components/QRShare/index.tsx @@ -1,6 +1,8 @@ -import React, {ForwardedRef, forwardRef, useImperativeHandle, useRef, useState} from 'react'; -import {LayoutChangeEvent, View} from 'react-native'; -import {Svg} from 'react-native-svg'; +import type {ForwardedRef} from 'react'; +import React, {forwardRef, useImperativeHandle, useRef, useState} from 'react'; +import type {LayoutChangeEvent} from 'react-native'; +import {View} from 'react-native'; +import type {Svg} from 'react-native-svg'; import ExpensifyWordmark from '@assets/images/expensify-wordmark.svg'; import ImageSVG from '@components/ImageSVG'; import QRCode from '@components/QRCode'; @@ -8,7 +10,7 @@ import Text from '@components/Text'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; -import {QRShareHandle, QRShareProps} from './types'; +import type {QRShareHandle, QRShareProps} from './types'; function QRShare({url, title, subtitle, logo, logoRatio, logoMarginRatio}: QRShareProps, ref: ForwardedRef) { const styles = useThemeStyles(); diff --git a/src/components/QRShare/propTypes.js b/src/components/QRShare/propTypes.js deleted file mode 100644 index 28275bc724b1..000000000000 --- a/src/components/QRShare/propTypes.js +++ /dev/null @@ -1,45 +0,0 @@ -import PropTypes from 'prop-types'; - -const qrSharePropTypes = { - /** - * The QR code URL - */ - url: PropTypes.string.isRequired, - - /** - * The title that is displayed below the QR Code (usually the user or report name) - */ - title: PropTypes.string.isRequired, - - /** - * The subtitle which will be shown below the title (usually user email or workspace name) - * */ - subtitle: PropTypes.string, - - /** - * The logo which will be display in the middle of the QR code - */ - logo: PropTypes.oneOfType([PropTypes.shape({uri: PropTypes.string}), PropTypes.number, PropTypes.string]), - - /** - * The size ratio of logo to QR code - */ - logoRatio: PropTypes.number, - - /** - * The size ratio of margin around logo to QR code - */ - logoMarginRatio: PropTypes.number, - - /** - * Forwarded ref - */ - innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), -}; - -const qrShareDefaultProps = { - subtitle: undefined, - logo: undefined, -}; - -export {qrSharePropTypes, qrShareDefaultProps}; diff --git a/src/components/QRShare/types.ts b/src/components/QRShare/types.ts index 3b964296ca4c..db9afdf73c2a 100644 --- a/src/components/QRShare/types.ts +++ b/src/components/QRShare/types.ts @@ -1,6 +1,6 @@ -import {ImageSourcePropType} from 'react-native'; -import {Svg} from 'react-native-svg'; -import {QRCodeLogoMarginRatio, QRCodeLogoRatio} from '@components/QRCode'; +import type {ImageSourcePropType} from 'react-native'; +import type {Svg} from 'react-native-svg'; +import type {QRCodeLogoMarginRatio, QRCodeLogoRatio} from '@components/QRCode'; type QRShareProps = { /**