Skip to content

Commit

Permalink
Better state manager & cancel download
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-nyt committed Mar 12, 2024
1 parent 5aff69f commit f6f3f7c
Show file tree
Hide file tree
Showing 15 changed files with 375 additions and 226 deletions.
69 changes: 33 additions & 36 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import HomeScreen from "./src/screens/HomeScreen";
import SettingsScreen from "./src/screens/SettingsScreen";
import SourcesNavigator, { SourcesStackParamList } from './src/screens/sources/SourcesNavigator';
import { DatabaseProvider } from './src/contexts/DatabaseContext';

export type RootTabParamList = {
Home: undefined;
Expand All @@ -22,41 +21,39 @@ const Tab = createMaterialBottomTabNavigator<RootTabParamList>();

export default function App() {
return (
<DatabaseProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<SafeAreaProvider>
<NavigationContainer>
<Tab.Navigator
initialRouteName="Home"
activeColor="#ffffff"
labeled={false}
barStyle={{ backgroundColor: '#4B7288' }}
>
<Tab.Screen name="Home" component={HomeScreen} options={{
tabBarIcon: ({ focused }) => (
<MaterialIcons name="home" color={focused ? "#4B7288" : "white"} size={28} />
),
}} />
<Tab.Screen name="SourcesNavigator" component={SourcesNavigator} options={{
tabBarIcon: ({ focused }) => (
<MaterialIcons name="search" color={focused ? "#4B7288" : "white"} size={28} />
),
}} />
<Tab.Screen name="LibraryNavigator" component={LibraryNavigator} options={{
tabBarIcon: ({ focused }) => (
<MaterialIcons name="book" color={focused ? "#4B7288" : "white"} size={28} />
),
}} />
<Tab.Screen name="Settings" component={SettingsScreen} options={{
tabBarIcon: ({ focused }) => (
<MaterialIcons name="settings" color={focused ? "#4B7288" : "white"} size={28} />
),
}} />
</Tab.Navigator>
</NavigationContainer>
</SafeAreaProvider>
</GestureHandlerRootView>
</DatabaseProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<SafeAreaProvider>
<NavigationContainer>
<Tab.Navigator
initialRouteName="Home"
activeColor="#ffffff"
labeled={false}
barStyle={{ backgroundColor: '#4B7288' }}
>
<Tab.Screen name="Home" component={HomeScreen} options={{
tabBarIcon: ({ focused }) => (
<MaterialIcons name="home" color={focused ? "#4B7288" : "white"} size={28} />
),
}} />
<Tab.Screen name="SourcesNavigator" component={SourcesNavigator} options={{
tabBarIcon: ({ focused }) => (
<MaterialIcons name="search" color={focused ? "#4B7288" : "white"} size={28} />
),
}} />
<Tab.Screen name="LibraryNavigator" component={LibraryNavigator} options={{
tabBarIcon: ({ focused }) => (
<MaterialIcons name="book" color={focused ? "#4B7288" : "white"} size={28} />
),
}} />
<Tab.Screen name="Settings" component={SettingsScreen} options={{
tabBarIcon: ({ focused }) => (
<MaterialIcons name="settings" color={focused ? "#4B7288" : "white"} size={28} />
),
}} />
</Tab.Navigator>
</NavigationContainer>
</SafeAreaProvider>
</GestureHandlerRootView>
);
}

Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
presets: ["module:@react-native/babel-preset"],
plugins: ["transform-remove-console"]
};
103 changes: 98 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
"cheerio": "^1.0.0-rc.12",
"clone": "^2.1.2",
"jszip": "^3.10.1",
"ramda": "^0.29.1",
"react": "18.2.0",
"react-native": "0.73.5",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.15.0",
"react-native-paper": "^5.12.3",
"react-native-safe-area-context": "^4.9.0",
"react-native-screens": "^3.29.0",
"react-native-vector-icons": "^10.0.3"
"react-native-vector-icons": "^10.0.3",
"zustand": "^4.5.2"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand All @@ -36,14 +38,17 @@
"@react-native/metro-config": "0.73.5",
"@react-native/typescript-config": "0.73.1",
"@types/clone": "^2.1.4",
"@types/ramda": "^0.29.11",
"@types/react": "^18.2.6",
"@types/react-native-vector-icons": "^6.4.18",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"ts-essentials": "^9.4.1",
"typescript": "5.0.4"
},
"engines": {
Expand Down
Loading

0 comments on commit f6f3f7c

Please sign in to comment.