From 5c732284d7c525dbb6b1b92486bc8cfa5dce8f18 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Wed, 22 Nov 2023 17:54:12 +0100 Subject: [PATCH 01/13] migrate ReportActionItemGrouped --- src/pages/home/report/ReportActionItem.js | 2 +- src/pages/home/report/ReportActionItemGrouped.js | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 9f803f72cbbb..46f223f2346f 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -551,7 +551,7 @@ function ReportActionItem(props) { ); } - return {content}; + return {content}; }; if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED) { diff --git a/src/pages/home/report/ReportActionItemGrouped.js b/src/pages/home/report/ReportActionItemGrouped.js index 2d55ecbbe037..af36cf702a1d 100644 --- a/src/pages/home/report/ReportActionItemGrouped.js +++ b/src/pages/home/report/ReportActionItemGrouped.js @@ -1,25 +1,26 @@ import PropTypes from 'prop-types'; import React from 'react'; import {View} from 'react-native'; -import styles from '@styles/styles'; +import stylePropTypes from '@styles/stylePropTypes'; +import useThemeStyles from '@styles/useThemeStyles'; const propTypes = { /** Children view component for this action item */ children: PropTypes.node.isRequired, /** Styles for the outermost View */ - // eslint-disable-next-line react/forbid-prop-types - wrapperStyles: PropTypes.arrayOf(PropTypes.object), + wrapperStyle: stylePropTypes, }; const defaultProps = { - wrapperStyles: [styles.chatItem], + wrapperStyle: {}, }; -function ReportActionItemGrouped(props) { +function ReportActionItemGrouped({wrapperStyle, children}) { + const styles = useThemeStyles(); return ( - - {props.children} + + {children} ); } From 86767e1eda45e738c0335cbcaa1e3060d1ece82a Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Wed, 22 Nov 2023 17:57:01 +0100 Subject: [PATCH 02/13] migrate ReportActionItemSingle --- src/pages/home/report/ReportActionItem.js | 3 +-- src/pages/home/report/ReportActionItemSingle.js | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 46f223f2346f..f89ef6957a42 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -539,7 +539,7 @@ function ReportActionItem(props) { ${props.translate('parentReportAction.deletedTask')}`} /> diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index 955e024bd7a8..5f78ce36fb10 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -22,9 +22,10 @@ import Permissions from '@libs/Permissions'; import * as ReportUtils from '@libs/ReportUtils'; import * as UserUtils from '@libs/UserUtils'; import reportPropTypes from '@pages/reportPropTypes'; -import styles from '@styles/styles'; +import stylePropTypes from '@styles/stylePropTypes'; import * as StyleUtils from '@styles/StyleUtils'; import themeColors from '@styles/themes/default'; +import useThemeStyles from '@styles/useThemeStyles'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -37,8 +38,7 @@ const propTypes = { action: PropTypes.shape(reportActionPropTypes).isRequired, /** Styles for the outermost View */ - // eslint-disable-next-line react/forbid-prop-types - wrapperStyles: PropTypes.arrayOf(PropTypes.object), + wrapperStyle: stylePropTypes, /** Children view component for this action item */ children: PropTypes.node.isRequired, @@ -65,7 +65,7 @@ const propTypes = { }; const defaultProps = { - wrapperStyles: [styles.chatItem], + wrapperStyle: {}, showHeader: true, shouldShowSubscriptAvatar: false, hasBeenFlagged: false, @@ -83,6 +83,7 @@ const showWorkspaceDetails = (reportID) => { }; function ReportActionItemSingle(props) { + const styles = useThemeStyles(); const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT; const actorAccountID = props.action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && props.iouReport ? props.iouReport.managerID : props.action.actorAccountID; let displayName = ReportUtils.getDisplayNameForParticipant(actorAccountID); @@ -211,7 +212,7 @@ function ReportActionItemSingle(props) { const statusTooltipText = formattedDate ? `${statusText} (${formattedDate})` : statusText; return ( - + Date: Wed, 22 Nov 2023 18:00:15 +0100 Subject: [PATCH 03/13] migrate BaseHTMLEngineProvider --- .../BaseHTMLEngineProvider.js | 68 ++++++++++--------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js index c4eed0134008..8cddd3c017de 100755 --- a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js +++ b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js @@ -4,7 +4,7 @@ import {defaultHTMLElementModels, RenderHTMLConfigProvider, TRenderEngineProvide import _ from 'underscore'; import convertToLTR from '@libs/convertToLTR'; import singleFontFamily from '@styles/fontFamily/singleFontFamily'; -import styles from '@styles/styles'; +import useThemeStyles from '@styles/useThemeStyles'; import * as HTMLEngineUtils from './htmlEngineUtils'; import htmlRenderers from './HTMLRenderers'; @@ -24,45 +24,49 @@ const defaultProps = { enableExperimentalBRCollapsing: false, }; -// Declare nonstandard tags and their content model here -const customHTMLElementModels = { - edited: defaultHTMLElementModels.span.extend({ - tagName: 'edited', - }), - 'alert-text': defaultHTMLElementModels.div.extend({ - tagName: 'alert-text', - mixedUAStyles: {...styles.formError, ...styles.mb0}, - }), - 'muted-text': defaultHTMLElementModels.div.extend({ - tagName: 'muted-text', - mixedUAStyles: {...styles.colorMuted, ...styles.mb0}, - }), - comment: defaultHTMLElementModels.div.extend({ - tagName: 'comment', - mixedUAStyles: {whiteSpace: 'pre'}, - }), - 'email-comment': defaultHTMLElementModels.div.extend({ - tagName: 'email-comment', - mixedUAStyles: {whiteSpace: 'normal'}, - }), - strong: defaultHTMLElementModels.span.extend({ - tagName: 'strong', - mixedUAStyles: {whiteSpace: 'pre'}, - }), - 'mention-user': defaultHTMLElementModels.span.extend({tagName: 'mention-user'}), - 'mention-here': defaultHTMLElementModels.span.extend({tagName: 'mention-here'}), -}; - -const defaultViewProps = {style: [styles.alignItemsStart, styles.userSelectText]}; - // We are using the explicit composite architecture for performance gains. // Configuration for RenderHTML is handled in a top-level component providing // context to RenderHTMLSource components. See https://git.io/JRcZb // Beware that each prop should be referentialy stable between renders to avoid // costly invalidations and commits. function BaseHTMLEngineProvider(props) { + const styles = useThemeStyles(); + + // Declare nonstandard tags and their content model here + const customHTMLElementModels = useMemo( + () => ({ + edited: defaultHTMLElementModels.span.extend({ + tagName: 'edited', + }), + 'alert-text': defaultHTMLElementModels.div.extend({ + tagName: 'alert-text', + mixedUAStyles: {...styles.formError, ...styles.mb0}, + }), + 'muted-text': defaultHTMLElementModels.div.extend({ + tagName: 'muted-text', + mixedUAStyles: {...styles.colorMuted, ...styles.mb0}, + }), + comment: defaultHTMLElementModels.div.extend({ + tagName: 'comment', + mixedUAStyles: {whiteSpace: 'pre'}, + }), + 'email-comment': defaultHTMLElementModels.div.extend({ + tagName: 'email-comment', + mixedUAStyles: {whiteSpace: 'normal'}, + }), + strong: defaultHTMLElementModels.span.extend({ + tagName: 'strong', + mixedUAStyles: {whiteSpace: 'pre'}, + }), + 'mention-user': defaultHTMLElementModels.span.extend({tagName: 'mention-user'}), + 'mention-here': defaultHTMLElementModels.span.extend({tagName: 'mention-here'}), + }), + [styles.colorMuted, styles.formError, styles.mb0], + ); + // We need to memoize this prop to make it referentially stable. const defaultTextProps = useMemo(() => ({selectable: props.textSelectable, allowFontScaling: false, textBreakStrategy: 'simple'}), [props.textSelectable]); + const defaultViewProps = {style: [styles.alignItemsStart, styles.userSelectText]}; return ( Date: Wed, 22 Nov 2023 18:06:30 +0100 Subject: [PATCH 04/13] migrate PDFView --- src/components/PDFView/index.js | 5 ++++- src/components/PDFView/pdfViewPropTypes.js | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/PDFView/index.js b/src/components/PDFView/index.js index fd01176d9fb2..50e737ba54d3 100644 --- a/src/components/PDFView/index.js +++ b/src/components/PDFView/index.js @@ -10,10 +10,10 @@ import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback'; import Text from '@components/Text'; import withLocalize from '@components/withLocalize'; +import withThemeStyles from '@components/withThemeStyles'; import withWindowDimensions from '@components/withWindowDimensions'; import compose from '@libs/compose'; import Log from '@libs/Log'; -import styles from '@styles/styles'; import variables from '@styles/variables'; import * as CanvasSize from '@userActions/CanvasSize'; import CONST from '@src/CONST'; @@ -262,6 +262,7 @@ class PDFView extends Component { } renderPDFView() { + const styles = this.props.themeStyles; const pageWidth = this.calculatePageWidth(); const outerContainerStyle = [styles.w100, styles.h100, styles.justifyContentCenter, styles.alignItemsCenter]; @@ -323,6 +324,7 @@ class PDFView extends Component { } render() { + const styles = this.props.themeStyles; return this.props.onPress ? ( Date: Wed, 22 Nov 2023 18:08:27 +0100 Subject: [PATCH 05/13] migrate InlineSystemMessage --- src/components/InlineSystemMessage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/InlineSystemMessage.tsx b/src/components/InlineSystemMessage.tsx index e9de0111cd23..6e6423a19a35 100644 --- a/src/components/InlineSystemMessage.tsx +++ b/src/components/InlineSystemMessage.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {View} from 'react-native'; -import styles from '@styles/styles'; -import theme from '@styles/themes/default'; +import useTheme from '@styles/themes/useTheme'; +import useThemeStyles from '@styles/useThemeStyles'; import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; import Text from './Text'; @@ -12,6 +12,9 @@ type InlineSystemMessageProps = { }; function InlineSystemMessage({message = ''}: InlineSystemMessageProps) { + const theme = useTheme(); + const styles = useThemeStyles(); + if (!message) { return null; } From 15c6aba55f4cc260b7394b431b3eeaaa66bf10a6 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Wed, 22 Nov 2023 18:09:13 +0100 Subject: [PATCH 06/13] migrate AttachmentViewPdf --- .../AttachmentView/AttachmentViewPdf/index.android.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.js b/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.js index 46afd23daa4c..b9dd65e2716b 100644 --- a/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.js +++ b/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.js @@ -3,11 +3,12 @@ import {StyleSheet, View} from 'react-native'; import {Gesture, GestureDetector} from 'react-native-gesture-handler'; import Animated, {useSharedValue} from 'react-native-reanimated'; import AttachmentCarouselPagerContext from '@components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPagerContext'; -import styles from '@styles/styles'; +import useThemeStyles from '@styles/useThemeStyles'; import BaseAttachmentViewPdf from './BaseAttachmentViewPdf'; import {attachmentViewPdfDefaultProps, attachmentViewPdfPropTypes} from './propTypes'; function AttachmentViewPdf(props) { + const styles = useThemeStyles(); const {onScaleChanged, ...restProps} = props; const attachmentCarouselPagerContext = useContext(AttachmentCarouselPagerContext); const scaleRef = useSharedValue(1); @@ -41,7 +42,7 @@ function AttachmentViewPdf(props) { return ( Date: Wed, 22 Nov 2023 18:17:42 +0100 Subject: [PATCH 07/13] migrate MenuItem --- src/components/MenuItem.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/components/MenuItem.js b/src/components/MenuItem.js index 9883672976e8..e88be246336c 100644 --- a/src/components/MenuItem.js +++ b/src/components/MenuItem.js @@ -7,9 +7,9 @@ import ControlSelection from '@libs/ControlSelection'; import convertToLTR from '@libs/convertToLTR'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import getButtonState from '@libs/getButtonState'; -import styles from '@styles/styles'; import * as StyleUtils from '@styles/StyleUtils'; -import themeColors from '@styles/themes/default'; +import useTheme from '@styles/themes/useTheme'; +import useThemeStyles from '@styles/useThemeStyles'; import variables from '@styles/variables'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; @@ -38,11 +38,11 @@ const defaultProps = { shouldShowHeaderTitle: false, shouldParseTitle: false, wrapperStyle: [], - style: styles.popoverMenuItem, + style: undefined, titleStyle: {}, shouldShowTitleIcon: false, titleIcon: () => {}, - descriptionTextStyle: styles.breakWord, + descriptionTextStyle: undefined, success: false, icon: undefined, secondaryIcon: undefined, @@ -86,10 +86,13 @@ const defaultProps = { }; const MenuItem = React.forwardRef((props, ref) => { + const theme = useTheme(); + const styles = useThemeStyles(); + const style = props.style || styles.popoverMenuItem; const {isSmallScreenWidth} = useWindowDimensions(); const [html, setHtml] = React.useState(''); - const isDeleted = _.contains(props.style, styles.offlineFeedback.deleted); + const isDeleted = _.contains(style, styles.offlineFeedback.deleted); const descriptionVerticalMargin = props.shouldShowDescriptionOnTop ? styles.mb1 : styles.mt1; const titleTextStyle = StyleUtils.combineStyles( [ @@ -109,7 +112,7 @@ const MenuItem = React.forwardRef((props, ref) => { styles.textLabelSupporting, props.icon && !_.isArray(props.icon) ? styles.ml3 : undefined, props.title ? descriptionVerticalMargin : StyleUtils.getFontSizeStyle(variables.fontSizeNormal), - props.descriptionTextStyle, + props.descriptionTextStyle || styles.breakWord, isDeleted ? styles.offlineFeedback.deleted : undefined, ]); @@ -176,7 +179,7 @@ const MenuItem = React.forwardRef((props, ref) => { onPressOut={ControlSelection.unblock} onSecondaryInteraction={props.onSecondaryInteraction} style={({pressed}) => [ - props.style, + style, !props.interactive && styles.cursorDefault, StyleUtils.getButtonBackgroundColorStyle(getButtonState(props.focused || isHovered, pressed, props.success, props.disabled, props.interactive), true), (isHovered || pressed) && props.hoverAndPressStyle, @@ -206,9 +209,9 @@ const MenuItem = React.forwardRef((props, ref) => { icons={props.icon} size={props.avatarSize} secondAvatarStyle={[ - StyleUtils.getBackgroundAndBorderStyle(themeColors.sidebar), - pressed && props.interactive ? StyleUtils.getBackgroundAndBorderStyle(themeColors.buttonPressedBG) : undefined, - isHovered && !pressed && props.interactive ? StyleUtils.getBackgroundAndBorderStyle(themeColors.border) : undefined, + StyleUtils.getBackgroundAndBorderStyle(theme.sidebar), + pressed && props.interactive ? StyleUtils.getBackgroundAndBorderStyle(theme.buttonPressedBG) : undefined, + isHovered && !pressed && props.interactive ? StyleUtils.getBackgroundAndBorderStyle(theme.border) : undefined, ]} /> )} @@ -291,7 +294,7 @@ const MenuItem = React.forwardRef((props, ref) => { )} @@ -342,7 +345,7 @@ const MenuItem = React.forwardRef((props, ref) => { {/* Since subtitle can be of type number, we should allow 0 to be shown */} {(props.subtitle || props.subtitle === 0) && ( - {props.subtitle} + {props.subtitle} )} {!_.isEmpty(props.floatRightAvatars) && ( @@ -361,7 +364,7 @@ const MenuItem = React.forwardRef((props, ref) => { )} From ed9c97f5232255889b4e74d76e9c3b6a256e3abc Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Wed, 22 Nov 2023 18:18:45 +0100 Subject: [PATCH 08/13] use camelCase of getContextMenuItemStyles --- src/styles/getContextMenuItemStyles/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/getContextMenuItemStyles/index.ts b/src/styles/getContextMenuItemStyles/index.ts index 3f5a8049d31d..2f6f5fe6c1b5 100644 --- a/src/styles/getContextMenuItemStyles/index.ts +++ b/src/styles/getContextMenuItemStyles/index.ts @@ -2,11 +2,11 @@ import styles from '@styles/styles'; import variables from '@styles/variables'; import GetContextMenuItemStyle from './types'; -const GetContextMenuItemStyles: GetContextMenuItemStyle = (windowWidth) => { +const getContextMenuItemStyles: GetContextMenuItemStyle = (windowWidth) => { if (windowWidth && windowWidth > variables.mobileResponsiveWidthBreakpoint) { return [styles.popoverMenuItem, styles.contextMenuItemPopoverMaxWidth]; } return [styles.popoverMenuItem]; }; -export default GetContextMenuItemStyles; +export default getContextMenuItemStyles; From 359c8e90a6b65afe885ccfd83e8b718a785d55f9 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Wed, 22 Nov 2023 18:23:21 +0100 Subject: [PATCH 09/13] migrate getContextMenuItemStyles --- src/components/ContextMenuItem.js | 2 +- src/styles/getContextMenuItemStyles/index.native.ts | 3 +-- src/styles/getContextMenuItemStyles/index.ts | 3 +-- src/styles/getContextMenuItemStyles/types.ts | 3 ++- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/ContextMenuItem.js b/src/components/ContextMenuItem.js index d0a43badc5e3..a8f7e3172c81 100644 --- a/src/components/ContextMenuItem.js +++ b/src/components/ContextMenuItem.js @@ -98,7 +98,7 @@ function ContextMenuItem({onPress, successIcon, successText, icon, text, isMini, success={!isThrottledButtonActive} description={description} descriptionTextStyle={styles.breakAll} - style={getContextMenuItemStyles(windowWidth)} + style={getContextMenuItemStyles(styles, windowWidth)} isAnonymousAction={isAnonymousAction} focused={isFocused} interactive={isThrottledButtonActive} diff --git a/src/styles/getContextMenuItemStyles/index.native.ts b/src/styles/getContextMenuItemStyles/index.native.ts index 798e64fb348c..8b3cf7ea5376 100644 --- a/src/styles/getContextMenuItemStyles/index.native.ts +++ b/src/styles/getContextMenuItemStyles/index.native.ts @@ -1,6 +1,5 @@ -import styles from '@styles/styles'; import GetContextMenuItemStyle from './types'; -const getContextMenuItemStyle: GetContextMenuItemStyle = () => [styles.popoverMenuItem]; +const getContextMenuItemStyle: GetContextMenuItemStyle = (styles) => [styles.popoverMenuItem]; export default getContextMenuItemStyle; diff --git a/src/styles/getContextMenuItemStyles/index.ts b/src/styles/getContextMenuItemStyles/index.ts index 2f6f5fe6c1b5..42635033a244 100644 --- a/src/styles/getContextMenuItemStyles/index.ts +++ b/src/styles/getContextMenuItemStyles/index.ts @@ -1,8 +1,7 @@ -import styles from '@styles/styles'; import variables from '@styles/variables'; import GetContextMenuItemStyle from './types'; -const getContextMenuItemStyles: GetContextMenuItemStyle = (windowWidth) => { +const getContextMenuItemStyles: GetContextMenuItemStyle = (styles, windowWidth) => { if (windowWidth && windowWidth > variables.mobileResponsiveWidthBreakpoint) { return [styles.popoverMenuItem, styles.contextMenuItemPopoverMaxWidth]; } diff --git a/src/styles/getContextMenuItemStyles/types.ts b/src/styles/getContextMenuItemStyles/types.ts index 102f63575bd9..5393a630b79a 100644 --- a/src/styles/getContextMenuItemStyles/types.ts +++ b/src/styles/getContextMenuItemStyles/types.ts @@ -1,5 +1,6 @@ import {ViewStyle} from 'react-native'; +import styles from '@styles/styles'; -type GetContextMenuItemStyle = (windowWidth?: number) => ViewStyle[]; +type GetContextMenuItemStyle = (themeStyles: typeof styles, windowWidth?: number) => ViewStyle[]; export default GetContextMenuItemStyle; From d00bf11242df84e0943ef9405b9daad7244997cb Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Wed, 22 Nov 2023 18:54:24 +0100 Subject: [PATCH 10/13] fix name --- src/styles/getContextMenuItemStyles/index.native.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/getContextMenuItemStyles/index.native.ts b/src/styles/getContextMenuItemStyles/index.native.ts index 8b3cf7ea5376..c8c1a828a0f3 100644 --- a/src/styles/getContextMenuItemStyles/index.native.ts +++ b/src/styles/getContextMenuItemStyles/index.native.ts @@ -1,5 +1,5 @@ import GetContextMenuItemStyle from './types'; -const getContextMenuItemStyle: GetContextMenuItemStyle = (styles) => [styles.popoverMenuItem]; +const getContextMenuItemStyles: GetContextMenuItemStyle = (styles) => [styles.popoverMenuItem]; -export default getContextMenuItemStyle; +export default getContextMenuItemStyles; From 1c42c55f62a20f3762fd6e83edf94ad0f6c9f458 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Fri, 24 Nov 2023 11:29:28 +0100 Subject: [PATCH 11/13] remove undefined default props --- src/components/MenuItem.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/MenuItem.js b/src/components/MenuItem.js index e88be246336c..0b6ff4d0ec94 100644 --- a/src/components/MenuItem.js +++ b/src/components/MenuItem.js @@ -38,11 +38,9 @@ const defaultProps = { shouldShowHeaderTitle: false, shouldParseTitle: false, wrapperStyle: [], - style: undefined, titleStyle: {}, shouldShowTitleIcon: false, titleIcon: () => {}, - descriptionTextStyle: undefined, success: false, icon: undefined, secondaryIcon: undefined, From ca70cacd8b8d7361d722327d3c4abfa6fcf8e2bf Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Fri, 24 Nov 2023 15:25:47 +0100 Subject: [PATCH 12/13] Revert "remove undefined default props" This reverts commit 1c42c55f62a20f3762fd6e83edf94ad0f6c9f458. --- src/components/MenuItem.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/MenuItem.js b/src/components/MenuItem.js index 0b6ff4d0ec94..e88be246336c 100644 --- a/src/components/MenuItem.js +++ b/src/components/MenuItem.js @@ -38,9 +38,11 @@ const defaultProps = { shouldShowHeaderTitle: false, shouldParseTitle: false, wrapperStyle: [], + style: undefined, titleStyle: {}, shouldShowTitleIcon: false, titleIcon: () => {}, + descriptionTextStyle: undefined, success: false, icon: undefined, secondaryIcon: undefined, From 1d44d68e0d66ac69a032d119f2ca70ccf48e60f9 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Fri, 24 Nov 2023 15:26:32 +0100 Subject: [PATCH 13/13] use undefined for styles --- src/pages/home/report/ReportActionItemGrouped.js | 2 +- src/pages/home/report/ReportActionItemSingle.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionItemGrouped.js b/src/pages/home/report/ReportActionItemGrouped.js index af36cf702a1d..8c8c51bda3c2 100644 --- a/src/pages/home/report/ReportActionItemGrouped.js +++ b/src/pages/home/report/ReportActionItemGrouped.js @@ -13,7 +13,7 @@ const propTypes = { }; const defaultProps = { - wrapperStyle: {}, + wrapperStyle: undefined, }; function ReportActionItemGrouped({wrapperStyle, children}) { diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index c3ab9c33917a..9c641d879de3 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -61,7 +61,7 @@ const propTypes = { }; const defaultProps = { - wrapperStyle: {}, + wrapperStyle: undefined, showHeader: true, shouldShowSubscriptAvatar: false, hasBeenFlagged: false,