managarten/apps/mukke/apps/mobile/components/Button.tsx
Till JS 6c91805b2f feat(mukke): add offline-first iOS music player app
Mukke is a local, offline-first music player for iOS. Songs are imported
from iCloud/local files via document picker, stored on device, and played
with expo-audio including background playback and lock screen controls.

Stack: Expo SDK 55, expo-audio, expo-sqlite, expo-document-picker,
@missingcore/audio-metadata, Zustand, NativeWind, Expo Router with NativeTabs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 13:23:58 +01:00

45 lines
1 KiB
TypeScript

import { Pressable, Text, ActivityIndicator } from 'react-native';
import { useTheme } from '~/utils/themeContext';
interface ButtonProps {
title: string;
onPress: () => void;
variant?: 'primary' | 'secondary' | 'ghost';
loading?: boolean;
disabled?: boolean;
}
export function Button({ title, onPress, variant = 'primary', loading, disabled }: ButtonProps) {
const { colors } = useTheme();
const bgColor =
variant === 'primary'
? colors.primary
: variant === 'secondary'
? colors.backgroundTertiary
: 'transparent';
const textColor = variant === 'primary' ? '#FFFFFF' : colors.text;
return (
<Pressable
onPress={onPress}
disabled={disabled || loading}
style={{
backgroundColor: bgColor,
paddingHorizontal: 20,
paddingVertical: 12,
borderRadius: 10,
opacity: disabled ? 0.5 : 1,
alignItems: 'center',
}}
>
{loading ? (
<ActivityIndicator color={textColor} size="small" />
) : (
<Text style={{ color: textColor, fontWeight: '600', fontSize: 16 }}>{title}</Text>
)}
</Pressable>
);
}