Add meme-adding logic

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2023-07-21 09:46:13 +03:00
parent 1b2ce96c5e
commit 4b601872bc
40 changed files with 1037 additions and 324 deletions

View File

@@ -5,7 +5,15 @@ import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { useTheme } from 'react-native-paper';
import { useSelector } from 'react-redux';
import { Home, Tags, Settings, EditMeme, EditTag } from './screens';
import {
Memes,
Tags,
Settings,
EditMeme,
EditTag,
AddMeme,
AddTag,
} from './screens';
import { darkNavigationTheme, lightNavigationTheme } from './theme';
import {
FloatingActionButton,
@@ -19,7 +27,7 @@ const TabNavigator = () => {
(state: RootState) => state.navigation.navVisible,
);
const [route, setRoute] = React.useState(ROUTE.HOME);
const [route, setRoute] = React.useState(ROUTE.MEMES);
const TabNavigatorBase = createBottomTabNavigator();
return (
@@ -27,6 +35,7 @@ const TabNavigator = () => {
<TabNavigatorBase.Navigator
screenOptions={{
headerShown: false,
lazy: false,
}}
tabBar={({ navigation, state, descriptors, insets }) => (
<HideableBottomNavigationBar
@@ -39,11 +48,11 @@ const TabNavigator = () => {
/>
)}>
<TabNavigatorBase.Screen
name={ROUTE.HOME}
component={Home}
name={ROUTE.MEMES}
component={Memes}
options={{
tabBarIcon: ({ color, size }) => (
<FontAwesome5 name="home" color={color} size={size} />
<FontAwesome5 name="images" color={color} size={size} />
),
}}
/>
@@ -85,10 +94,12 @@ const NavigationContainer = () => {
animation: 'slide_from_bottom',
}}>
<StackNavigatorBase.Screen name={ROUTE.MAIN} component={TabNavigator} />
<StackNavigatorBase.Screen name={ROUTE.ADD_MEME} component={AddMeme} />
<StackNavigatorBase.Screen
name={ROUTE.EDIT_MEME}
component={EditMeme}
/>
<StackNavigatorBase.Screen name={ROUTE.ADD_TAG} component={AddTag} />
<StackNavigatorBase.Screen name={ROUTE.EDIT_TAG} component={EditTag} />
</StackNavigatorBase.Navigator>
</NavigationContainerBase>