| 1234567891011121314151617181920212223242526272829303132333435363738 |
- import React, { ReactElement } from "react";
- import { Pressable, Text, StyleSheet, ViewStyle, StyleProp } from "react-native";
- interface NormalButtonProps {
- title: ReactElement;
- extendedStyle?: StyleProp<ViewStyle>;
- onPress: () => void;
- disabled?: boolean;
- }
- const NormalButton: React.FC<NormalButtonProps> = ({ title, extendedStyle, onPress, disabled }) => {
- return (
- <Pressable
- onPress={onPress}
- disabled={disabled}
- style={({ pressed }) => [styles.button, pressed ? styles.buttonPressed : null, extendedStyle]}
- >
- {title}
- </Pressable>
- );
- };
- const styles = StyleSheet.create({
- button: {
- maxWidth: "100%",
- fontSize: 16,
- backgroundColor: "#025c72",
- justifyContent: "center",
- alignItems: "center",
- borderRadius: 12,
- padding: 20,
- },
- buttonPressed: {
- backgroundColor: "#28495c",
- },
- });
- export default NormalButton;
|