From aab34470f0c9c818774d7766dcd50d0dfb88611a Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 11 Aug 2021 07:47:19 -1000 Subject: [PATCH] Remove additional withOnyx --- src/components/OnyxProvider.js | 3 +++ src/pages/home/report/ReportActionItemDate.js | 9 ++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/OnyxProvider.js b/src/components/OnyxProvider.js index f88a5e078e31a..bdcd335bb7844 100644 --- a/src/components/OnyxProvider.js +++ b/src/components/OnyxProvider.js @@ -39,6 +39,7 @@ Onyx.registerLogger(({level, message}) => { // the same key (e.g. FlatList renderItem components) const [withNetwork, NetworkProvider] = createOnyxContext(ONYXKEYS.NETWORK); const [withPersonalDetails, PersonalDetailsProvider] = createOnyxContext(ONYXKEYS.PERSONAL_DETAILS); +const [withCurrentDate, CurrentDateProvider] = createOnyxContext(ONYXKEYS.CURRENT_DATE); const [ withReportActionsDrafts, ReportActionsDraftsProvider, @@ -55,6 +56,7 @@ const OnyxProvider = props => ( NetworkProvider, PersonalDetailsProvider, ReportActionsDraftsProvider, + CurrentDateProvider, ]} > {props.children} @@ -70,4 +72,5 @@ export { withNetwork, withPersonalDetails, withReportActionsDrafts, + withCurrentDate, }; diff --git a/src/pages/home/report/ReportActionItemDate.js b/src/pages/home/report/ReportActionItemDate.js index 2133e28417c4c..03434cb594685 100644 --- a/src/pages/home/report/ReportActionItemDate.js +++ b/src/pages/home/report/ReportActionItemDate.js @@ -1,11 +1,10 @@ import React, {memo} from 'react'; import PropTypes from 'prop-types'; -import {withOnyx} from 'react-native-onyx'; import styles from '../../../styles/styles'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; import compose from '../../../libs/compose'; -import ONYXKEYS from '../../../ONYXKEYS'; import Text from '../../../components/Text'; +import {withCurrentDate} from '../../../components/OnyxProvider'; const propTypes = { /** UTC timestamp for when the action was created */ @@ -24,10 +23,6 @@ ReportActionItemDate.displayName = 'ReportActionItemDate'; export default compose( withLocalize, - withOnyx({ - currentDate: { - key: ONYXKEYS.CURRENT_DATE, - }, - }), + withCurrentDate(), memo, )(ReportActionItemDate);