diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 47faf3e..f8423d0 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -1,6 +1,6 @@ import type { BoxProps, VariantProps } from "@shopify/restyle"; import type { Theme } from "@themes/Theme"; -import { TouchableOpacity } from "react-native"; +import { ActivityIndicator, TouchableOpacity } from "react-native"; import ButtonBase from "./bases/ButtonBase"; import Text from "./bases/Text"; @@ -9,13 +9,25 @@ type Props = BoxProps & VariantProps & { label: string; onPress: () => void; + isLoading?: boolean; }; -const Button = ({ onPress, label, textVariants, variant, ...rest }: Props) => { +const Button = ({ onPress, label, isLoading, textVariants, variant, ...rest }: Props) => { return ( - - {label} + + {isLoading ? ( + + ) : ( + {label} + )} );