mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 07:01:10 +02:00
Migrate figgos from single Expo app to multi-app monorepo structure: - Move mobile app to apps/mobile/ - Add apps/web/ (SvelteKit) and apps/backend/ (NestJS) scaffolds - Add packages/shared/ for shared types and constants - Update root package.json with new dev commands - Temporarily skip type-check (run pnpm install first) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { forwardRef } from 'react';
|
|
import { Text, Pressable, View } from 'react-native';
|
|
import { useState } from 'react';
|
|
import { useTheme } from '~/utils/ThemeContext';
|
|
|
|
type ButtonProps = {
|
|
title: string;
|
|
onPress?: () => void;
|
|
disabled?: boolean;
|
|
className?: string;
|
|
style?: any;
|
|
};
|
|
|
|
export const Button = forwardRef<View, ButtonProps>(
|
|
({ title, onPress, disabled, className, style, ...props }, ref) => {
|
|
const [isHovered, setIsHovered] = useState(false);
|
|
const { theme } = useTheme();
|
|
|
|
return (
|
|
<Pressable
|
|
ref={ref}
|
|
onPress={onPress}
|
|
disabled={disabled}
|
|
onHoverIn={() => setIsHovered(true)}
|
|
onHoverOut={() => setIsHovered(false)}
|
|
className={`items-center rounded-[28px] shadow-md p-4 transition-colors ${isHovered ? 'opacity-90' : ''} ${disabled ? 'opacity-70' : ''} ${className || ''}`}
|
|
style={[
|
|
{
|
|
backgroundColor: disabled
|
|
? '#9ca3af'
|
|
: isHovered
|
|
? theme.colors.secondary
|
|
: theme.colors.primary,
|
|
},
|
|
style,
|
|
]}
|
|
{...props}
|
|
>
|
|
<Text className="text-white text-lg font-semibold text-center">{title}</Text>
|
|
</Pressable>
|
|
);
|
|
}
|
|
);
|
|
|
|
// Styles werden jetzt direkt im Component mit theme.colors verwendet
|