optimizations

This commit is contained in:
Sone
2026-05-24 21:34:25 +02:00
parent 7e67fa8ea0
commit c0d472911b
8 changed files with 64 additions and 50 deletions
+15 -10
View File
@@ -1,24 +1,26 @@
import { ReactNode } from "react";
import { View, Text, GestureResponderEvent } from "react-native";
import { View, GestureResponderEvent, StyleSheet } from "react-native";
import { Button as PaperButton } from "react-native-paper";
import { colors } from "@/constants/colors";
interface ButtonProps {
buttonColor?: string;
buttonMode?: "outlined" | "contained";
buttonTextColor?: string;
onPress: (event: GestureResponderEvent) => void;
disabled: boolean;
disabled?: boolean;
children: ReactNode;
className?: string;
icon?: string;
}
export const Button = ({
buttonColor = "#6750a4",
buttonColor = colors.primaryPurpleDark,
buttonMode = "outlined",
buttonTextColor = "white",
onPress,
disabled,
disabled = false,
children,
className,
icon,
@@ -33,14 +35,17 @@ export const Button = ({
disabled={disabled}
textColor={buttonTextColor}
icon={icon}
style={{ borderRadius: 4, borderColor: "transparent" }}
style={styles.buttonStyle}
>
{typeof children === "string" || typeof children === "number" ? (
<Text>{children}</Text>
) : (
children
)}
{children}
</PaperButton>
</View>
);
};
const styles = StyleSheet.create({
buttonStyle: {
borderRadius: 4,
borderColor: "transparent",
},
});