2024-10-15 15:53:05 -05:00
|
|
|
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={[
|
|
|
|
{
|
2024-10-18 12:39:54 -05:00
|
|
|
color: Colors[scheme].background,
|
2024-10-15 15:53:05 -05:00
|
|
|
fontSize: fontSize ?? DEFAULT_FONT_SIZE
|
|
|
|
}
|
|
|
|
]}
|
|
|
|
>
|
|
|
|
{text}
|
|
|
|
</ThemedText>
|
|
|
|
</Button>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
export default TextButton;
|