generated from t3-oss/create-t3-turbo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8848d9f
commit b740ac0
Showing
199 changed files
with
22,493 additions
and
227 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
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,31 @@ | ||
import { DrawerNavigationProp } from '@react-navigation/drawer'; | ||
import { useNavigation } from 'expo-router'; | ||
import { AlignJustify } from 'lucide-react-native'; | ||
import { Pressable, View } from 'react-native'; | ||
import { cn } from '~/lib/utils'; | ||
|
||
export function DrawerToggle() { | ||
const navigation = useNavigation<DrawerNavigationProp<{}>>(); | ||
|
||
return ( | ||
<Pressable | ||
onPress={navigation.toggleDrawer} | ||
className='ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50' | ||
> | ||
{({ pressed }) => ( | ||
<View | ||
className={cn( | ||
'flex-1 aspect-square justify-center items-end pt-0.5 web:pl-4', | ||
pressed && 'opacity-70' | ||
)} | ||
> | ||
<AlignJustify | ||
className='text-foreground' | ||
size={24} | ||
strokeWidth={1.25} | ||
/> | ||
</View> | ||
)} | ||
</Pressable> | ||
); | ||
} |
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,40 @@ | ||
import AsyncStorage from '@react-native-async-storage/async-storage'; | ||
import { MoonStar, Sun } from 'lucide-react-native'; | ||
import { useColorScheme } from 'nativewind'; | ||
import { Pressable, View } from 'react-native'; | ||
import { setAndroidNavigationBar } from '~/lib/android-navigation-bar'; | ||
import { cn } from '~/lib/utils'; | ||
|
||
export function ThemeToggle() { | ||
const { colorScheme, setColorScheme } = useColorScheme(); | ||
return ( | ||
<Pressable | ||
onPress={() => { | ||
const newTheme = colorScheme === 'dark' ? 'light' : 'dark'; | ||
setColorScheme(newTheme); | ||
setAndroidNavigationBar(newTheme); | ||
AsyncStorage.setItem('theme', newTheme); | ||
}} | ||
className='ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50' | ||
> | ||
{({ pressed }) => ( | ||
<View | ||
className={cn( | ||
'flex-1 aspect-square pt-0.5 justify-center items-start web:px-5', | ||
pressed && 'opacity-70' | ||
)} | ||
> | ||
{colorScheme === 'light' ? ( | ||
<Sun className='text-foreground' size={24} strokeWidth={1.25} /> | ||
) : ( | ||
<MoonStar | ||
className='text-foreground' | ||
size={24} | ||
strokeWidth={1.25} | ||
/> | ||
)} | ||
</View> | ||
)} | ||
</Pressable> | ||
); | ||
} |
Oops, something went wrong.