Fix: Resolve UI/UX issues and improve user experience

- Configure Firebase Auth with AsyncStorage persistence
- Fix 'Text strings must be rendered within <Text>' error in navigation
- Improve bottom tab bar: iOS style with blur effect, better height, rounded corners
- Fix Dashboard quick action buttons to open transaction modal directly
- Add auto-open modal when navigating from Dashboard
- Improve selection visibility in modals (type selector and categories)
- Add amount validation: only positive numbers, max 2 decimals
- Add padding to Dashboard content to avoid tab bar overlap
- Apply same fixes to both Transaction and Subscription screens
This commit is contained in:
2025-10-23 15:21:48 +02:00
parent fc1274b59d
commit 0db3832282
5 changed files with 73 additions and 21 deletions

View File

@@ -17,7 +17,7 @@ import { TransactionCard } from '../components/TransactionCard';
import { InputText } from '../components/InputText';
import { Button } from '../components/Button';
export const TransactionScreen = ({ route }: any) => {
export const TransactionScreen = ({ route, navigation }: any) => {
const { user } = useAuth();
const [transactions, setTransactions] = useState<Transaction[]>([]);
const [categories, setCategories] = useState<Category[]>([]);
@@ -48,6 +48,18 @@ export const TransactionScreen = ({ route }: any) => {
return () => unsubscribe();
}, [user]);
// Ouvrir le modal automatiquement si on vient du Dashboard
useEffect(() => {
if (route?.params?.openModal) {
setModalVisible(true);
if (route.params.type) {
setType(route.params.type);
}
// Réinitialiser le paramètre
navigation.setParams({ openModal: false });
}
}, [route?.params]);
const loadCategories = async () => {
if (!user) return;
@@ -218,7 +230,16 @@ export const TransactionScreen = ({ route }: any) => {
label="Montant (€)"
placeholder="0.00"
value={amount}
onChangeText={setAmount}
onChangeText={(text) => {
// Permettre uniquement les chiffres et un point décimal
const cleaned = text.replace(/[^0-9.]/g, '');
// Empêcher plusieurs points
const parts = cleaned.split('.');
if (parts.length > 2) return;
// Limiter à 2 décimales
if (parts[1] && parts[1].length > 2) return;
setAmount(cleaned);
}}
keyboardType="decimal-pad"
/>
@@ -356,7 +377,8 @@ const styles = StyleSheet.create({
alignItems: 'center'
},
typeButtonActive: {
borderWidth: 2
borderWidth: 3,
backgroundColor: '#F0F7FF'
},
expenseButton: {
borderColor: '#FF6B6B'
@@ -367,10 +389,11 @@ const styles = StyleSheet.create({
typeButtonText: {
fontSize: 16,
fontWeight: '600',
color: '#666'
color: '#999'
},
typeButtonTextActive: {
color: '#333'
color: '#333',
fontWeight: '700'
},
label: {
fontSize: 14,
@@ -396,7 +419,13 @@ const styles = StyleSheet.create({
},
categoryItemActive: {
backgroundColor: '#FFF',
borderWidth: 2
borderWidth: 3,
transform: [{ scale: 1.05 }],
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.2,
shadowRadius: 4,
elevation: 4
},
categoryIcon: {
fontSize: 28,
@@ -405,6 +434,7 @@ const styles = StyleSheet.create({
categoryName: {
fontSize: 11,
color: '#666',
fontWeight: '600',
textAlign: 'center'
},
submitButton: {