mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 09:39:41 +02:00
Restructure standalone traces app into monorepo pattern with mobile + backend + shared types. Add NestJS backend with Drizzle ORM schema for locations, cities, places, POIs, and AI guides. Add mobile sync layer, cities tab, and guide generation UI. Fix pre-existing type errors across mobile codebase, matrix-mana-bot (sendDirectMessage), llm-playground, and all web auth stores (signUp call signature). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
1 KiB
TypeScript
39 lines
1 KiB
TypeScript
import { forwardRef } from 'react';
|
|
import { Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native';
|
|
|
|
import { useTheme } from '../utils/themeContext';
|
|
|
|
type ButtonProps = {
|
|
title: string;
|
|
variant?: 'primary' | 'secondary';
|
|
} & TouchableOpacityProps;
|
|
|
|
export const Button = forwardRef<View, ButtonProps>(
|
|
({ title, variant = 'primary', ...touchableProps }, ref) => {
|
|
const { isDarkMode } = useTheme();
|
|
|
|
// Dynamic button styles based on variant and theme
|
|
const getButtonStyle = () => {
|
|
if (variant === 'primary') {
|
|
return 'bg-primary';
|
|
} else {
|
|
return 'bg-secondary';
|
|
}
|
|
};
|
|
|
|
return (
|
|
<TouchableOpacity
|
|
ref={ref}
|
|
{...touchableProps}
|
|
className={`${styles.button} ${getButtonStyle()} ${isDarkMode ? 'shadow-lg shadow-black/50' : 'shadow-md'} ${touchableProps.className}`}
|
|
>
|
|
<Text className={styles.buttonText}>{title}</Text>
|
|
</TouchableOpacity>
|
|
);
|
|
}
|
|
);
|
|
|
|
const styles = {
|
|
button: 'items-center rounded-[28px] p-4',
|
|
buttonText: 'text-white text-lg font-semibold text-center',
|
|
};
|