FIX: dark mode theme, update alert dialogs, and UI consistency improvements#72
FIX: dark mode theme, update alert dialogs, and UI consistency improvements#72chaitika wants to merge 2 commits into
Conversation
…and import screen layout
There was a problem hiding this comment.
Pull request overview
This PR focuses on dark-mode/light-mode behavior and UI consistency by updating theme selection at the app level, introducing a custom alert modal, and aligning several UI elements with updated brand colors.
Changes:
- Switch
NavigationContainertheme dynamically based on device color scheme. - Add a
CustomAlertmodal and wire it into the existingpresentAlertwrapper (Android path). - Update wallet deletion confirmation copy and a few UI elements (spinners, ImportWallet layout).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
App.tsx |
Uses useColorScheme() to select dark/light theme; wires CustomAlert ref into presentAlert. |
components/Alert.ts |
Adds a global customAlertRef and routes Android alerts through CustomAlert when available. |
components/CustomAlert.tsx |
New custom modal implementation that renders title/message/buttons styled by theme. |
components/themes.ts |
Updates dark theme button color and adds brand color entries. |
loc/en.json |
Updates wallet deletion-related strings. |
screen/settings/DeleteWallet.tsx |
Migrates deletion prompts from Alert.alert() to presentAlert. |
screen/wallets/ImportWallet.tsx |
Adjusts layout styling to fix dark-mode background issue. |
screen/UnlockWith.tsx |
Updates spinner color to match brand color. |
navigation/LazyLoadingIndicator.tsx |
Updates spinner color to match brand color. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const LazyLoadingIndicator = () => ( | ||
| <View style={styles.root}> | ||
| <ActivityIndicator size="large" /> | ||
| <ActivityIndicator size="large" color="#754CE8" /> |
There was a problem hiding this comment.
we shouldn't hard-code colors
| "details_del_wb_q": "This wallet has a balance. Before proceeding, please be aware that you will not be able to recover the funds without this wallet’s seed phrase. In order to avoid accidental removal, please enter your wallet’s balance of {balance} satoshis.", | ||
| "details_delete": "Delete", | ||
| "details_delete_wallet": "Delete Wallet", | ||
| "details_delete_wallet": "⚠️ Delete Wallet?", |
There was a problem hiding this comment.
get rid of the emoji here. localization files carry text context
| const isDark = Appearance.getColorScheme() === 'dark'; | ||
| const colors = isDark ? BlueDarkTheme.colors : BlueDefaultTheme.colors; |
There was a problem hiding this comment.
instead of Appearance.getColorScheme - which just takes a snapshot, we should use useColorScheme.
| const isDark = Appearance.getColorScheme() === 'dark'; | |
| const colors = isDark ? BlueDarkTheme.colors : BlueDefaultTheme.colors; | |
| const colorScheme = useColorScheme(); | |
| const colors = colorScheme === 'dark' ? BlueDarkTheme.colors : BlueDefaultTheme.colors; |
| const customAlertRef = React.useRef<CustomAlertHandle>(null); | ||
|
|
||
| React.useEffect(() => { | ||
| setCustomAlertRef(customAlertRef.current); | ||
| initializeIndexer({ | ||
| baseUrl: 'https://cushionlike-isabel-retrievable.ngrok-free.dev/', | ||
| timeout: 100000, // 100 seconds for blockchain scanning operations (increased for slower connections) | ||
| }); | ||
| return () => setCustomAlertRef(null); | ||
| }, []); |
There was a problem hiding this comment.
i dont like the approach of using useRef inside a useEffect
| const customAlertRef = React.useRef<CustomAlertHandle>(null); | ||
|
|
||
| React.useEffect(() => { | ||
| setCustomAlertRef(customAlertRef.current); | ||
| initializeIndexer({ | ||
| baseUrl: 'https://cushionlike-isabel-retrievable.ngrok-free.dev/', | ||
| timeout: 100000, // 100 seconds for blockchain scanning operations (increased for slower connections) | ||
| }); | ||
| return () => setCustomAlertRef(null); | ||
| }, []); |
There was a problem hiding this comment.
| const customAlertRef = React.useRef<CustomAlertHandle>(null); | |
| React.useEffect(() => { | |
| setCustomAlertRef(customAlertRef.current); | |
| initializeIndexer({ | |
| baseUrl: 'https://cushionlike-isabel-retrievable.ngrok-free.dev/', | |
| timeout: 100000, // 100 seconds for blockchain scanning operations (increased for slower connections) | |
| }); | |
| return () => setCustomAlertRef(null); | |
| }, []); | |
| const handleCustomAlertRef = React.useCallback((ref: CustomAlertHandle | null) => { | |
| setCustomAlertRef(ref); | |
| }, []); | |
| React.useEffect(() => { | |
| initializeIndexer({ | |
| baseUrl: 'https://cushionlike-isabel-retrievable.ngrok-free.dev/', | |
| timeout: 100000, // 100 seconds for blockchain scanning operations (increased for slower connections) | |
| }); | |
| }, []); | |
| React.useEffect(() => { | ||
| BlueCurrentTheme.updateColorScheme(); | ||
| }, [colorScheme]); |
| </StorageProvider> | ||
| </SafeAreaProvider> | ||
| </NavigationContainer> | ||
| <CustomAlert ref={customAlertRef} /> |
There was a problem hiding this comment.
this should be mounted once at the app root level and can work globally across screens, please move this to just below <MasterView />
| [dismiss], | ||
| ); | ||
|
|
||
| const getButtonTextStyle = (style?: string) => { |
There was a problem hiding this comment.
| const getButtonTextStyle = (style?: string) => { | |
| const getButtonTextStyle = (style?: AlertButton['style']) => { |
| [ | ||
| presentAlert({ | ||
| title: loc.wallets.details_delete_wallet, | ||
| message: loc.wallets.delete_wallet_warning, |
There was a problem hiding this comment.
i think the message should be a combination of both, are you sure + you will need your seed phrase
This PR:
DeleteWalletfrom rawAlert.alert()topresentAlertwrapperImportWalletscreen's half-black background in dark modeView Screenshots at Image log for PR #72