Retrait des points-virgules finaux

This commit is contained in:
2024-12-07 10:24:41 +01:00
parent ab180a12ce
commit 2ad2063339
20 changed files with 101 additions and 103 deletions

View File

@ -1 +1 @@
export { useColorScheme } from 'react-native';
export { useColorScheme } from 'react-native'

View File

@ -1,21 +1,21 @@
import { useEffect, useState } from 'react';
import { useColorScheme as useRNColorScheme } from 'react-native';
import { useEffect, useState } from 'react'
import { useColorScheme as useRNColorScheme } from 'react-native'
/**
* To support static rendering, this value needs to be re-calculated on the client side for web
*/
export function useColorScheme() {
const [hasHydrated, setHasHydrated] = useState(false);
const [hasHydrated, setHasHydrated] = useState(false)
useEffect(() => {
setHasHydrated(true);
}, []);
setHasHydrated(true)
}, [])
const colorScheme = useRNColorScheme();
const colorScheme = useRNColorScheme()
if (hasHydrated) {
return colorScheme;
return colorScheme
}
return 'light';
return 'light'
}

View File

@ -3,19 +3,19 @@
* https://docs.expo.dev/guides/color-schemes/
*/
import { Colors } from '@/constants/Colors';
import { useColorScheme } from '@/hooks/useColorScheme';
import { Colors } from '@/constants/Colors'
import { useColorScheme } from '@/hooks/useColorScheme'
export function useThemeColor(
props: { light?: string; dark?: string },
colorName: keyof typeof Colors.light & keyof typeof Colors.dark
) {
const theme = useColorScheme() ?? 'light';
const colorFromProps = props[theme];
const theme = useColorScheme() ?? 'light'
const colorFromProps = props[theme]
if (colorFromProps) {
return colorFromProps;
return colorFromProps
} else {
return Colors[theme][colorName];
return Colors[theme][colorName]
}
}