From 46895cf791f43a473eea1f2d30fbec19c510dea0 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 5 Jan 2024 13:02:05 -0800 Subject: [PATCH 1/5] Remove the `SceneWrapper` background option --- .../ChangePasswordScene.test.tsx.snap | 1 - .../__snapshots__/ChangePinScene.test.tsx.snap | 1 - .../CryptoExchangeSuccessScene.test.tsx.snap | 1 - .../DefaultFiatSettingScene.test.tsx.snap | 1 - .../FioAddressDetailsScene.test.tsx.snap | 4 +--- .../FioAddressListScene.test.tsx.snap | 4 +--- .../FioAddressRegisterScene.test.tsx.snap | 4 +--- ...ddressRegisterSelectWalletScene.test.tsx.snap | 4 +--- .../FioAddressRegisteredScene.test.tsx.snap | 4 +--- .../FioAddressSettingsScene.test.tsx.snap | 4 +--- .../FioConnectWalletConfirmScene.test.tsx.snap | 1 - .../FioDomainRegisterScene.test.tsx.snap | 4 +--- .../__snapshots__/RequestScene.test.tsx.snap | 1 - src/components/common/SceneWrapper.tsx | 16 +--------------- src/components/scenes/AssetSettingsScene.tsx | 2 +- src/components/scenes/ChangeMiningFeeScene.tsx | 2 +- src/components/scenes/ChangePasswordScene.tsx | 2 +- src/components/scenes/ChangePinScene.tsx | 2 +- .../scenes/CoinRankingDetailsScene.tsx | 2 +- src/components/scenes/CoinRankingScene.tsx | 2 +- src/components/scenes/ConfirmScene.tsx | 2 +- src/components/scenes/CrashScene.tsx | 2 +- .../scenes/CreateWalletCompletionScene.tsx | 2 +- .../scenes/CreateWalletImportOptionsScene.tsx | 2 +- .../scenes/CreateWalletImportScene.tsx | 2 +- .../scenes/CreateWalletSelectCryptoScene.tsx | 2 +- .../scenes/CreateWalletSelectFiatScene.tsx | 2 +- .../CryptoExchangeQuoteProcessingScene.tsx | 2 +- .../scenes/CryptoExchangeQuoteScene.tsx | 2 +- .../scenes/CryptoExchangeSuccessScene.tsx | 2 +- .../scenes/CurrencyNotificationScene.tsx | 2 +- src/components/scenes/CurrencySettingsScene.tsx | 2 +- .../scenes/DefaultFiatSettingScene.tsx | 2 +- src/components/scenes/EdgeLoginScene.tsx | 2 +- src/components/scenes/ExtraTabScene.tsx | 2 +- .../scenes/Fio/FioAddressDetailsScene.tsx | 2 +- .../scenes/Fio/FioAddressListScene.tsx | 2 +- .../scenes/Fio/FioAddressRegisterScene.tsx | 2 +- .../Fio/FioAddressRegisterSelectWalletScene.tsx | 2 +- .../scenes/Fio/FioAddressRegisteredScene.tsx | 2 +- .../scenes/Fio/FioAddressSettingsScene.tsx | 2 +- .../scenes/Fio/FioConnectWalletConfirmScene.tsx | 2 +- .../scenes/Fio/FioCreateHandleScene.tsx | 2 +- .../scenes/Fio/FioDomainRegisterScene.tsx | 2 +- .../Fio/FioDomainRegisterSelectWalletScene.tsx | 2 +- .../scenes/Fio/FioDomainSettingsScene.tsx | 2 +- .../scenes/Fio/FioNameConfirmScene.tsx | 2 +- .../scenes/Fio/FioRequestConfirmationScene.tsx | 2 +- .../scenes/Fio/FioRequestListScene.tsx | 2 +- .../scenes/Fio/FioSentRequestDetailsScene.tsx | 2 +- .../scenes/Fio/FioStakingChangeScene.tsx | 2 +- .../scenes/Fio/FioStakingOverviewScene.tsx | 2 +- src/components/scenes/FormScene.tsx | 2 +- src/components/scenes/GuiPluginListScene.tsx | 2 +- src/components/scenes/GuiPluginViewScene.tsx | 2 +- src/components/scenes/LoadingScene.tsx | 2 +- .../scenes/Loans/LoanCreateConfirmationScene.tsx | 2 +- .../scenes/Loans/LoanDashboardScene.tsx | 4 ++-- src/components/scenes/Loans/LoanStatusScene.tsx | 2 +- .../scenes/MigrateWalletCalculateFeeScene.tsx | 2 +- .../scenes/MigrateWalletCompletionScene.tsx | 2 +- .../scenes/MigrateWalletSelectCryptoScene.tsx | 2 +- src/components/scenes/NotificationScene.tsx | 2 +- src/components/scenes/OtpSettingsScene.tsx | 2 +- src/components/scenes/PasswordRecoveryScene.tsx | 2 +- src/components/scenes/PromotionSettingsScene.tsx | 2 +- src/components/scenes/RequestScene.tsx | 4 ++-- src/components/scenes/SendScene2.tsx | 2 +- src/components/scenes/SettingsScene.tsx | 2 +- .../scenes/Staking/StakeModifyScene.tsx | 4 ++-- .../scenes/Staking/StakeOptionsScene.tsx | 2 +- .../scenes/Staking/StakeOverviewScene.tsx | 4 ++-- src/components/scenes/SwapSettingsScene.tsx | 2 +- .../scenes/TransactionsExportScene.tsx | 2 +- src/components/scenes/UpgradeUsernameScreen.tsx | 2 +- src/components/scenes/WalletListScene.tsx | 2 +- src/components/scenes/WcConnectScene.tsx | 2 +- src/components/scenes/WcConnectionsScene.tsx | 2 +- src/components/scenes/WcDisconnectScene.tsx | 2 +- src/components/scenes/WebViewScene.tsx | 2 +- src/plugins/gui/scenes/AddressFormScene.tsx | 2 +- .../gui/scenes/FiatPluginEnterAmountScene.tsx | 2 +- src/plugins/gui/scenes/FiatPluginWebView.tsx | 2 +- src/plugins/gui/scenes/InfoDisplayScene.tsx | 2 +- .../gui/scenes/RewardsCardDashboardScene.tsx | 2 +- .../gui/scenes/RewardsCardWelcomeScene.tsx | 2 +- src/plugins/gui/scenes/SepaFormScene.tsx | 2 +- 87 files changed, 85 insertions(+), 119 deletions(-) diff --git a/src/__tests__/scenes/__snapshots__/ChangePasswordScene.test.tsx.snap b/src/__tests__/scenes/__snapshots__/ChangePasswordScene.test.tsx.snap index 3b3dce7195b..bd987f63707 100644 --- a/src/__tests__/scenes/__snapshots__/ChangePasswordScene.test.tsx.snap +++ b/src/__tests__/scenes/__snapshots__/ChangePasswordScene.test.tsx.snap @@ -2,7 +2,6 @@ exports[`ChangePasswordComponent should render with loading props 1`] = ` [Function] diff --git a/src/__tests__/scenes/__snapshots__/FioAddressDetailsScene.test.tsx.snap b/src/__tests__/scenes/__snapshots__/FioAddressDetailsScene.test.tsx.snap index 6cb52e121b0..20ee7d1ab0f 100644 --- a/src/__tests__/scenes/__snapshots__/FioAddressDetailsScene.test.tsx.snap +++ b/src/__tests__/scenes/__snapshots__/FioAddressDetailsScene.test.tsx.snap @@ -1,9 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`FioAddressDetails should render with loading props 1`] = ` - + - + + + + + + - + state.core.account) return ( - + {CURRENCY_SETTINGS_KEYS.map(pluginId => { if (account.currencyConfig[pluginId] == null) return null const { currencyInfo } = account.currencyConfig[pluginId] diff --git a/src/components/scenes/ChangeMiningFeeScene.tsx b/src/components/scenes/ChangeMiningFeeScene.tsx index de31d24551d..843bbb29daf 100644 --- a/src/components/scenes/ChangeMiningFeeScene.tsx +++ b/src/components/scenes/ChangeMiningFeeScene.tsx @@ -83,7 +83,7 @@ export class ChangeMiningFeeComponent extends React.PureComponent const { networkFeeOption } = this.state return ( - + {Object.keys(feeOptions).map(feeSetting => { diff --git a/src/components/scenes/ChangePasswordScene.tsx b/src/components/scenes/ChangePasswordScene.tsx index 8c6bc5e766d..37edd50f970 100644 --- a/src/components/scenes/ChangePasswordScene.tsx +++ b/src/components/scenes/ChangePasswordScene.tsx @@ -24,7 +24,7 @@ export class ChangePasswordComponent extends React.Component { navigation.goBack() } return ( - + ) diff --git a/src/components/scenes/ChangePinScene.tsx b/src/components/scenes/ChangePinScene.tsx index 135faefcb6b..a1779d590fe 100644 --- a/src/components/scenes/ChangePinScene.tsx +++ b/src/components/scenes/ChangePinScene.tsx @@ -24,7 +24,7 @@ export class ChangePinComponent extends React.Component { navigation.goBack() } return ( - + ) diff --git a/src/components/scenes/CoinRankingDetailsScene.tsx b/src/components/scenes/CoinRankingDetailsScene.tsx index c0e9b3fa2fd..0426b83158f 100644 --- a/src/components/scenes/CoinRankingDetailsScene.tsx +++ b/src/components/scenes/CoinRankingDetailsScene.tsx @@ -165,7 +165,7 @@ const CoinRankingDetailsSceneComponent = (props: Props) => { } return ( - + diff --git a/src/components/scenes/CoinRankingScene.tsx b/src/components/scenes/CoinRankingScene.tsx index fc32bc42bcc..09a54ca9b09 100644 --- a/src/components/scenes/CoinRankingScene.tsx +++ b/src/components/scenes/CoinRankingScene.tsx @@ -202,7 +202,7 @@ const CoinRankingComponent = (props: Props) => { const assetSubTextString = assetSubTextStrings[assetSubText] return ( - + {({ insetStyles }) => ( <> diff --git a/src/components/scenes/ConfirmScene.tsx b/src/components/scenes/ConfirmScene.tsx index e22fb18ae24..c79cf553e0f 100644 --- a/src/components/scenes/ConfirmScene.tsx +++ b/src/components/scenes/ConfirmScene.tsx @@ -51,7 +51,7 @@ const ConfirmComponent = (props: Props) => { }, [onBack]) return ( - + diff --git a/src/components/scenes/CrashScene.tsx b/src/components/scenes/CrashScene.tsx index 79ac0842312..6d65f353fd7 100644 --- a/src/components/scenes/CrashScene.tsx +++ b/src/components/scenes/CrashScene.tsx @@ -18,7 +18,7 @@ export function CrashScene(props: Props): React.ReactElement { const styles = getStyles(theme) return ( - + {lstrings.error_boundary_title} {sprintf(lstrings.error_boundary_message_s, config.supportEmail)} diff --git a/src/components/scenes/CreateWalletCompletionScene.tsx b/src/components/scenes/CreateWalletCompletionScene.tsx index 0d2c62c1c24..2f47e7138d8 100644 --- a/src/components/scenes/CreateWalletCompletionScene.tsx +++ b/src/components/scenes/CreateWalletCompletionScene.tsx @@ -160,7 +160,7 @@ const CreateWalletCompletionComponent = (props: Props) => { const keyExtractor = useHandler((item: WalletCreateItem) => item.key) return ( - + {({ insetStyles }) => ( diff --git a/src/components/scenes/CreateWalletImportOptionsScene.tsx b/src/components/scenes/CreateWalletImportOptionsScene.tsx index 262c22446f7..d2dd91a2184 100644 --- a/src/components/scenes/CreateWalletImportOptionsScene.tsx +++ b/src/components/scenes/CreateWalletImportOptionsScene.tsx @@ -211,7 +211,7 @@ const CreateWalletImportOptionsComponent = (props: Props) => { const keyExtractor = useHandler((item: [string, Set]) => item[0]) return ( - + { const svgWidth = React.useMemo(() => 83 * theme.rem(0.0625), [theme]) return ( - + { ) return ( - + {({ insetStyles }) => ( diff --git a/src/components/scenes/CreateWalletSelectFiatScene.tsx b/src/components/scenes/CreateWalletSelectFiatScene.tsx index a8f75deae57..35cc2f3023d 100644 --- a/src/components/scenes/CreateWalletSelectFiatScene.tsx +++ b/src/components/scenes/CreateWalletSelectFiatScene.tsx @@ -208,7 +208,7 @@ const CreateWalletSelectFiatComponent = (props: Props) => { const keyExtractor = useHandler((item: WalletCreateItem) => item.key) return ( - + {renderSelectedFiatRow()} diff --git a/src/components/scenes/CryptoExchangeQuoteProcessingScene.tsx b/src/components/scenes/CryptoExchangeQuoteProcessingScene.tsx index 362b1faf6da..00eb706e6fe 100644 --- a/src/components/scenes/CryptoExchangeQuoteProcessingScene.tsx +++ b/src/components/scenes/CryptoExchangeQuoteProcessingScene.tsx @@ -56,7 +56,7 @@ export function CryptoExchangeQuoteProcessingScene(props: Props) { }, [onDone, onError]) return ( - + {lstrings.hang_tight} diff --git a/src/components/scenes/CryptoExchangeQuoteScene.tsx b/src/components/scenes/CryptoExchangeQuoteScene.tsx index dd14fd2926e..e32eb913d42 100644 --- a/src/components/scenes/CryptoExchangeQuoteScene.tsx +++ b/src/components/scenes/CryptoExchangeQuoteScene.tsx @@ -183,7 +183,7 @@ export const CryptoExchangeQuoteScene = (props: Props) => { )) } return ( - + {({ insetStyles }) => ( <> diff --git a/src/components/scenes/CryptoExchangeSuccessScene.tsx b/src/components/scenes/CryptoExchangeSuccessScene.tsx index 74e407d0b7e..f8665a39f83 100644 --- a/src/components/scenes/CryptoExchangeSuccessScene.tsx +++ b/src/components/scenes/CryptoExchangeSuccessScene.tsx @@ -75,7 +75,7 @@ export class CryptoExchangeSuccessComponent extends React.PureComponent + {lstrings.exchange_congratulations} diff --git a/src/components/scenes/CurrencyNotificationScene.tsx b/src/components/scenes/CurrencyNotificationScene.tsx index 5929625c633..2429962efb1 100644 --- a/src/components/scenes/CurrencyNotificationScene.tsx +++ b/src/components/scenes/CurrencyNotificationScene.tsx @@ -37,7 +37,7 @@ export const CurrencyNotificationScene = (props: Props) => { const handleDailyPress = useHandler(updateSettings('daily')) return ( - + + {denominations.length > 1 ? renderDenominations() : null} diff --git a/src/components/scenes/DefaultFiatSettingScene.tsx b/src/components/scenes/DefaultFiatSettingScene.tsx index a04c66c23ce..0fec4dcd519 100644 --- a/src/components/scenes/DefaultFiatSettingScene.tsx +++ b/src/components/scenes/DefaultFiatSettingScene.tsx @@ -83,7 +83,7 @@ export class DefaultFiatSettingComponent extends React.Component { }) return ( - + {({ insetStyles }) => ( diff --git a/src/components/scenes/EdgeLoginScene.tsx b/src/components/scenes/EdgeLoginScene.tsx index 8f118858a4d..c695cfc466e 100644 --- a/src/components/scenes/EdgeLoginScene.tsx +++ b/src/components/scenes/EdgeLoginScene.tsx @@ -69,7 +69,7 @@ export const EdgeLoginScene = (props: Props) => { const logoUri = theme.isDark ? lobby?.loginRequest?.displayImageDarkUrl : lobby?.loginRequest?.displayImageLightUrl return ( - + diff --git a/src/components/scenes/ExtraTabScene.tsx b/src/components/scenes/ExtraTabScene.tsx index 49898bcc00b..2ce14bbfd18 100644 --- a/src/components/scenes/ExtraTabScene.tsx +++ b/src/components/scenes/ExtraTabScene.tsx @@ -24,7 +24,7 @@ export function ExtraTabScene(props: Props) { } return ( - + ) diff --git a/src/components/scenes/Fio/FioAddressDetailsScene.tsx b/src/components/scenes/Fio/FioAddressDetailsScene.tsx index ed20a465b32..353ad9cd10b 100644 --- a/src/components/scenes/Fio/FioAddressDetailsScene.tsx +++ b/src/components/scenes/Fio/FioAddressDetailsScene.tsx @@ -104,7 +104,7 @@ export class FioAddressDetails extends React.Component { const bundledTxsLabel = `${lstrings.fio_address_details_screen_bundled_txs}: ${bundledTxs}` return ( - + {bundledTxsLabel} {this.renderAccountSettings()} { const noFioAddressesText = `${lstrings.no} ${lstrings.title_fio_address}` return ( <> - + diff --git a/src/components/scenes/Fio/FioAddressRegisterScene.tsx b/src/components/scenes/Fio/FioAddressRegisterScene.tsx index a1f0a39a47c..cdff261996a 100644 --- a/src/components/scenes/Fio/FioAddressRegisterScene.tsx +++ b/src/components/scenes/Fio/FioAddressRegisterScene.tsx @@ -396,7 +396,7 @@ export class FioAddressRegister extends React.Component { const styles = getStyles(theme) return ( - + diff --git a/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx b/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx index de13438d083..32756c7aa7d 100644 --- a/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx +++ b/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx @@ -229,7 +229,7 @@ export class FioAddressRegisterSelectWallet extends React.Component + diff --git a/src/components/scenes/Fio/FioAddressRegisteredScene.tsx b/src/components/scenes/Fio/FioAddressRegisteredScene.tsx index 0bedef17e8e..a27ee88c7fc 100644 --- a/src/components/scenes/Fio/FioAddressRegisteredScene.tsx +++ b/src/components/scenes/Fio/FioAddressRegisteredScene.tsx @@ -37,7 +37,7 @@ export class FioAddressRegistered extends React.Component { const styles = getStyles(theme) return ( - + diff --git a/src/components/scenes/Fio/FioAddressSettingsScene.tsx b/src/components/scenes/Fio/FioAddressSettingsScene.tsx index a2b8e84caad..04b0395c6ed 100644 --- a/src/components/scenes/Fio/FioAddressSettingsScene.tsx +++ b/src/components/scenes/Fio/FioAddressSettingsScene.tsx @@ -147,7 +147,7 @@ export class FioAddressSettingsComponent extends React.Component + {bundledTxs != null ? : null} {showAddBundledTxs && ( diff --git a/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx b/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx index 5bee3548348..c17778767e9 100644 --- a/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx +++ b/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx @@ -184,7 +184,7 @@ export class FioConnectWalletConfirm extends React.Component { const styles = getStyles(theme) return ( - + {walletsToConnect.length ? ( diff --git a/src/components/scenes/Fio/FioCreateHandleScene.tsx b/src/components/scenes/Fio/FioCreateHandleScene.tsx index 81b239e5cf9..1f9dd83c028 100644 --- a/src/components/scenes/Fio/FioCreateHandleScene.tsx +++ b/src/components/scenes/Fio/FioCreateHandleScene.tsx @@ -177,7 +177,7 @@ export const FioCreateHandleScene = (props: Props) => { }, []) return ( - + {lstrings.personalize_wallet_title} diff --git a/src/components/scenes/Fio/FioDomainRegisterScene.tsx b/src/components/scenes/Fio/FioDomainRegisterScene.tsx index f5aa0b9c931..a16c72a6191 100644 --- a/src/components/scenes/Fio/FioDomainRegisterScene.tsx +++ b/src/components/scenes/Fio/FioDomainRegisterScene.tsx @@ -256,7 +256,7 @@ export class FioDomainRegister extends React.PureComponent { } return ( - + diff --git a/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx b/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx index 636ed69cca0..50b9cb6c216 100644 --- a/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx +++ b/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx @@ -204,7 +204,7 @@ class FioDomainRegisterSelectWallet extends React.PureComponent + {detailsText} diff --git a/src/components/scenes/Fio/FioDomainSettingsScene.tsx b/src/components/scenes/Fio/FioDomainSettingsScene.tsx index 715af8cf044..4c56053fd6c 100644 --- a/src/components/scenes/Fio/FioDomainSettingsScene.tsx +++ b/src/components/scenes/Fio/FioDomainSettingsScene.tsx @@ -161,7 +161,7 @@ export class FioDomainSettingsComponent extends React.Component { const { showRenew, showVisibility, showTransfer } = this.state return ( - + {showVisibility && ( diff --git a/src/components/scenes/Fio/FioNameConfirmScene.tsx b/src/components/scenes/Fio/FioNameConfirmScene.tsx index 11319eaa7bc..d50f5f0f027 100644 --- a/src/components/scenes/Fio/FioNameConfirmScene.tsx +++ b/src/components/scenes/Fio/FioNameConfirmScene.tsx @@ -140,7 +140,7 @@ class FioNameConfirm extends React.PureComponent { const styles = getStyles(theme) return ( - + + { const styles = getStyles(theme) return ( - + {fullScreenLoader && } diff --git a/src/components/scenes/Fio/FioSentRequestDetailsScene.tsx b/src/components/scenes/Fio/FioSentRequestDetailsScene.tsx index 329d191a2c6..07eaa304863 100644 --- a/src/components/scenes/Fio/FioSentRequestDetailsScene.tsx +++ b/src/components/scenes/Fio/FioSentRequestDetailsScene.tsx @@ -67,7 +67,7 @@ class FioSentRequestDetailsComponent extends React.PureComponent { const styles = getStyles(theme) return ( - + {this.amountField()} diff --git a/src/components/scenes/Fio/FioStakingChangeScene.tsx b/src/components/scenes/Fio/FioStakingChangeScene.tsx index 7a6dd040966..0869450eec3 100644 --- a/src/components/scenes/Fio/FioStakingChangeScene.tsx +++ b/src/components/scenes/Fio/FioStakingChangeScene.tsx @@ -337,7 +337,7 @@ export const FioStakingChangeScene = withWallet((props: Props) => { } return ( - + {(() => { switch (change) { case 'add': diff --git a/src/components/scenes/Fio/FioStakingOverviewScene.tsx b/src/components/scenes/Fio/FioStakingOverviewScene.tsx index 16ce2300f33..12e6d71efe8 100644 --- a/src/components/scenes/Fio/FioStakingOverviewScene.tsx +++ b/src/components/scenes/Fio/FioStakingOverviewScene.tsx @@ -109,7 +109,7 @@ export const FioStakingOverviewSceneComponent = (props: Props) => { const fiatStaked = ` (${fiatSymbol}${stakingFiatBalanceFormat} ${fiatCurrencyCode})` return ( - + diff --git a/src/components/scenes/FormScene.tsx b/src/components/scenes/FormScene.tsx index 6d5f28ae129..a7a40164e47 100644 --- a/src/components/scenes/FormScene.tsx +++ b/src/components/scenes/FormScene.tsx @@ -22,7 +22,7 @@ export const FormScene = (props: Props) => { const styles = getStyles(theme) return ( - + {children} diff --git a/src/components/scenes/GuiPluginListScene.tsx b/src/components/scenes/GuiPluginListScene.tsx index 1421a4b77ac..4e0dc965700 100644 --- a/src/components/scenes/GuiPluginListScene.tsx +++ b/src/components/scenes/GuiPluginListScene.tsx @@ -504,7 +504,7 @@ export const GuiPluginListScene = React.memo((props: OwnProps) => { } return ( - + {({ insetStyles }) => ( + ) diff --git a/src/components/scenes/LoadingScene.tsx b/src/components/scenes/LoadingScene.tsx index 242c3197f8b..2d20bd26c57 100644 --- a/src/components/scenes/LoadingScene.tsx +++ b/src/components/scenes/LoadingScene.tsx @@ -12,7 +12,7 @@ import { useTheme } from '../services/ThemeContext' export const LoadingScene = () => { const theme = useTheme() return ( - + diff --git a/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx b/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx index 0d6a359f80e..ac70a394552 100644 --- a/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx +++ b/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx @@ -218,7 +218,7 @@ export const LoanCreateConfirmationScene = (props: Props) => { if (loanAccountError != null) return return loanAccount == null ? ( - + ) : ( diff --git a/src/components/scenes/Loans/LoanDashboardScene.tsx b/src/components/scenes/Loans/LoanDashboardScene.tsx index 54ea757840a..dc3600e3a19 100644 --- a/src/components/scenes/Loans/LoanDashboardScene.tsx +++ b/src/components/scenes/Loans/LoanDashboardScene.tsx @@ -181,7 +181,7 @@ export const LoanDashboardScene = (props: Props) => { if (!isWalletsLoaded) { return ( - + @@ -189,7 +189,7 @@ export const LoanDashboardScene = (props: Props) => { } return ( - + diff --git a/src/components/scenes/Loans/LoanStatusScene.tsx b/src/components/scenes/Loans/LoanStatusScene.tsx index 1c30d19a582..b9ff46cfeef 100644 --- a/src/components/scenes/Loans/LoanStatusScene.tsx +++ b/src/components/scenes/Loans/LoanStatusScene.tsx @@ -93,7 +93,7 @@ export const LoanStatusSceneComponent = (props: Props) => { const isProgramDone = steps.length > 0 && steps[steps.length - 1].status === 'done' return ( - + diff --git a/src/components/scenes/MigrateWalletCalculateFeeScene.tsx b/src/components/scenes/MigrateWalletCalculateFeeScene.tsx index aa07f49b5b2..1158f0e5dc8 100644 --- a/src/components/scenes/MigrateWalletCalculateFeeScene.tsx +++ b/src/components/scenes/MigrateWalletCalculateFeeScene.tsx @@ -215,7 +215,7 @@ const MigrateWalletCalculateFeeComponent = (props: Props) => { const keyExtractor = useHandler((item: MigrateWalletItem) => item.key) return ( - + diff --git a/src/components/scenes/MigrateWalletCompletionScene.tsx b/src/components/scenes/MigrateWalletCompletionScene.tsx index f36a93db5a5..26ac7234c90 100644 --- a/src/components/scenes/MigrateWalletCompletionScene.tsx +++ b/src/components/scenes/MigrateWalletCompletionScene.tsx @@ -238,7 +238,7 @@ const MigrateWalletCompletionComponent = (props: Props) => { const keyExtractor = useHandler((item: MigrateWalletItem) => item.key) return ( - + {({ insetStyles }) => ( diff --git a/src/components/scenes/MigrateWalletSelectCryptoScene.tsx b/src/components/scenes/MigrateWalletSelectCryptoScene.tsx index 271fc7954bf..33488fb980f 100644 --- a/src/components/scenes/MigrateWalletSelectCryptoScene.tsx +++ b/src/components/scenes/MigrateWalletSelectCryptoScene.tsx @@ -137,7 +137,7 @@ const MigrateWalletSelectCryptoComponent = (props: Props) => { const keyExtractor = useHandler((item: MigrateWalletItem) => item.key) return ( - + {({ insetStyles }) => ( diff --git a/src/components/scenes/NotificationScene.tsx b/src/components/scenes/NotificationScene.tsx index cfac16cf486..30477a770ab 100644 --- a/src/components/scenes/NotificationScene.tsx +++ b/src/components/scenes/NotificationScene.tsx @@ -42,7 +42,7 @@ export const NotificationScene = (props: Props) => { ) return ( - + { const otpDescriptionTwo = sprintf(lstrings.otp_description_two, config.appName) return ( - + {otpKey != null ? lstrings.title_otp_enabled : lstrings.title_otp_disabled} diff --git a/src/components/scenes/PasswordRecoveryScene.tsx b/src/components/scenes/PasswordRecoveryScene.tsx index c3aed60d05b..6ade831bd2a 100644 --- a/src/components/scenes/PasswordRecoveryScene.tsx +++ b/src/components/scenes/PasswordRecoveryScene.tsx @@ -22,7 +22,7 @@ class ChangeRecoveryComponent extends React.Component { const handleComplete = () => navigation.goBack() return ( - + { const { accountReferral, deviceReferral, removePromotion } = this.props return ( - + { renderKeysOnlyMode = () => { const styles = getStyles(this.props.theme) return ( - + {sprintf(lstrings.request_deprecated_currency_code, this.props.primaryCurrencyInfo?.displayCurrencyCode)} @@ -310,7 +310,7 @@ export class RequestSceneComponent extends React.Component { return keysOnlyMode ? ( this.renderKeysOnlyMode() ) : ( - + {lstrings.fragment_request_subtitle} diff --git a/src/components/scenes/SendScene2.tsx b/src/components/scenes/SendScene2.tsx index 02f99b435e7..d472e2c06cf 100644 --- a/src/components/scenes/SendScene2.tsx +++ b/src/components/scenes/SendScene2.tsx @@ -985,7 +985,7 @@ const SendComponent = (props: Props) => { disabledText = lstrings.spending_limits_enter_pin } return ( - + {({ insetStyles }) => ( <> { const isLightAccount = username == null return ( - + } label={`${lstrings.settings_account_title_cap}: ${username ?? lstrings.missing_username}`} diff --git a/src/components/scenes/Staking/StakeModifyScene.tsx b/src/components/scenes/Staking/StakeModifyScene.tsx index 8b7586de7ee..0d2a113d163 100644 --- a/src/components/scenes/Staking/StakeModifyScene.tsx +++ b/src/components/scenes/Staking/StakeModifyScene.tsx @@ -468,7 +468,7 @@ const StakeModifySceneComponent = (props: Props) => { if (stakePosition.allocations.length === 0) { return ( - + ) @@ -477,7 +477,7 @@ const StakeModifySceneComponent = (props: Props) => { const isSliderDisabled = sliderLocked || changeQuote == null || !changeQuote.allocations.some(quoteAllocation => gt(quoteAllocation.nativeAmount, '0')) return ( - + {icon} diff --git a/src/components/scenes/Staking/StakeOptionsScene.tsx b/src/components/scenes/Staking/StakeOptionsScene.tsx index f51c84e1881..41740782f13 100644 --- a/src/components/scenes/Staking/StakeOptionsScene.tsx +++ b/src/components/scenes/Staking/StakeOptionsScene.tsx @@ -77,7 +77,7 @@ const StakeOptionsSceneComponent = (props: Props) => { } return ( - + diff --git a/src/components/scenes/Staking/StakeOverviewScene.tsx b/src/components/scenes/Staking/StakeOverviewScene.tsx index c141d45477f..2deaf544625 100644 --- a/src/components/scenes/Staking/StakeOverviewScene.tsx +++ b/src/components/scenes/Staking/StakeOverviewScene.tsx @@ -129,7 +129,7 @@ const StakeOverviewSceneComponent = (props: Props) => { if (stakeAllocations == null || rewardAllocations == null) return ( - + ) @@ -137,7 +137,7 @@ const StakeOverviewSceneComponent = (props: Props) => { const { canStake = false, canClaim = false, canUnstakeAndClaim = false, canUnstake = false } = stakePosition ?? {} return ( - + { render() { return ( - + diff --git a/src/components/scenes/TransactionsExportScene.tsx b/src/components/scenes/TransactionsExportScene.tsx index fe4d192af04..e9c20ce6d3e 100644 --- a/src/components/scenes/TransactionsExportScene.tsx +++ b/src/components/scenes/TransactionsExportScene.tsx @@ -133,7 +133,7 @@ class TransactionsExportSceneComponent extends React.PureComponent const disabledExport = !isExportQbo && !isExportCsv && !isExportBitwave return ( - + undefined} /> } label={lstrings.export_transaction_date_range} /> diff --git a/src/components/scenes/UpgradeUsernameScreen.tsx b/src/components/scenes/UpgradeUsernameScreen.tsx index d9e639a489e..806cabefe9b 100644 --- a/src/components/scenes/UpgradeUsernameScreen.tsx +++ b/src/components/scenes/UpgradeUsernameScreen.tsx @@ -19,7 +19,7 @@ export const UpgradeUsernameScene = (props: Props) => { navigation.goBack() } return ( - + ) diff --git a/src/components/scenes/WalletListScene.tsx b/src/components/scenes/WalletListScene.tsx index 9d932ca2e4f..92a529d9a8f 100644 --- a/src/components/scenes/WalletListScene.tsx +++ b/src/components/scenes/WalletListScene.tsx @@ -85,7 +85,7 @@ export function WalletListScene(props: Props) { const handlePressDone = useHandler(() => setSorting(false)) return ( - + {({ insetStyles }) => ( <> diff --git a/src/components/scenes/WcConnectScene.tsx b/src/components/scenes/WcConnectScene.tsx index 86a8046a487..1b7ebea5e32 100644 --- a/src/components/scenes/WcConnectScene.tsx +++ b/src/components/scenes/WcConnectScene.tsx @@ -116,7 +116,7 @@ export const WcConnectScene = (props: Props) => { } return ( - + diff --git a/src/components/scenes/WcConnectionsScene.tsx b/src/components/scenes/WcConnectionsScene.tsx index cdf7001fdc5..045290db70c 100644 --- a/src/components/scenes/WcConnectionsScene.tsx +++ b/src/components/scenes/WcConnectionsScene.tsx @@ -89,7 +89,7 @@ export const WcConnectionsScene = (props: Props) => { } return ( - + {lstrings.wc_walletconnect_subtitle} diff --git a/src/components/scenes/WcDisconnectScene.tsx b/src/components/scenes/WcDisconnectScene.tsx index edddd3b346f..c10da07e5ba 100644 --- a/src/components/scenes/WcDisconnectScene.tsx +++ b/src/components/scenes/WcDisconnectScene.tsx @@ -39,7 +39,7 @@ export const WcDisconnectScene = (props: Props) => { } return ( - + diff --git a/src/components/scenes/WebViewScene.tsx b/src/components/scenes/WebViewScene.tsx index 41a5b54be87..9264e6ea3cd 100644 --- a/src/components/scenes/WebViewScene.tsx +++ b/src/components/scenes/WebViewScene.tsx @@ -15,7 +15,7 @@ export const WebViewScene = (props: Props) => { const { uri } = props.route.params return ( - + ) diff --git a/src/plugins/gui/scenes/AddressFormScene.tsx b/src/plugins/gui/scenes/AddressFormScene.tsx index 63a13a8152e..cfe39d12c36 100644 --- a/src/plugins/gui/scenes/AddressFormScene.tsx +++ b/src/plugins/gui/scenes/AddressFormScene.tsx @@ -250,7 +250,7 @@ export const AddressFormScene = React.memo((props: Props) => { key !== 'address2' && formData[key].trim() === '' ) return ( - + {({ insetStyles }) => ( <> diff --git a/src/plugins/gui/scenes/FiatPluginEnterAmountScene.tsx b/src/plugins/gui/scenes/FiatPluginEnterAmountScene.tsx index b4112432ed5..769bb970dc8 100644 --- a/src/plugins/gui/scenes/FiatPluginEnterAmountScene.tsx +++ b/src/plugins/gui/scenes/FiatPluginEnterAmountScene.tsx @@ -129,7 +129,7 @@ export const FiatPluginEnterAmountScene = React.memo((props: Props) => { const poweredByIconPath = poweredBy != null ? getPartnerIconUri(poweredBy.poweredByIcon) : undefined return ( - + {headerIcon} diff --git a/src/plugins/gui/scenes/FiatPluginWebView.tsx b/src/plugins/gui/scenes/FiatPluginWebView.tsx index d52af82d553..c9130bdd9db 100644 --- a/src/plugins/gui/scenes/FiatPluginWebView.tsx +++ b/src/plugins/gui/scenes/FiatPluginWebView.tsx @@ -28,7 +28,7 @@ export function FiatPluginWebViewComponent(props: Props): JSX.Element { }) return ( - + { )) return ( - + {promptMessage} diff --git a/src/plugins/gui/scenes/RewardsCardDashboardScene.tsx b/src/plugins/gui/scenes/RewardsCardDashboardScene.tsx index fa09711fc5d..ae4bfc6b5f3 100644 --- a/src/plugins/gui/scenes/RewardsCardDashboardScene.tsx +++ b/src/plugins/gui/scenes/RewardsCardDashboardScene.tsx @@ -53,7 +53,7 @@ export const RewardsCardDashboardScene = (props: Props) => { return ( <> - + { const { onMoreInfo, onNewCard } = props.route.params return ( - + diff --git a/src/plugins/gui/scenes/SepaFormScene.tsx b/src/plugins/gui/scenes/SepaFormScene.tsx index 2304a839587..5936f079a98 100644 --- a/src/plugins/gui/scenes/SepaFormScene.tsx +++ b/src/plugins/gui/scenes/SepaFormScene.tsx @@ -58,7 +58,7 @@ export const SepaFormScene = React.memo((props: Props) => { }, []) return ( - + {({ insetStyles }) => ( <> From 3fe970377ac74053d0633b1b11bd3539827d9ae5 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 5 Jan 2024 14:11:12 -0800 Subject: [PATCH 2/5] Remove unused `ClickableRow` props --- .../components/ClickableRow.test.tsx | 12 +-------- .../__snapshots__/ClickableRow.test.tsx.snap | 27 +++---------------- src/components/themed/ClickableRow.tsx | 24 +++-------------- 3 files changed, 8 insertions(+), 55 deletions(-) diff --git a/src/__tests__/components/ClickableRow.test.tsx b/src/__tests__/components/ClickableRow.test.tsx index 18a64572ff7..a07f188fbba 100644 --- a/src/__tests__/components/ClickableRow.test.tsx +++ b/src/__tests__/components/ClickableRow.test.tsx @@ -12,17 +12,7 @@ describe('ClickableRow', () => { const fakeChild: React.ReactNode = 'String' const actual = renderer.render( - undefined} - onLongPress={() => undefined} - highlight - gradient - autoHeight - underline - marginRem={11} - paddingRem={11} - theme={getTheme()} - > + undefined} onLongPress={() => undefined} autoHeight underline marginRem={11} paddingRem={11} theme={getTheme()}> {fakeChild} ) diff --git a/src/__tests__/components/__snapshots__/ClickableRow.test.tsx.snap b/src/__tests__/components/__snapshots__/ClickableRow.test.tsx.snap index b5f89c46d61..86af128cd8b 100644 --- a/src/__tests__/components/__snapshots__/ClickableRow.test.tsx.snap +++ b/src/__tests__/components/__snapshots__/ClickableRow.test.tsx.snap @@ -1,31 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ClickableRow should render with loading props 1`] = ` - - String - - + + `; diff --git a/src/components/themed/ClickableRow.tsx b/src/components/themed/ClickableRow.tsx index 379a39b7a07..d17afd52ed8 100644 --- a/src/components/themed/ClickableRow.tsx +++ b/src/components/themed/ClickableRow.tsx @@ -1,6 +1,5 @@ import * as React from 'react' -import { TouchableHighlight, TouchableOpacity, View } from 'react-native' -import LinearGradient from 'react-native-linear-gradient' +import { TouchableOpacity, View } from 'react-native' import { fixSides, mapSides, sidesToMargin, sidesToPadding } from '../../util/sides' import { showError } from '../services/AirshipInstance' @@ -9,8 +8,6 @@ import { cacheStyles, Theme, ThemeProps, withTheme } from '../services/ThemeCont interface Props { onPress: () => void | Promise onLongPress?: () => void | Promise - highlight?: boolean - gradient?: boolean autoHeight?: boolean children?: React.ReactNode underline?: boolean @@ -21,7 +18,7 @@ interface Props { export class ClickableRowComponent extends React.PureComponent { renderContent() { - const { gradient, children, marginRem, paddingRem, underline, autoHeight, theme } = this.props + const { children, marginRem, paddingRem, underline, autoHeight, theme } = this.props const styles = getStyles(theme) const margin = sidesToMargin(mapSides(fixSides(marginRem, 0), theme.rem)) const padding = sidesToPadding(mapSides(fixSides(paddingRem, 0), theme.rem)) @@ -36,13 +33,6 @@ export class ClickableRowComponent extends React.PureComponent - {children} - - ) - } return {children} } @@ -53,15 +43,7 @@ export class ClickableRowComponent extends React.PureComponent - {this.renderContent()} - - ) - } + const { onLongPress } = this.props return ( From 65517d35fd7648d112c0514f2211ca945bd7d9c9 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 5 Jan 2024 14:18:47 -0800 Subject: [PATCH 3/5] Remove unused `Theme.backgroundLoadingOverlay` --- src/theme/variables/edgeDark.ts | 1 - src/theme/variables/edgeLight.ts | 1 - src/theme/variables/testDark.ts | 1 - src/theme/variables/testLight.ts | 1 - src/types/Theme.ts | 1 - 5 files changed, 5 deletions(-) diff --git a/src/theme/variables/edgeDark.ts b/src/theme/variables/edgeDark.ts index c36029d8c0e..93b8d6b245f 100644 --- a/src/theme/variables/edgeDark.ts +++ b/src/theme/variables/edgeDark.ts @@ -133,7 +133,6 @@ export const edgeDark: Theme = { backgroundGradientEnd: { x: 1, y: 0 }, backgroundImageServerUrls: ['https://content.edge.app'], backgroundImage: undefined, - backgroundLoadingOverlay: 'rgba(123,123,123,.2)', // Camera Overlay cameraOverlayColor: palette.black, diff --git a/src/theme/variables/edgeLight.ts b/src/theme/variables/edgeLight.ts index f3e3620db45..1dd45f85ac7 100644 --- a/src/theme/variables/edgeLight.ts +++ b/src/theme/variables/edgeLight.ts @@ -127,7 +127,6 @@ export const edgeLight: Theme = { backgroundGradientEnd: { x: 0, y: 1 }, backgroundImageServerUrls: ['https://content.edge.app'], backgroundImage: undefined, - backgroundLoadingOverlay: `rgba(123,123,123,.2)`, // Camera Overlay cameraOverlayColor: palette.gray, diff --git a/src/theme/variables/testDark.ts b/src/theme/variables/testDark.ts index 94f6261875f..1cc5e094da7 100644 --- a/src/theme/variables/testDark.ts +++ b/src/theme/variables/testDark.ts @@ -133,7 +133,6 @@ export const testDark: Theme = { backgroundGradientEnd: { x: 1, y: 0 }, backgroundImageServerUrls: ['https://content.edge.app'], backgroundImage: undefined, - backgroundLoadingOverlay: 'rgba(123,123,123,.2)', // Camera Overlay cameraOverlayColor: palette.black, diff --git a/src/theme/variables/testLight.ts b/src/theme/variables/testLight.ts index ca25ed94376..2ecab10f246 100644 --- a/src/theme/variables/testLight.ts +++ b/src/theme/variables/testLight.ts @@ -127,7 +127,6 @@ export const testLight: Theme = { backgroundGradientEnd: { x: 0, y: 1 }, backgroundImageServerUrls: ['https://content.edge.app'], backgroundImage: undefined, - backgroundLoadingOverlay: `rgba(123,123,123,.2)`, // Camera Overlay cameraOverlayColor: palette.gray, diff --git a/src/types/Theme.ts b/src/types/Theme.ts index 9043d91172e..65afb5881b4 100644 --- a/src/types/Theme.ts +++ b/src/types/Theme.ts @@ -91,7 +91,6 @@ export interface Theme { backgroundImageServerUrls: string[] backgroundImage?: ImageProp - backgroundLoadingOverlay: string // Camera Overlay cameraOverlayColor: string From f74c1ee808367c204343199c2e3782a0e100a702 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 5 Jan 2024 13:42:17 -0800 Subject: [PATCH 4/5] Remove login background image support --- src/assets/images/backgrounds/login_bg.jpg | Bin 11857 -> 0 bytes src/components/scenes/LoginScene.tsx | 13 +--- src/theme/variables/edgeDark.ts | 2 - src/theme/variables/edgeLight.ts | 2 - src/theme/variables/testDark.ts | 2 - src/theme/variables/testLight.ts | 2 - src/types/Theme.ts | 3 - src/util/ThemeCache.ts | 81 --------------------- src/util/utils.ts | 5 -- 9 files changed, 1 insertion(+), 109 deletions(-) delete mode 100644 src/assets/images/backgrounds/login_bg.jpg delete mode 100644 src/util/ThemeCache.ts diff --git a/src/assets/images/backgrounds/login_bg.jpg b/src/assets/images/backgrounds/login_bg.jpg deleted file mode 100644 index 7117bea42f8bf9f808d11813cd2220cc58cac466..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11857 zcmbWddmvNs|37}Vxh@P@?j|WS-H7PI7P*VL%)MNbODaSmHVL)da;xOBTyiHOmqMl7 z%AF~>E7y?AT*kKV(fjlHe81n{U%%h)#m-*a*>=wJ@w{JH-&x}Tzk!av4gi4wfFAe< zuqFVU_FWG*0JwAszyJWi1wf)a05)(3egqH$9{>QQK>zz42#x~#pZ)mWN!B8uhIhYt z`=+1!&0Er^j-Le7H1#jB?fn9{{_PL{+w%8IM*oNdD%j>o+|T}OX@;^s00LZ)aR?3u zkpZ9r5SRdj^%+2cS7wL&TmQZW9w1N{8#@Ol7dLz#_<<^Z01AP@plmR9_PxtMLcsF? zn*h7uLB$Ik`%RrVWqgE`!k)b3I;2_t5oy-*SN4>%?|p9g0bvnQvBO8?(DE2%mD8$f zXU=L})Yj3}(>E};AXr*i+t|9eUUj?X?&0Zo+dtsW-N2ym2N97`4J)57I^#*W&aPl1VFl=Y-}(#&ON#y&^vpC3$U>tROA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^XU;6= z2+_vr@F8r`P^(+Q=%%@94$84FoVlt(z_rx0^NxQrGgSo9ay&j}%0}6DOy|!C0m>0I z0D9x);k#X&VDbOMfrGd(async () => { - const url = pickRandom(theme.backgroundImageServerUrls) - return await getBackgroundImage(disklet, url, theme.backgroundImage) - }, [disklet, theme]) - React.useEffect(() => { const { YOLO_USERNAME, YOLO_PASSWORD, YOLO_PIN } = ENV if (YOLO_USERNAME != null && (Boolean(YOLO_PASSWORD) || Boolean(YOLO_PIN)) && firstRun) { @@ -198,7 +189,6 @@ export function LoginSceneComponent(props: Props) { appConfig={config} appId={config.appId} appName={config.appNameShort} - backgroundImage={backgroundImage} context={context} fontDescription={fontDescription} initialLoginId={nextLoginId ?? undefined} @@ -231,8 +221,7 @@ const dummyTouchIdInfo: GuiTouchIdInfo = { const getStyles = cacheStyles((theme: Theme) => ({ container: { flex: 1, - paddingTop: StatusBar.currentHeight, - backgroundColor: theme.backgroundGradientColors[0] + paddingTop: StatusBar.currentHeight } })) diff --git a/src/theme/variables/edgeDark.ts b/src/theme/variables/edgeDark.ts index 93b8d6b245f..d1dbeb84e01 100644 --- a/src/theme/variables/edgeDark.ts +++ b/src/theme/variables/edgeDark.ts @@ -131,8 +131,6 @@ export const edgeDark: Theme = { backgroundGradientColors: [palette.darkestNavy, palette.darkAqua], backgroundGradientStart: { x: 0, y: 0 }, backgroundGradientEnd: { x: 1, y: 0 }, - backgroundImageServerUrls: ['https://content.edge.app'], - backgroundImage: undefined, // Camera Overlay cameraOverlayColor: palette.black, diff --git a/src/theme/variables/edgeLight.ts b/src/theme/variables/edgeLight.ts index 1dd45f85ac7..1483d44c949 100644 --- a/src/theme/variables/edgeLight.ts +++ b/src/theme/variables/edgeLight.ts @@ -125,8 +125,6 @@ export const edgeLight: Theme = { backgroundGradientColors: [palette.lightestGray, palette.lightestGray], backgroundGradientStart: { x: 0, y: 0 }, backgroundGradientEnd: { x: 0, y: 1 }, - backgroundImageServerUrls: ['https://content.edge.app'], - backgroundImage: undefined, // Camera Overlay cameraOverlayColor: palette.gray, diff --git a/src/theme/variables/testDark.ts b/src/theme/variables/testDark.ts index 1cc5e094da7..9806bdb4d12 100644 --- a/src/theme/variables/testDark.ts +++ b/src/theme/variables/testDark.ts @@ -131,8 +131,6 @@ export const testDark: Theme = { backgroundGradientColors: [palette.darkestNavy, palette.darkAqua], backgroundGradientStart: { x: 0, y: 0 }, backgroundGradientEnd: { x: 1, y: 0 }, - backgroundImageServerUrls: ['https://content.edge.app'], - backgroundImage: undefined, // Camera Overlay cameraOverlayColor: palette.black, diff --git a/src/theme/variables/testLight.ts b/src/theme/variables/testLight.ts index 2ecab10f246..acce394bff9 100644 --- a/src/theme/variables/testLight.ts +++ b/src/theme/variables/testLight.ts @@ -125,8 +125,6 @@ export const testLight: Theme = { backgroundGradientColors: [palette.lightestGray, palette.lightestGray], backgroundGradientStart: { x: 0, y: 0 }, backgroundGradientEnd: { x: 0, y: 1 }, - backgroundImageServerUrls: ['https://content.edge.app'], - backgroundImage: undefined, // Camera Overlay cameraOverlayColor: palette.gray, diff --git a/src/types/Theme.ts b/src/types/Theme.ts index 65afb5881b4..1fb844dfc2f 100644 --- a/src/types/Theme.ts +++ b/src/types/Theme.ts @@ -89,9 +89,6 @@ export interface Theme { backgroundGradientStart: { x: number; y: number } backgroundGradientEnd: { x: number; y: number } - backgroundImageServerUrls: string[] - backgroundImage?: ImageProp - // Camera Overlay cameraOverlayColor: string cameraOverlayOpStart: number diff --git a/src/util/ThemeCache.ts b/src/util/ThemeCache.ts deleted file mode 100644 index 8f0bb88da36..00000000000 --- a/src/util/ThemeCache.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { asDate, asObject, uncleaner } from 'cleaners' -import { Disklet } from 'disklet' -import RNFS from 'react-native-fs' - -import { BACKGROUND_IMAGE_FILE_NAME, BACKGROUND_IMAGE_LOCAL_URI } from '../constants/CdnConstants' -import { ImageProp } from '../types/Theme' - -const THEME_CACHE_FILE_NAME = 'themeCache.json' - -const asThemeCache = asObject({ - assets: asObject( - asObject({ - start: asDate, - expiration: asDate - }) - ) -}) -const wasThemeCache = uncleaner(asThemeCache) -type ThemeCache = ReturnType - -interface ItemTimestamps { - start: Date - expiration: Date -} - -async function getThemeCache(disklet: Disklet): Promise { - const data = await disklet.getText(THEME_CACHE_FILE_NAME) - return asThemeCache(JSON.parse(data)) -} - -async function setThemeCache(disklet: Disklet, data: ThemeCache): Promise { - const text = JSON.stringify(wasThemeCache(data)) - await disklet.setText(THEME_CACHE_FILE_NAME, text) -} - -const getThemeItemTimestamps = async (url: string): Promise => { - const response = await fetch(url, { method: 'HEAD' }) - const start = response.headers.get('x-amz-meta-start-date') // '2021-08-26T01:37:50Z' - const expiration = response.headers.get('x-amz-meta-expiration-date') // '2021-08-29T01:37:50Z' - if (start == null || expiration == null) throw new Error('Failed to find file on CDN') - return { start: new Date(start), expiration: new Date(expiration) } -} - -const downloadFile = async (disklet: Disklet, fromUrl: string, toFile: string): Promise => { - // See if the server even has an image for us in the first place: - const cache: ThemeCache = await getThemeCache(disklet).catch(() => ({ assets: {} })) - const { start, expiration } = await getThemeItemTimestamps(fromUrl) - if (expiration.valueOf() < Date.now()) { - delete cache.assets[fromUrl] - await setThemeCache(disklet, cache) - return - } - const cacheTimes = cache.assets[fromUrl] - if (cacheTimes != null && cacheTimes.start.valueOf() === start.valueOf() && cacheTimes.expiration.valueOf() === expiration.valueOf()) return - - // Download file whenever local file timestamps do not equal remote file timestamps - const download = RNFS.downloadFile({ fromUrl, toFile }) - const status = await download.promise - if (status.statusCode !== 200) throw new Error('Failed to download') - cache.assets[fromUrl] = { start, expiration } - await setThemeCache(disklet, cache) -} - -export async function getBackgroundImage(disklet: Disklet, imageServer?: string | null, fallback?: ImageProp): Promise { - if (imageServer == null) return fallback - const backgroundImageUrl = `${imageServer}/${BACKGROUND_IMAGE_FILE_NAME}` - const now = Date.now() - - let image = fallback - - const cache: ThemeCache = await getThemeCache(disklet).catch(() => ({ assets: {} })) - const cacheTimes = cache.assets[backgroundImageUrl] - if (cacheTimes != null && cacheTimes.start.valueOf() < now && cacheTimes.expiration.valueOf() > now && (await RNFS.exists(BACKGROUND_IMAGE_LOCAL_URI))) { - image = { uri: BACKGROUND_IMAGE_LOCAL_URI } - } - // Always return existing local file but query and download new remote file in the background - downloadFile(disklet, backgroundImageUrl, BACKGROUND_IMAGE_LOCAL_URI).catch(() => { - console.warn(`Error downloading from background image server ${backgroundImageUrl} to ${BACKGROUND_IMAGE_LOCAL_URI}`) - }) - return image -} diff --git a/src/util/utils.ts b/src/util/utils.ts index b565f1a9289..714a0b93cbf 100644 --- a/src/util/utils.ts +++ b/src/util/utils.ts @@ -519,11 +519,6 @@ export const shuffleArray = (array: T[]): T[] => { return array } -export const pickRandom = (array?: T[]): T | null => { - if (array == null || array.length === 0) return null - return array[Math.floor(Math.random() * array.length)] -} - /** * Waits for a collection of promises. * Returns all the promises that manage to resolve within the timeout. From 017d659e9f6450cc5842d92343922267d2b55fb9 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Thu, 4 Jan 2024 11:39:12 -0800 Subject: [PATCH 5/5] Replace the gradient background with blurred dots --- .../__snapshots__/CategoryModal.test.tsx.snap | 4 +- ...reateWalletAccountSetupScene.test.tsx.snap | 214 +- .../CreateWalletImportScene.test.tsx.snap | 214 +- ...reateWalletSelectCryptoScene.test.tsx.snap | 214 +- .../CreateWalletSelectFiatScene.test.tsx.snap | 215 +- .../CryptoExchangeQuoteScene.test.tsx.snap | 214 +- .../CurrencyNotificationScene.test.tsx.snap | 214 +- .../CurrencySettings.ui.test.tsx.snap | 214 +- .../EdgeLoginScene.test.tsx.snap | 214 +- .../__snapshots__/SendScene2.ui.test.tsx.snap | 2156 +++++++++++++++-- .../__snapshots__/SettingsScene.test.tsx.snap | 428 +++- .../TransactionDetailsScene.test.tsx.snap | 428 +++- src/components/FioAddress/ConnectWallets.tsx | 2 - src/components/Main.tsx | 2 +- src/components/buttons/MinimalButton.tsx | 2 +- src/components/common/SceneWrapper.tsx | 21 +- .../LoadingSplashScreen.tsx | 11 +- .../scenes/CreateWalletSelectFiatScene.tsx | 3 +- .../scenes/DefaultFiatSettingScene.tsx | 3 +- src/components/scenes/LoginScene.tsx | 2 + .../scenes/MigrateWalletCalculateFeeScene.tsx | 7 - .../scenes/TransactionListScene.tsx | 12 +- src/components/ui4/DotsBackground.tsx | 95 + src/theme/variables/edgeDark.ts | 39 +- src/theme/variables/edgeLight.ts | 16 +- src/theme/variables/testDark.ts | 39 +- src/theme/variables/testLight.ts | 16 +- src/types/Theme.ts | 20 +- 28 files changed, 4383 insertions(+), 636 deletions(-) create mode 100644 src/components/ui4/DotsBackground.tsx diff --git a/src/__tests__/modals/__snapshots__/CategoryModal.test.tsx.snap b/src/__tests__/modals/__snapshots__/CategoryModal.test.tsx.snap index e1faa0ae7c4..dde7368e264 100644 --- a/src/__tests__/modals/__snapshots__/CategoryModal.test.tsx.snap +++ b/src/__tests__/modals/__snapshots__/CategoryModal.test.tsx.snap @@ -182,7 +182,7 @@ exports[`CategoryModal should render with a subcategory 1`] = ` numberOfLines={1} style={ { - "color": "#06090c", + "color": "#1a1a1a", "fontFamily": "Quicksand-Bold", "fontSize": 14, "marginHorizontal": 7, @@ -1451,7 +1451,7 @@ exports[`CategoryModal should render with an empty subcategory 1`] = ` numberOfLines={1} style={ { - "color": "#06090c", + "color": "#1a1a1a", "fontFamily": "Quicksand-Bold", "fontSize": 14, "marginHorizontal": 7, diff --git a/src/__tests__/scenes/__snapshots__/CreateWalletAccountSetupScene.test.tsx.snap b/src/__tests__/scenes/__snapshots__/CreateWalletAccountSetupScene.test.tsx.snap index 21987263a8c..8b73ae8c5fc 100644 --- a/src/__tests__/scenes/__snapshots__/CreateWalletAccountSetupScene.test.tsx.snap +++ b/src/__tests__/scenes/__snapshots__/CreateWalletAccountSetupScene.test.tsx.snap @@ -2,36 +2,198 @@ exports[`CreateWalletAccountSelect renders 1`] = ` [ - + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , , + + + + + + + + + + + + + + + , + + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , + , + vbHeight={0} + vbWidth={0} + width={0} + > + + + + + + + + + + + + + + , ({ color: theme.secondaryText }, bottomSection: { - flex: 1, - backgroundColor: theme.backgroundGradientColors[1], padding: theme.rem(1) }, btnDisabled: { diff --git a/src/components/Main.tsx b/src/components/Main.tsx index 423cf2f9d71..2194cd4f3d2 100644 --- a/src/components/Main.tsx +++ b/src/components/Main.tsx @@ -239,7 +239,7 @@ export const Main = () => { ...DefaultTheme, colors: { ...DefaultTheme.colors, - background: theme.backgroundGradientColors[0] + background: theme.background.color } } }, [theme]) diff --git a/src/components/buttons/MinimalButton.tsx b/src/components/buttons/MinimalButton.tsx index 0c61b05a439..288350f63ab 100644 --- a/src/components/buttons/MinimalButton.tsx +++ b/src/components/buttons/MinimalButton.tsx @@ -95,7 +95,7 @@ const getStyles = cacheStyles((theme: Theme) => { }, labelSelected: { ...labelCommon, - color: theme.backgroundGradientColors[0] + color: theme.background.color }, labelDisabled: { ...labelCommon, diff --git a/src/components/common/SceneWrapper.tsx b/src/components/common/SceneWrapper.tsx index d775abaf44a..cb66647eb1f 100644 --- a/src/components/common/SceneWrapper.tsx +++ b/src/components/common/SceneWrapper.tsx @@ -3,16 +3,15 @@ import { useNavigation } from '@react-navigation/native' import * as React from 'react' import { useMemo } from 'react' import { Animated, ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native' -import LinearGradient from 'react-native-linear-gradient' import { EdgeInsets, useSafeAreaFrame, useSafeAreaInsets } from 'react-native-safe-area-context' import { useSelector } from '../../types/reactRedux' import { NavigationBase } from '../../types/routerTypes' import { maybeComponent } from '../hoc/maybeComponent' -import { styled } from '../hoc/styled' import { NotificationView } from '../notification/NotificationView' import { useTheme } from '../services/ThemeContext' import { MAX_TAB_BAR_HEIGHT } from '../themed/MenuTabs' +import { DotsBackground } from '../ui4/DotsBackground' import { KeyboardTracker } from './KeyboardTracker' export interface InsetStyles { @@ -36,8 +35,8 @@ interface SceneWrapperProps { // to changes to the info. children: React.ReactNode | ((info: SceneWrapperInfo) => React.ReactNode) - // Settings for when using ScrollView - keyboardShouldPersistTaps?: 'always' | 'never' | 'handled' + // Adjusts the blurred dots background: + accentColor?: string // True if this scene should shrink to avoid the keyboard: avoidKeyboard?: boolean @@ -51,6 +50,9 @@ interface SceneWrapperProps { // True if this scene has a bottom tab bar: hasTabs?: boolean + // Settings for when using ScrollView + keyboardShouldPersistTaps?: 'always' | 'never' | 'handled' + // Padding to add inside the scene border: padding?: number @@ -73,6 +75,7 @@ interface SceneWrapperProps { */ export function SceneWrapper(props: SceneWrapperProps): JSX.Element { const { + accentColor, avoidKeyboard = false, children, hasHeader = true, @@ -141,7 +144,7 @@ export function SceneWrapper(props: SceneWrapperProps): JSX.Element { return ( - + { const theme = useTheme() return ( - + + - + ) } -const StyledLinearGradient = styled(LinearGradient)({ +const ViewContainer = styled(View)({ flex: 1, alignItems: 'center', justifyContent: 'center' diff --git a/src/components/scenes/CreateWalletSelectFiatScene.tsx b/src/components/scenes/CreateWalletSelectFiatScene.tsx index 35cc2f3023d..a6a7a0a3c24 100644 --- a/src/components/scenes/CreateWalletSelectFiatScene.tsx +++ b/src/components/scenes/CreateWalletSelectFiatScene.tsx @@ -239,8 +239,7 @@ const getStyles = cacheStyles((theme: Theme) => ({ width: theme.rem(2), height: theme.rem(2), borderRadius: theme.rem(1), - marginLeft: theme.rem(0.25), - backgroundColor: theme.backgroundGradientColors[1] + marginLeft: theme.rem(0.25) }, instructionalText: { fontSize: theme.rem(0.75), diff --git a/src/components/scenes/DefaultFiatSettingScene.tsx b/src/components/scenes/DefaultFiatSettingScene.tsx index 0fec4dcd519..6eae537fd50 100644 --- a/src/components/scenes/DefaultFiatSettingScene.tsx +++ b/src/components/scenes/DefaultFiatSettingScene.tsx @@ -146,8 +146,7 @@ const getStyles = cacheStyles((theme: Theme) => ({ width: theme.rem(2), height: theme.rem(2), borderRadius: theme.rem(1), - marginLeft: theme.rem(0.25), - backgroundColor: theme.backgroundGradientColors[1] + marginLeft: theme.rem(0.25) } })) diff --git a/src/components/scenes/LoginScene.tsx b/src/components/scenes/LoginScene.tsx index 209d2d8aa0d..ba57638b980 100644 --- a/src/components/scenes/LoginScene.tsx +++ b/src/components/scenes/LoginScene.tsx @@ -26,6 +26,7 @@ import { withServices } from '../hoc/withServices' import { showHelpModal } from '../modals/HelpModal' import { UpdateModal } from '../modals/UpdateModal' import { Airship, showError } from '../services/AirshipInstance' +import { DotsBackground } from '../ui4/DotsBackground' import { LoadingScene } from './LoadingScene' // Sneak the BlurView over to the login UI: @@ -183,6 +184,7 @@ export function LoginSceneComponent(props: Props) { ) : ( + ({ content: { flex: 1 }, - cryptoTypeLogo: { - width: theme.rem(2), - height: theme.rem(2), - borderRadius: theme.rem(1), - marginLeft: theme.rem(0.25), - backgroundColor: theme.backgroundGradientColors[1] - }, instructionalText: { color: theme.primaryText, fontSize: theme.rem(0.75), diff --git a/src/components/scenes/TransactionListScene.tsx b/src/components/scenes/TransactionListScene.tsx index b6bc2fc24c1..c4b52d1e4f4 100644 --- a/src/components/scenes/TransactionListScene.tsx +++ b/src/components/scenes/TransactionListScene.tsx @@ -57,7 +57,8 @@ function TransactionListComponent(props: Props) { const [searchText, setSearchText] = React.useState('') const [assetStatuses, setAssetStatuses] = React.useState([]) const [iconColor, setIconColor] = React.useState() - const backgroundGradientColor = iconColor == null ? '#00000000' : `${iconColor}44` + const transparentBackground = `${theme.background.color}00` + const backgroundGradientColor = iconColor == null ? transparentBackground : `${iconColor}44` // Selectors: const exchangeDenom = useSelector(state => getExchangeDenomination(state, pluginId, currencyCode)) @@ -248,10 +249,15 @@ function TransactionListComponent(props: Props) { }) return ( - + {({ insetStyles }) => ( <> - + {SHOW_FLIP_INPUT_TESTER ? ( ) : ( diff --git a/src/components/ui4/DotsBackground.tsx b/src/components/ui4/DotsBackground.tsx new file mode 100644 index 00000000000..09d7fa23c4b --- /dev/null +++ b/src/components/ui4/DotsBackground.tsx @@ -0,0 +1,95 @@ +import * as React from 'react' +import { LayoutChangeEvent, StyleSheet, View } from 'react-native' +import { Circle, Defs, G, RadialGradient, Stop, Svg } from 'react-native-svg' + +import { useHandler } from '../../hooks/useHandler' +import { ThemeDot } from '../../types/Theme' +import { useTheme } from '../services/ThemeContext' + +interface Props { + accentColor?: string +} + +export function DotsBackground(props: Props): JSX.Element { + const { accentColor } = props + const theme = useTheme() + const { blurRadius, color, dotOpacity, dots } = theme.background + + const accentDots: ThemeDot[] = [] + for (const dot of dots) { + if (accentColor == null || dot.accent === 'keep') { + accentDots.push(dot) + } else if (dot.accent == null) { + accentDots.push({ ...dot, color: accentColor }) + } + } + + const [{ width, height }, setLayout] = React.useState(cachedLayout) + const handleLayout = useHandler((event: LayoutChangeEvent) => { + cachedLayout = event.nativeEvent.layout + setLayout(event.nativeEvent.layout) + }) + + /** + * We are simulating the blur using a radial gradient, + * since it's cheaper and looks better. + * + * To do this, we slice a ring off the outside of each dot and + * replace it with the gradient. The sliced-off ring has a width of blurR, + * and the gradient ring has a width of 2 * blurR. + * This means the circle radius will expand by blurR. + * + * If the circle is smaller than blurR, + * then we can't slice off a big enough ring, + * so we reduce the opacity towards 0 to compensate. + */ + function renderGradient(circle: ThemeDot, key: number): JSX.Element { + const innerR = (circle.r - blurRadius) / blurRadius + const totalR = 2 + Math.max(0, innerR) + const dimming = 1 + Math.min(0, innerR) + + const stops = samples.map(([offset, opacity], key) => ( + + )) + if (innerR > 0) { + stops.unshift() + } + + return ( + + {stops} + + ) + } + + function renderCircle(circle: ThemeDot, key: number): JSX.Element { + const innerR = circle.r - blurRadius + const totalR = 2 * blurRadius + Math.max(0, innerR) + + return + } + + return ( + + + {accentDots.map(renderGradient)} + {accentDots.map(renderCircle)} + + + ) +} + +let cachedLayout = { width: 0, height: 0 } + +function percent(ratio: number): string { + return (100 * ratio).toFixed(2) + '%' +} + +const samples = [ + [0, 1], + [0.25, 0.96], + [0.5, 0.85], + [1.5, 0.15], + [1.75, 0.04], + [2, 0] +] diff --git a/src/theme/variables/edgeDark.ts b/src/theme/variables/edgeDark.ts index d1dbeb84e01..eabb5044607 100644 --- a/src/theme/variables/edgeDark.ts +++ b/src/theme/variables/edgeDark.ts @@ -82,6 +82,11 @@ const palette = { learnMiddle: 'rgba(0, 81, 92, .44)', learnRight: 'rgba(0, 245, 155, .44)', + // Background: + backgroundBlack: '#1a1a1a', + backgroundGreen: '#00e084', + backgroundYellow: '#fcb329', + // Button graySecondary: 'hsla(0, 0%, 100%, 0.20)', @@ -127,10 +132,36 @@ export const edgeDark: Theme = { loadingIcon: palette.edgeMint, // Background - // backgroundGradientColors: [palette.navyAqua, palette.navyAquaDarker], // For vertical gradient - backgroundGradientColors: [palette.darkestNavy, palette.darkAqua], - backgroundGradientStart: { x: 0, y: 0 }, - backgroundGradientEnd: { x: 1, y: 0 }, + background: { + blurRadius: scale(80), + color: palette.backgroundBlack, + dotOpacity: 0.25, + dots: [ + { + // Top-left: + accent: 'keep', + color: palette.white, + cx: '10%', + cy: '10%', + r: scale(80) + }, + { + // Mid-right: + color: palette.backgroundYellow, + cx: '95%', + cy: '30%', + r: scale(90) + }, + { + // Bottom-left: + accent: 'drop', + color: palette.backgroundGreen, + cx: '-15%', + cy: '100%', + r: scale(220) + } + ] + }, // Camera Overlay cameraOverlayColor: palette.black, diff --git a/src/theme/variables/edgeLight.ts b/src/theme/variables/edgeLight.ts index 1483d44c949..f5ef80b4ef6 100644 --- a/src/theme/variables/edgeLight.ts +++ b/src/theme/variables/edgeLight.ts @@ -77,6 +77,10 @@ const palette = { learnMiddle: 'rgba(0, 81, 92, .44)', learnRight: 'rgba(0, 245, 155, .44)', + // Background + backgroundGreen: '#15cb7f', + backgroundPurple: '#7f15cb', + // Button graySecondary: 'hsla(0, 0%, 100%, 0.20)', @@ -122,9 +126,15 @@ export const edgeLight: Theme = { loadingIcon: palette.edgeBlue, // Background - backgroundGradientColors: [palette.lightestGray, palette.lightestGray], - backgroundGradientStart: { x: 0, y: 0 }, - backgroundGradientEnd: { x: 0, y: 1 }, + background: { + blurRadius: scale(80), + color: palette.lightestGray, + dotOpacity: 0.3, + dots: [ + { color: palette.backgroundGreen, cx: '75%', cy: '25%', r: scale(175) }, + { color: palette.backgroundPurple, cx: '25%', cy: '75%', r: scale(150), accent: 'keep' } + ] + }, // Camera Overlay cameraOverlayColor: palette.gray, diff --git a/src/theme/variables/testDark.ts b/src/theme/variables/testDark.ts index 9806bdb4d12..11542a43458 100644 --- a/src/theme/variables/testDark.ts +++ b/src/theme/variables/testDark.ts @@ -82,6 +82,11 @@ const palette = { learnMiddle: 'rgba(0, 81, 92, .44)', learnRight: 'rgba(0, 245, 155, .44)', + // Background: + backgroundBlack: '#1a1a1a', + backgroundGreen: '#00e084', + backgroundYellow: '#fcb329', + // Button graySecondary: 'hsla(0, 0%, 100%, 0.20)', @@ -127,10 +132,36 @@ export const testDark: Theme = { loadingIcon: palette.edgeMint, // Background - // backgroundGradientColors: [palette.navyAqua, palette.navyAquaDarker], // For vertical gradient - backgroundGradientColors: [palette.darkestNavy, palette.darkAqua], - backgroundGradientStart: { x: 0, y: 0 }, - backgroundGradientEnd: { x: 1, y: 0 }, + background: { + blurRadius: scale(80), + color: palette.backgroundBlack, + dotOpacity: 0.25, + dots: [ + { + // Top-left: + accent: 'keep', + color: palette.white, + cx: '10%', + cy: '10%', + r: scale(80) + }, + { + // Mid-right: + color: palette.backgroundYellow, + cx: '95%', + cy: '30%', + r: scale(90) + }, + { + // Bottom-left: + accent: 'drop', + color: palette.backgroundGreen, + cx: '-15%', + cy: '100%', + r: scale(220) + } + ] + }, // Camera Overlay cameraOverlayColor: palette.black, diff --git a/src/theme/variables/testLight.ts b/src/theme/variables/testLight.ts index acce394bff9..904eb1656cb 100644 --- a/src/theme/variables/testLight.ts +++ b/src/theme/variables/testLight.ts @@ -77,6 +77,10 @@ const palette = { learnMiddle: 'rgba(0, 81, 92, .44)', learnRight: 'rgba(0, 245, 155, .44)', + // Background + backgroundGreen: '#15cb7f', + backgroundPurple: '#7f15cb', + // Button graySecondary: 'hsla(0, 0%, 100%, 0.20)', @@ -122,9 +126,15 @@ export const testLight: Theme = { loadingIcon: palette.edgeBlue, // Background - backgroundGradientColors: [palette.lightestGray, palette.lightestGray], - backgroundGradientStart: { x: 0, y: 0 }, - backgroundGradientEnd: { x: 0, y: 1 }, + background: { + blurRadius: scale(80), + color: palette.lightestGray, + dotOpacity: 0.3, + dots: [ + { color: palette.backgroundGreen, cx: '75%', cy: '25%', r: scale(175) }, + { color: palette.backgroundPurple, cx: '25%', cy: '75%', r: scale(150) } + ] + }, // Camera Overlay cameraOverlayColor: palette.gray, diff --git a/src/types/Theme.ts b/src/types/Theme.ts index 1fb844dfc2f..5afc844cfb7 100644 --- a/src/types/Theme.ts +++ b/src/types/Theme.ts @@ -2,6 +2,17 @@ import { asNumber, asObject } from 'cleaners' export type ImageProp = { uri: string } | number +export interface ThemeDot { + // The accent color will override the dot color when it is present. + // To change this behavior, use 'keep' to preserve the dot color or + // 'drop' to remove the dot completely: + accent?: 'keep' | 'drop' + color: string + cx: number | string + cy: number | string + r: number +} + interface ThemeGradientParams { colors: string[] start: GradientCoords @@ -85,9 +96,12 @@ export interface Theme { loadingIcon: string // Background - backgroundGradientColors: string[] - backgroundGradientStart: { x: number; y: number } - backgroundGradientEnd: { x: number; y: number } + background: { + blurRadius: number + color: string // Never include an alpha here + dotOpacity: number + dots: ThemeDot[] + } // Camera Overlay cameraOverlayColor: string