Retrait des points-virgules finaux
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import { Text, type TextProps, StyleSheet } from 'react-native';
|
||||
|
||||
import { useThemeColor } from '@/hooks/useThemeColor';
|
||||
import { Text, type TextProps, StyleSheet } from 'react-native'
|
||||
import { useThemeColor } from '@/hooks/useThemeColor'
|
||||
|
||||
export type ThemedTextProps = TextProps & {
|
||||
lightColor?: string;
|
||||
darkColor?: string;
|
||||
type?: 'default' | 'title' | 'defaultSemiBold' | 'subtitle' | 'link';
|
||||
};
|
||||
lightColor?: string
|
||||
darkColor?: string
|
||||
type?: 'default' | 'title' | 'defaultSemiBold' | 'subtitle' | 'link'
|
||||
}
|
||||
|
||||
export function ThemedText({
|
||||
style,
|
||||
@@ -15,7 +14,7 @@ export function ThemedText({
|
||||
type = 'default',
|
||||
...rest
|
||||
}: ThemedTextProps) {
|
||||
const color = useThemeColor({ light: lightColor, dark: darkColor }, 'text');
|
||||
const color = useThemeColor({ light: lightColor, dark: darkColor }, 'text')
|
||||
|
||||
return (
|
||||
<Text
|
||||
@@ -30,7 +29,7 @@ export function ThemedText({
|
||||
]}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
@@ -57,4 +56,4 @@ const styles = StyleSheet.create({
|
||||
fontSize: 16,
|
||||
color: '#0a7ea4',
|
||||
},
|
||||
});
|
||||
})
|
||||
|
@@ -1,14 +1,13 @@
|
||||
import { View, type ViewProps } from 'react-native';
|
||||
|
||||
import { useThemeColor } from '@/hooks/useThemeColor';
|
||||
import { View, type ViewProps } from 'react-native'
|
||||
import { useThemeColor } from '@/hooks/useThemeColor'
|
||||
|
||||
export type ThemedViewProps = ViewProps & {
|
||||
lightColor?: string;
|
||||
darkColor?: string;
|
||||
};
|
||||
lightColor?: string
|
||||
darkColor?: string
|
||||
}
|
||||
|
||||
export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) {
|
||||
const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background');
|
||||
const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background')
|
||||
|
||||
return <View style={[{ backgroundColor }, style]} {...otherProps} />;
|
||||
return <View style={[{ backgroundColor }, style]} {...otherProps} />
|
||||
}
|
||||
|
@@ -1,10 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import * as React from 'react'
|
||||
import renderer from 'react-test-renderer'
|
||||
|
||||
import { ThemedText } from '../ThemedText';
|
||||
import { ThemedText } from '../ThemedText'
|
||||
|
||||
it(`renders correctly`, () => {
|
||||
const tree = renderer.create(<ThemedText>Snapshot test!</ThemedText>).toJSON();
|
||||
const tree = renderer.create(<ThemedText>Snapshot test!</ThemedText>).toJSON()
|
||||
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
expect(tree).toMatchSnapshot()
|
||||
})
|
||||
|
@@ -21,4 +21,4 @@ exports[`renders correctly 1`] = `
|
||||
>
|
||||
Snapshot test!
|
||||
</Text>
|
||||
`;
|
||||
`
|
||||
|
Reference in New Issue
Block a user