38 lines
840 B
TypeScript
38 lines
840 B
TypeScript
|
import Button from '@/components/theme/buttons/DefaultButton';
|
||
|
import { ThemedText } from "@/components/theme/Theme";
|
||
|
import { Colors } from '@/constants/Colors';
|
||
|
import { useColorScheme } from '@/hooks/useColorScheme';
|
||
|
|
||
|
const DEFAULT_FONT_SIZE = 16;
|
||
|
|
||
|
type Props = {
|
||
|
width?: number;
|
||
|
height?: number;
|
||
|
text: string;
|
||
|
fontSize?: number;
|
||
|
onPress?: () => void;
|
||
|
};
|
||
|
|
||
|
const TextButton = ({ width, height, text, fontSize, onPress }: Props ) => {
|
||
|
const scheme = useColorScheme() ?? 'dark';
|
||
|
return (
|
||
|
<Button
|
||
|
width={width}
|
||
|
height={height}
|
||
|
onPress={onPress}
|
||
|
>
|
||
|
<ThemedText
|
||
|
style={[
|
||
|
{
|
||
|
color: Colors[scheme].text,
|
||
|
fontSize: fontSize ?? DEFAULT_FONT_SIZE
|
||
|
}
|
||
|
]}
|
||
|
>
|
||
|
{text}
|
||
|
</ThemedText>
|
||
|
</Button>
|
||
|
);
|
||
|
};
|
||
|
export default TextButton;
|