wavelength_app/components/theme/buttons/TextButton.tsx

38 lines
846 B
TypeScript
Raw Normal View History

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