mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 21:29:40 +02:00
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>
69 lines
1.3 KiB
TypeScript
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',
|
|
},
|
|
});
|