From 3976d78bd0ebea2f57dfe6d7cf8fd0021f99b246 Mon Sep 17 00:00:00 2001 From: Rodrigo Lino da Costa Date: Thu, 11 Jan 2024 18:22:17 -0300 Subject: [PATCH 1/2] Sending isDarkMode to statements url --- src/pages/wallet/WalletStatementPage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/wallet/WalletStatementPage.js b/src/pages/wallet/WalletStatementPage.js index e79a2add5213..f63c735528ad 100644 --- a/src/pages/wallet/WalletStatementPage.js +++ b/src/pages/wallet/WalletStatementPage.js @@ -20,6 +20,7 @@ import * as User from '@userActions/User'; import CONFIG from '@src/CONFIG'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; +import useThemePreference from "@hooks/useThemePreference"; const propTypes = { /** The route object passed to this page from the navigator */ @@ -53,6 +54,7 @@ const defaultProps = { }; function WalletStatementPage(props) { + const themePreference = useThemePreference(); const yearMonth = lodashGet(props.route.params, 'yearMonth', null); useEffect(() => { @@ -89,7 +91,7 @@ function WalletStatementPage(props) { const month = yearMonth.substring(4) || getMonth(new Date()); const monthName = format(new Date(year, month - 1), CONST.DATE.MONTH_FORMAT); const title = props.translate('statementPage.title', year, monthName); - const url = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}statement.php?period=${yearMonth}`; + const url = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}statement.php?period=${yearMonth}${themePreference === CONST.THEME.DARK ? '&isDarkMode=true' : ''}`; return ( Date: Thu, 11 Jan 2024 18:37:58 -0300 Subject: [PATCH 2/2] prettier --- src/pages/wallet/WalletStatementPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/wallet/WalletStatementPage.js b/src/pages/wallet/WalletStatementPage.js index f63c735528ad..e97bb33519a0 100644 --- a/src/pages/wallet/WalletStatementPage.js +++ b/src/pages/wallet/WalletStatementPage.js @@ -11,6 +11,7 @@ import {withNetwork} from '@components/OnyxProvider'; import ScreenWrapper from '@components/ScreenWrapper'; import WalletStatementModal from '@components/WalletStatementModal'; import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; +import useThemePreference from '@hooks/useThemePreference'; import compose from '@libs/compose'; import DateUtils from '@libs/DateUtils'; import fileDownload from '@libs/fileDownload'; @@ -20,7 +21,6 @@ import * as User from '@userActions/User'; import CONFIG from '@src/CONFIG'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import useThemePreference from "@hooks/useThemePreference"; const propTypes = { /** The route object passed to this page from the navigator */