wavelength_app/components/theme/buttons/TextButton.tsx
2024-10-18 12:39:54 -05:00

38 lines
846 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].background,
fontSize: fontSize ?? DEFAULT_FONT_SIZE
}
]}
>
{text}
</ThemedText>
</Button>
);
};
export default TextButton;