managarten/apps-archived/presi/apps/mobile/components/atoms/Button.tsx
Till-JS 44897ae758 chore: archive inventory, presi, storage apps
Move these apps to apps-archived/ as they are not actively developed:
- inventory: Inventory management app
- presi: Presentation tool
- storage: Cloud storage app

These can be reactivated by moving back to apps/ when needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 15:22:38 +01:00

69 lines
1.3 KiB
TypeScript

import { TouchableOpacity, Text, StyleSheet, ActivityIndicator } from 'react-native';
import { ReactNode } from 'react';
interface ButtonProps {
onPress: () => void;
children: ReactNode;
variant?: 'primary' | 'secondary' | 'outline';
loading?: boolean;
disabled?: boolean;
}
export const Button = ({
onPress,
children,
variant = 'primary',
loading = false,
disabled = false,
}: ButtonProps) => {
return (
<TouchableOpacity
onPress={onPress}
disabled={loading || disabled}
style={[styles.button, styles[variant], (loading || disabled) && styles.disabled]}
>
{loading ? (
<ActivityIndicator color="#fff" />
) : (
<Text style={[styles.text, styles[`${variant}Text`]]}>{children}</Text>
)}
</TouchableOpacity>
);
};
const styles = StyleSheet.create({
button: {
padding: 16,
borderRadius: 8,
alignItems: 'center',
justifyContent: 'center',
minWidth: 200,
},
primary: {
backgroundColor: '#f4511e',
},
secondary: {
backgroundColor: '#6200ee',
},
outline: {
backgroundColor: 'transparent',
borderWidth: 2,
borderColor: '#f4511e',
},
disabled: {
opacity: 0.5,
},
text: {
fontSize: 16,
fontWeight: 'bold',
},
primaryText: {
color: '#fff',
},
secondaryText: {
color: '#fff',
},
outlineText: {
color: '#f4511e',
},
});