-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mobile): toggle dark mode (#62)
![Screenshot 2024-06-10 at 03.41.34.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/1VEKR8FQ1Qa5iAiqVGqF/9f9e5226-71a8-4323-a8fe-d8dee10cc3b8.png)
- Loading branch information
Showing
10 changed files
with
157 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Tabs, TabsList, TabsTrigger } from '@/components/Tabs' | ||
import { MoonStarIcon, SmartphoneIcon, SunIcon } from 'lucide-react-native' | ||
import { useColorScheme } from 'nativewind' | ||
import { ScrollView, Text } from 'react-native' | ||
|
||
export default function AppearanceScreen() { | ||
const { colorScheme, setColorScheme } = useColorScheme() | ||
|
||
return ( | ||
<ScrollView className="bg-card" contentContainerClassName="px-6 py-3"> | ||
<Text className="font-sans text-primary font-medium text-base"> | ||
App theme | ||
</Text> | ||
<Text className="font-sans text-muted-foreground text-sm mb-4"> | ||
Choose a preferred theme for the 6pm | ||
</Text> | ||
<Tabs | ||
defaultValue={colorScheme || 'light'} | ||
// biome-ignore lint/suspicious/noExplicitAny: <explanation> | ||
onChange={(value: any) => setColorScheme(value)} | ||
> | ||
<TabsList> | ||
<TabsTrigger value="light" title="Light" icon={SunIcon} /> | ||
<TabsTrigger value="dark" title="Dark" icon={MoonStarIcon} /> | ||
<TabsTrigger value="system" title="System" icon={SmartphoneIcon} /> | ||
</TabsList> | ||
</Tabs> | ||
</ScrollView> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.