-
Notifications
You must be signed in to change notification settings - Fork 34
Kit refresh: Expo SDK 55, latest deps, fixes of native flows #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4e6c4ba
f6130b7
669f29a
ecfe152
ff6ec7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,7 +3,7 @@ import { Moon, Sun } from 'lucide-react-native'; | |||||||||||||||||||||||||||||||
| import { useColorScheme } from 'nativewind'; | ||||||||||||||||||||||||||||||||
| import { View } from 'react-native'; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| import { ToggleGroup, ToggleGroupItem } from '@kit/ui'; | ||||||||||||||||||||||||||||||||
| import { Icon, ToggleGroup, ToggleGroupItem } from '@kit/ui'; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| type Theme = 'light' | 'dark' | 'system'; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
@@ -15,18 +15,20 @@ export function ThemeModeToggle() { | |||||||||||||||||||||||||||||||
| <ToggleGroup | ||||||||||||||||||||||||||||||||
| className="justify-start" | ||||||||||||||||||||||||||||||||
| type="single" | ||||||||||||||||||||||||||||||||
| variant="outline" | ||||||||||||||||||||||||||||||||
| value={colorScheme} | ||||||||||||||||||||||||||||||||
| onValueChange={async (value) => { | ||||||||||||||||||||||||||||||||
| if (!value) return; | ||||||||||||||||||||||||||||||||
| setColorScheme(value as Theme); | ||||||||||||||||||||||||||||||||
| await AsyncStorage.setItem('theme', value as Theme); | ||||||||||||||||||||||||||||||||
| await AsyncStorage.setItem('theme', value); | ||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||
|
Comment on lines
20
to
24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handle AsyncStorage failures in the toggle handler. Line 23 can reject and currently has no local handling, which risks unhandled promise rejections and silent preference persistence failure. Suggested fix onValueChange={async (value) => {
if (!value) return;
- setColorScheme(value as Theme);
- await AsyncStorage.setItem('theme', value);
+ setColorScheme(value as Theme);
+ try {
+ await AsyncStorage.setItem('theme', value);
+ } catch (error) {
+ console.error('Failed to persist theme preference', error);
+ }
}}As per coding guidelines, "Do not swallow errors; handle promises and async/await with proper error handling and non-sensitive context". 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||
| <ToggleGroupItem value="light" aria-label="Light Mode"> | ||||||||||||||||||||||||||||||||
| <Sun className="h-4 w-4 text-secondary-foreground" /> | ||||||||||||||||||||||||||||||||
| <Icon as={Sun} className="size-6 text-foreground" /> | ||||||||||||||||||||||||||||||||
| </ToggleGroupItem> | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| <ToggleGroupItem value="dark" aria-label="Dark Mode"> | ||||||||||||||||||||||||||||||||
| <Moon className="h-4 w-4 text-secondary-foreground" /> | ||||||||||||||||||||||||||||||||
| <Icon as={Moon} className="size-6 text-foreground" /> | ||||||||||||||||||||||||||||||||
| </ToggleGroupItem> | ||||||||||||||||||||||||||||||||
| </ToggleGroup> | ||||||||||||||||||||||||||||||||
| </View> | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix CTA capitalization for consistency.
Line 33 uses inconsistent title casing (
Account,Sign In) compared with surrounding copy style.Suggested copy tweak
📝 Committable suggestion
🤖 Prompt for AI Agents