diff --git a/App.js b/App.js index 517b252..aadbb2b 100644 --- a/App.js +++ b/App.js @@ -2,7 +2,6 @@ import React, { useState } from "react"; import PropTypes from "prop-types"; import { Appbar, - BottomNavigation, Text, Card, Dialog, @@ -15,6 +14,7 @@ import { import { View, StatusBar, StyleSheet } from "react-native"; import { NavigationContainer } from "@react-navigation/native"; +import { TabView, SceneMap, TabBar } from "react-native-tab-view"; import SubjectsContainer from "./containers/SubjectsContainer"; import TimetableContainer from "./containers/TimetableContainer"; @@ -72,7 +72,7 @@ const App = ({ theme, setTheme }) => { const [ newTheme, setNewTheme ] = useState(themes.findIndex( i => JSON.stringify(i.theme) === JSON.stringify(theme) )); - const renderScene = BottomNavigation.SceneMap({ + const renderScene = SceneMap({ add: Dummy, statistics: Dummy, timetable: TimetableContainer, @@ -102,7 +102,7 @@ const App = ({ theme, setTheme }) => { onPress={() => setShowDialog(true)} /> - setPane({ index, @@ -110,6 +110,18 @@ const App = ({ theme, setTheme }) => { })} renderScene={renderScene} shifting={true} + renderTabBar={props => ( + ) + } + tabBarPosition="bottom" /> + {subjects.length === 0 ? No Subjects added. Press + to add a subject. diff --git a/package.json b/package.json index 19446a9..b12aaca 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "react-native-reanimated": "^1.7.0", "react-native-safe-area-context": "^0.7.3", "react-native-screens": "^2.3.0", + "react-native-tab-view": "^2.13.0", "react-native-uuid": "^1.4.9", "react-native-vector-icons": "^6.6.0", "react-redux": "^7.2.0", diff --git a/yarn.lock b/yarn.lock index abcacb6..8f117ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5270,6 +5270,11 @@ react-native-screens@^2.3.0: dependencies: debounce "^1.2.0" +react-native-tab-view@^2.13.0: + version "2.13.0" + resolved "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-2.13.0.tgz#23037aa43b0f8f682ddc20415a4baaaf6f82ae8f" + integrity sha512-AeYbp/u91+D/C9+PmVEPBmFb3ixv8IkLMC3Sc5MajJ/fg0Zl3Of+BcEknBvTnKoe7Fj2y8+Qf9zorBbh5xzh4A== + react-native-uuid@^1.4.9: version "1.4.9" resolved "https://registry.npmjs.org/react-native-uuid/-/react-native-uuid-1.4.9.tgz#a526742f8fddfe6414500655212ca8d109c40229"