mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-27 14:37:43 +02:00
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>
45 lines
1 KiB
TypeScript
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>
|
|
);
|
|
}
|