restore repo
This commit is contained in:
parent
97e8ee6eb8
commit
f2a798ab18
30 changed files with 1627 additions and 2 deletions
59
app/(tabs)/_layout.tsx
Normal file
59
app/(tabs)/_layout.tsx
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
import React from 'react';
|
||||
import FontAwesome from '@expo/vector-icons/FontAwesome';
|
||||
import { Link, Tabs } from 'expo-router';
|
||||
import { Pressable } from 'react-native';
|
||||
|
||||
import Colors from '@/constants/Colors';
|
||||
import { useColorScheme } from '@/components/useColorScheme';
|
||||
import { useClientOnlyValue } from '@/components/useClientOnlyValue';
|
||||
|
||||
// You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/
|
||||
function TabBarIcon(props: {
|
||||
name: React.ComponentProps<typeof FontAwesome>['name'];
|
||||
color: string;
|
||||
}) {
|
||||
return <FontAwesome size={28} style={{ marginBottom: -3 }} {...props} />;
|
||||
}
|
||||
|
||||
export default function TabLayout() {
|
||||
const colorScheme = useColorScheme();
|
||||
|
||||
return (
|
||||
<Tabs
|
||||
screenOptions={{
|
||||
tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
|
||||
// Disable the static render of the header on web
|
||||
// to prevent a hydration error in React Navigation v6.
|
||||
headerShown: useClientOnlyValue(false, true),
|
||||
}}>
|
||||
<Tabs.Screen
|
||||
name="index"
|
||||
options={{
|
||||
title: 'Tab One',
|
||||
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
|
||||
headerRight: () => (
|
||||
<Link href="/modal" asChild>
|
||||
<Pressable>
|
||||
{({ pressed }) => (
|
||||
<FontAwesome
|
||||
name="info-circle"
|
||||
size={25}
|
||||
color={Colors[colorScheme ?? 'light'].text}
|
||||
style={{ marginRight: 15, opacity: pressed ? 0.5 : 1 }}
|
||||
/>
|
||||
)}
|
||||
</Pressable>
|
||||
</Link>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Tabs.Screen
|
||||
name="two"
|
||||
options={{
|
||||
title: 'Tab Two',
|
||||
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
|
||||
}}
|
||||
/>
|
||||
</Tabs>
|
||||
);
|
||||
}
|
||||
30
app/(tabs)/index.tsx
Normal file
30
app/(tabs)/index.tsx
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import React from 'react';
|
||||
import { FlatList, StyleSheet, Text } from 'react-native';
|
||||
import { View } from '@/components/Themed';
|
||||
import TransactionItem from '@/components/transaction/TransactionItem';
|
||||
|
||||
export default function TabOneScreen() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.testo}>Lista Transazioni</Text>
|
||||
<FlatList
|
||||
data={[{ key: 'transactions' }]}
|
||||
renderItem={() => <TransactionItem />}
|
||||
keyExtractor={item => item.key}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1
|
||||
},
|
||||
testo: {
|
||||
color: '#fff',
|
||||
fontSize: 20,
|
||||
fontWeight: 'bold',
|
||||
textAlign: 'center',
|
||||
paddingVertical: 10,
|
||||
}
|
||||
});
|
||||
20
app/(tabs)/two.tsx
Normal file
20
app/(tabs)/two.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { StyleSheet } from 'react-native';
|
||||
import { Text, View } from '@/components/Themed';
|
||||
import TransactionAdd from '@/components/transaction/TransactionAdd';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function TabTwoScreen() {
|
||||
const [refreshKey, setRefreshKey] = useState(0);
|
||||
const handleTransactionAdded = () => {
|
||||
setRefreshKey(oldKey => oldKey + 1);
|
||||
};
|
||||
|
||||
return (
|
||||
<View>
|
||||
<TransactionAdd onTransactionAdded={handleTransactionAdded} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue