Refactor
This commit is contained in:
@@ -1,21 +1,17 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { StatusBar } from "expo-status-bar";
|
||||
import React, { useEffect } from "react";
|
||||
import { NavigationContainer } from "@react-navigation/native";
|
||||
import * as Font from "expo-font";
|
||||
import AppLoading from "expo-app-loading";
|
||||
|
||||
import Router from "./src/navigation/Router";
|
||||
import { useFonts } from "expo-font";
|
||||
import { Provider as PaperProvider } from "react-native-paper";
|
||||
import Main from "./src/Navigators/Main";
|
||||
|
||||
// Redux
|
||||
import { Provider, useSelector } from "react-redux";
|
||||
import { Provider } from "react-redux";
|
||||
import { persistor, store } from "./src/redux/store";
|
||||
import { PersistGate } from "redux-persist/lib/integration/react";
|
||||
import { createDB, deleteDb } from "./src/database/DBHelper";
|
||||
import { checkGithubRelease } from "./src/services/updates";
|
||||
import NewUpdateDialog from "./src/components/NewUpdateDialog";
|
||||
|
||||
const getFonts = () =>
|
||||
Font.loadAsync({
|
||||
const App = () => {
|
||||
const [loaded] = useFonts({
|
||||
"pt-sans-bold": require("./assets/fonts/PTSansNarrow-Bold.ttf"),
|
||||
"arbutus-slab": require("./assets/fonts/ArbutusSlab-Regular.ttf"),
|
||||
domine: require("./assets/fonts/Domine-VariableFont_wght.ttf"),
|
||||
@@ -25,31 +21,23 @@ const getFonts = () =>
|
||||
"pt-serif": require("./assets/fonts/PTSerif-Regular.ttf"),
|
||||
});
|
||||
|
||||
const App = () => {
|
||||
const [fontsLoaded, setFontsLoaded] = useState(false);
|
||||
|
||||
useEffect(() => createDB(), []);
|
||||
|
||||
if (fontsLoaded) {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<PersistGate loading={null} persistor={persistor}>
|
||||
<StatusBar />
|
||||
<NavigationContainer>
|
||||
<Router />
|
||||
</NavigationContainer>
|
||||
</PersistGate>
|
||||
</Provider>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<AppLoading
|
||||
startAsync={getFonts}
|
||||
onError={() => warn(error)}
|
||||
onFinish={() => setFontsLoaded(true)}
|
||||
/>
|
||||
);
|
||||
if (!loaded) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<PersistGate loading={null} persistor={persistor}>
|
||||
<PaperProvider>
|
||||
<NavigationContainer>
|
||||
<Main />
|
||||
</NavigationContainer>
|
||||
</PaperProvider>
|
||||
</PersistGate>
|
||||
</Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { setStatusBarStyle as setExpoStatusBarStyle } from "expo-status-bar";
|
||||
import { useTheme } from "../Theme/hooks/useTheme";
|
||||
|
||||
export const setStatusBarStyle = () => {
|
||||
const theme = useTheme();
|
||||
setExpoStatusBarStyle(theme.id === 1 ? "dark" : "light");
|
||||
};
|
||||
@@ -0,0 +1,92 @@
|
||||
import React from "react";
|
||||
import { createMaterialBottomTabNavigator } from "@react-navigation/material-bottom-tabs";
|
||||
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { useTheme } from "../Theme/hooks/useTheme";
|
||||
|
||||
import Library from "../screens/Library/Library";
|
||||
import Updates from "../screens/Updates/Updates";
|
||||
import History from "../screens/History/History";
|
||||
import Browse from "../screens/Browse/Browse";
|
||||
import More from "../screens/More/More";
|
||||
|
||||
const Tab = createMaterialBottomTabNavigator();
|
||||
|
||||
const BottomNavigator = () => {
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<Tab.Navigator
|
||||
shifting={false}
|
||||
barStyle={{ backgroundColor: theme.colorPrimary }}
|
||||
activeColor={theme.colorAccentDark}
|
||||
>
|
||||
<Tab.Screen
|
||||
name="Library"
|
||||
component={Library}
|
||||
options={{
|
||||
tabBarIcon: ({ color }) => (
|
||||
<MaterialCommunityIcons
|
||||
name="book-variant-multiple"
|
||||
color={color}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name="Updates"
|
||||
component={Updates}
|
||||
options={{
|
||||
tabBarIcon: ({ color }) => (
|
||||
<MaterialCommunityIcons
|
||||
name="alert-decagram-outline"
|
||||
color={color}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name="History"
|
||||
component={History}
|
||||
options={{
|
||||
tabBarIcon: ({ color }) => (
|
||||
<MaterialCommunityIcons
|
||||
name="history"
|
||||
color={color}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name="Browse"
|
||||
component={Browse}
|
||||
options={{
|
||||
tabBarIcon: ({ color }) => (
|
||||
<MaterialCommunityIcons
|
||||
name="compass-outline"
|
||||
color={color}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name="More"
|
||||
component={More}
|
||||
options={{
|
||||
tabBarIcon: ({ color }) => (
|
||||
<MaterialCommunityIcons
|
||||
name="dots-horizontal"
|
||||
color={color}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Tab.Navigator>
|
||||
);
|
||||
};
|
||||
|
||||
export default BottomNavigator;
|
||||
@@ -0,0 +1,64 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import {
|
||||
createStackNavigator,
|
||||
TransitionPresets,
|
||||
} from "@react-navigation/stack";
|
||||
|
||||
import BottomNavigator from "./BottomNavigator";
|
||||
import Novel from "../screens/Novel/Novel";
|
||||
import Chapter from "../screens/Chapter/Chapter";
|
||||
import Extension from "../screens/Extension/Extension";
|
||||
import MoreStack from "./More";
|
||||
|
||||
import { setStatusBarStyle } from "../Hooks/setStatusBarStyle";
|
||||
import { checkGithubRelease } from "../Services/updates";
|
||||
|
||||
const Stack = createStackNavigator();
|
||||
|
||||
const stackNavigatorConfig = {
|
||||
headerShown: false,
|
||||
...TransitionPresets.RevealFromBottomAndroid,
|
||||
};
|
||||
|
||||
const MainNavigator = () => {
|
||||
const [newUpdate, setNewUpdate] = useState();
|
||||
setStatusBarStyle();
|
||||
|
||||
useEffect(() => {
|
||||
checkGithubRelease().then((res) => setNewUpdate(res));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
{newUpdate && newUpdate.tag_name === "v1.0.17" && (
|
||||
<NewUpdateDialog newVersion={newUpdate} />
|
||||
)}
|
||||
<Stack.Navigator screenOptions={stackNavigatorConfig}>
|
||||
<Stack.Screen
|
||||
name="BottomNavigator"
|
||||
component={BottomNavigator}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="Novel"
|
||||
component={Novel}
|
||||
options={{
|
||||
headerTitle: "",
|
||||
headerShown: true,
|
||||
headerTransparent: true,
|
||||
headerTintColor: "white",
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Chapter"
|
||||
component={Chapter}
|
||||
options={{ ...TransitionPresets.SlideFromRightIOS }}
|
||||
/>
|
||||
<Stack.Screen name="MoreStack" component={MoreStack} />
|
||||
<Stack.Screen name="Extension" component={Extension} />
|
||||
</Stack.Navigator>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default MainNavigator;
|
||||
@@ -0,0 +1,28 @@
|
||||
import React from "react";
|
||||
import {
|
||||
createStackNavigator,
|
||||
TransitionPresets,
|
||||
} from "@react-navigation/stack";
|
||||
|
||||
import About from "../screens/More/About";
|
||||
import Settings from "../screens/More/Settings";
|
||||
import Trackers from "../screens/More/Trackers";
|
||||
|
||||
const Stack = createStackNavigator();
|
||||
|
||||
const stackNavigatorConfig = {
|
||||
headerShown: false,
|
||||
...TransitionPresets.RevealFromBottomAndroid,
|
||||
};
|
||||
|
||||
const MoreStack = () => {
|
||||
return (
|
||||
<Stack.Navigator screenOptions={stackNavigatorConfig}>
|
||||
<Stack.Screen name="Settings" component={Settings} />
|
||||
<Stack.Screen name="Trackers" component={Trackers} />
|
||||
<Stack.Screen name="About" component={About} />
|
||||
</Stack.Navigator>
|
||||
);
|
||||
};
|
||||
|
||||
export default MoreStack;
|
||||
@@ -2,7 +2,7 @@ import * as FileSystem from "expo-file-system";
|
||||
|
||||
import * as SQLite from "expo-sqlite";
|
||||
import { getLibrary } from "./LibraryQueries";
|
||||
import { fetchChapters } from "../../source/Source";
|
||||
import { fetchChapters } from "../../Services/Source/source";
|
||||
import { insertChapters } from "./ChapterQueries";
|
||||
const db = SQLite.openDatabase("lnreader.db");
|
||||
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import {
|
||||
createStackNavigator,
|
||||
TransitionPresets,
|
||||
} from "@react-navigation/stack";
|
||||
import { createMaterialBottomTabNavigator } from "@react-navigation/material-bottom-tabs";
|
||||
import { Provider } from "react-native-paper";
|
||||
import { setStatusBarStyle } from "expo-status-bar";
|
||||
|
||||
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
|
||||
import Library from "../screens/Library/Library";
|
||||
import Updates from "../screens/Updates/Updates";
|
||||
import History from "../screens/History/History";
|
||||
import Browse from "../screens/Browse/Browse";
|
||||
|
||||
import More from "../screens/More/More";
|
||||
import About from "../screens/More/About";
|
||||
import Settings from "../screens/More/Settings";
|
||||
import Trackers from "../screens/More/Trackers";
|
||||
|
||||
import NovelItem from "../screens/Novel/Novel";
|
||||
import ChapterItem from "../screens/Chapter/Chapter";
|
||||
|
||||
import Extension from "../screens/Extension/Extension";
|
||||
|
||||
const Stack = createStackNavigator();
|
||||
|
||||
const Tab = createMaterialBottomTabNavigator();
|
||||
|
||||
const stackNavigatorConfig = {
|
||||
headerShown: false,
|
||||
...TransitionPresets.RevealFromBottomAndroid,
|
||||
};
|
||||
|
||||
const SettingsStack = () => {
|
||||
return (
|
||||
<Stack.Navigator screenOptions={stackNavigatorConfig}>
|
||||
<Stack.Screen name="About" component={About} />
|
||||
<Stack.Screen name="Settings" component={Settings} />
|
||||
<Stack.Screen name="Trackers" component={Trackers} />
|
||||
</Stack.Navigator>
|
||||
);
|
||||
};
|
||||
|
||||
import { useSelector } from "react-redux";
|
||||
import { checkGithubRelease } from "../services/updates";
|
||||
import NewUpdateDialog from "../components/NewUpdateDialog";
|
||||
|
||||
const BottomNavigator = () => {
|
||||
const theme = useSelector((state) => state.themeReducer.theme);
|
||||
|
||||
return (
|
||||
<Tab.Navigator
|
||||
shifting={false}
|
||||
barStyle={{ backgroundColor: theme.colorPrimary }}
|
||||
activeColor={theme.colorAccentDark}
|
||||
>
|
||||
<Tab.Screen
|
||||
name="My Library"
|
||||
component={Library}
|
||||
options={{
|
||||
tabBarIcon: ({ color }) => (
|
||||
<MaterialCommunityIcons
|
||||
name="book-variant-multiple"
|
||||
color={color}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Tab.Screen
|
||||
name="Updates"
|
||||
component={Updates}
|
||||
options={{
|
||||
tabBarIcon: ({ color }) => (
|
||||
<MaterialCommunityIcons
|
||||
name="alert-decagram-outline"
|
||||
color={color}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name="History"
|
||||
component={History}
|
||||
options={{
|
||||
tabBarIcon: ({ color }) => (
|
||||
<MaterialCommunityIcons
|
||||
name="history"
|
||||
color={color}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name="Browse"
|
||||
component={Browse}
|
||||
options={{
|
||||
tabBarIcon: ({ color }) => (
|
||||
<MaterialCommunityIcons
|
||||
name="compass-outline"
|
||||
color={color}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name="More"
|
||||
component={More}
|
||||
options={{
|
||||
tabBarIcon: ({ color }) => (
|
||||
<MaterialCommunityIcons
|
||||
name="dots-horizontal"
|
||||
color={color}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Tab.Navigator>
|
||||
);
|
||||
};
|
||||
|
||||
const Router = () => {
|
||||
const theme = useSelector((state) => state.themeReducer.theme);
|
||||
|
||||
const [newUpdate, setNewUpdate] = useState();
|
||||
|
||||
useEffect(() => {
|
||||
setStatusBarStyle(theme.id === 1 ? "dark" : "light");
|
||||
checkGithubRelease().then((res) => setNewUpdate(res));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Provider>
|
||||
{newUpdate && newUpdate.tag_name !== "v1.0.15" && (
|
||||
<NewUpdateDialog newVersion={newUpdate} />
|
||||
)}
|
||||
<Stack.Navigator screenOptions={stackNavigatorConfig}>
|
||||
<Stack.Screen name="Router" component={BottomNavigator} />
|
||||
<Stack.Screen
|
||||
name="ChapterItem"
|
||||
component={ChapterItem}
|
||||
options={{ ...TransitionPresets.SlideFromRightIOS }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="NovelItem"
|
||||
component={NovelItem}
|
||||
options={{
|
||||
headerTitle: "",
|
||||
headerShown: true,
|
||||
headerTransparent: true,
|
||||
headerTintColor: "white",
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen name="SettingsStack" component={SettingsStack} />
|
||||
<Stack.Screen name="Extension" component={Extension} />
|
||||
{/* <Stack.Screen
|
||||
name="ExtensionStack"
|
||||
component={ExtensionStack}
|
||||
/> */}
|
||||
</Stack.Navigator>
|
||||
</Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export default Router;
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
CHAPTER_DELETED,
|
||||
} from "./chapter.types";
|
||||
|
||||
import { fetchChapter } from "../../source/Source";
|
||||
import { fetchChapter } from "../../Services/Source/source";
|
||||
|
||||
import {
|
||||
markChapterRead,
|
||||
|
||||
@@ -16,8 +16,8 @@ import {
|
||||
UPDATE_NOVEL,
|
||||
} from "./novel.types";
|
||||
|
||||
import { updateNovel } from "../../services/updates";
|
||||
import { fetchChapter, fetchNovel } from "../../source/Source";
|
||||
import { updateNovel } from "../../Services/updates";
|
||||
import { fetchChapter, fetchNovel } from "../../Services/Source/source";
|
||||
import {
|
||||
followNovel,
|
||||
insertNovel,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { GET_SOURCES } from "./source.types";
|
||||
import { fetchSources } from "../../source/Source";
|
||||
import { fetchSources } from "../../Services/Source/source";
|
||||
|
||||
export const getSourcesAction = () => async (dispatch) => {
|
||||
const res = await fetchSources();
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
lightTheme,
|
||||
darkTheme,
|
||||
midnightDuskTheme,
|
||||
} from "../../theme/theme";
|
||||
} from "../../Theme/theme";
|
||||
|
||||
const themes = {
|
||||
0: amoledDarkTheme,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { findListItem, updateItem } from "../../trackers/MyAnimeList";
|
||||
import { findListItem, updateItem } from "../../Services/Trackers/myAnimeList";
|
||||
import {
|
||||
REMOVE_TRACKER,
|
||||
SET_TRACKER,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
UPDATE_CHAPTERS_READ,
|
||||
} from "./tracker.types";
|
||||
|
||||
import { updateMalChaptersRead } from "../../trackers/MyAnimeList";
|
||||
import { updateMalChaptersRead } from "../../Services/Trackers/myAnimeList";
|
||||
|
||||
export const setTracker = (res) => async (dispatch) => {
|
||||
dispatch({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { StyleSheet, View, FlatList, ActivityIndicator } from "react-native";
|
||||
import { Appbar } from "../../components/Appbar";
|
||||
import { Appbar } from "../../Components/Appbar";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { getSourcesAction } from "../../redux/source/source.actions";
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
} from "../../redux/novel/novel.actions";
|
||||
|
||||
import { connect, useSelector, useDispatch } from "react-redux";
|
||||
import { parseChapterNumber } from "../../services/updates";
|
||||
import { parseChapterNumber } from "../../Services/updates";
|
||||
import { updateChaptersRead } from "../../redux/tracker/tracker.actions";
|
||||
|
||||
const ChapterItem = ({
|
||||
@@ -126,7 +126,7 @@ const ChapterItem = ({
|
||||
size={26}
|
||||
disabled={!chapter.prevChapter}
|
||||
onPress={() => {
|
||||
navigation.replace("ChapterItem", {
|
||||
navigation.replace("Chapter", {
|
||||
chapterUrl: chapter.prevChapter,
|
||||
chapterId: chapterId - 1,
|
||||
extensionId,
|
||||
@@ -142,7 +142,7 @@ const ChapterItem = ({
|
||||
size={26}
|
||||
disabled={!chapter.nextChapter}
|
||||
onPress={() => {
|
||||
navigation.replace("ChapterItem", {
|
||||
navigation.replace("Chapter", {
|
||||
chapterUrl: chapter.nextChapter,
|
||||
extensionId,
|
||||
novelUrl,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Animated, StyleSheet, View, Text, Dimensions } from "react-native";
|
||||
import { ToggleButton, IconButton, Chip } from "react-native-paper";
|
||||
import Slider from "@react-native-community/slider";
|
||||
import Bottomsheet from "rn-sliding-up-panel";
|
||||
import { fonts } from "../../../utils/constants";
|
||||
import { fonts } from "../../../Services/utils/constants";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
updateReaderTextSize,
|
||||
updateReaderTheme,
|
||||
} from "../../../redux/settings/settings.actions";
|
||||
import BottomSheetHandle from "../../../components/BottomSheetHandle";
|
||||
import BottomSheetHandle from "../../../Components/BottomSheetHandle";
|
||||
|
||||
const ChapterBottomSheet = ({
|
||||
bottomSheetRef,
|
||||
|
||||
@@ -3,9 +3,9 @@ import { StyleSheet, View, FlatList, ActivityIndicator } from "react-native";
|
||||
import { Provider } from "react-native-paper";
|
||||
import * as WebBrowser from "expo-web-browser";
|
||||
|
||||
import NovelCover from "../../components/NovelCover";
|
||||
import EmptyView from "../../components/EmptyView";
|
||||
import { SearchAppbar } from "../../components/Appbar";
|
||||
import NovelCover from "../../Components/NovelCover";
|
||||
import EmptyView from "../../Components/EmptyView";
|
||||
import { SearchAppbar } from "../../Components/Appbar";
|
||||
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
@@ -104,7 +104,7 @@ const Extension = ({ navigation, route }) => {
|
||||
<NovelCover
|
||||
item={item}
|
||||
onPress={() =>
|
||||
navigation.navigate("NovelItem", {
|
||||
navigation.navigate("Novel", {
|
||||
novelName: item.novelName,
|
||||
novelCover: item.novelCover,
|
||||
novelUrl: item.novelUrl,
|
||||
|
||||
@@ -3,11 +3,11 @@ import { useFocusEffect } from "@react-navigation/native";
|
||||
|
||||
import { StyleSheet, View, FlatList, ActivityIndicator } from "react-native";
|
||||
|
||||
import { Appbar } from "../../components/Appbar";
|
||||
import { Appbar } from "../../Components/Appbar";
|
||||
import HistoryCard from "./components/HistoryCard";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import EmptyView from "../../components/EmptyView";
|
||||
import EmptyView from "../../Components/EmptyView";
|
||||
|
||||
import {
|
||||
getHistoryAction,
|
||||
|
||||
@@ -16,7 +16,7 @@ const HistoryCard = ({ item, deleteHistoryAction, navigation }) => {
|
||||
rippleColor={theme.rippleColor}
|
||||
borderless
|
||||
onPress={() =>
|
||||
navigation.navigate("NovelItem", {
|
||||
navigation.navigate("Novel", {
|
||||
novelName: item.novelName,
|
||||
novelCover: item.novelCover,
|
||||
extensionId: item.extensionId,
|
||||
@@ -75,7 +75,7 @@ const HistoryCard = ({ item, deleteHistoryAction, navigation }) => {
|
||||
color={theme.textColorPrimary}
|
||||
style={{ marginRight: 10 }}
|
||||
onPress={() =>
|
||||
navigation.navigate("ChapterItem", {
|
||||
navigation.navigate("Chapter", {
|
||||
chapterId: item.historyChapterId,
|
||||
chapterUrl: item.chapterUrl,
|
||||
extensionId: item.sourceId,
|
||||
|
||||
@@ -11,16 +11,16 @@ import { FlatList } from "react-native-gesture-handler";
|
||||
import { useFocusEffect } from "@react-navigation/native";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import NovelCover from "../../components/NovelCover";
|
||||
import EmptyView from "../../components/EmptyView";
|
||||
import NovelCover from "../../Components/NovelCover";
|
||||
import EmptyView from "../../Components/EmptyView";
|
||||
|
||||
import {
|
||||
getLibraryAction,
|
||||
searchLibraryAction,
|
||||
} from "../../redux/library/library.actions";
|
||||
import { SearchAppbar } from "../../components/Appbar";
|
||||
import { SearchAppbar } from "../../Components/Appbar";
|
||||
import { setNovel } from "../../redux/novel/novel.actions";
|
||||
import { updateAllNovels } from "../../services/updates";
|
||||
import { updateAllNovels } from "../../Services/updates";
|
||||
|
||||
const LibraryScreen = ({
|
||||
navigation,
|
||||
@@ -54,7 +54,7 @@ const LibraryScreen = ({
|
||||
};
|
||||
|
||||
const redirectToNovel = (item) => {
|
||||
navigation.navigate("NovelItem", item);
|
||||
navigation.navigate("Novel", item);
|
||||
setNovel(item);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ import React from "react";
|
||||
import { View } from "react-native";
|
||||
import * as Linking from "expo-linking";
|
||||
|
||||
import { Appbar } from "../../components/Appbar";
|
||||
import { Appbar } from "../../Components/Appbar";
|
||||
|
||||
import { useSelector } from "react-redux";
|
||||
import { Divider, ListItem, ListSection } from "../../components/List";
|
||||
import { Divider, ListItem, ListSection } from "../../Components/List";
|
||||
|
||||
const AboutScreen = ({ navigation }) => {
|
||||
const theme = useSelector((state) => state.themeReducer.theme);
|
||||
@@ -17,12 +17,12 @@ const AboutScreen = ({ navigation }) => {
|
||||
<ListSection>
|
||||
<ListItem
|
||||
title="Version"
|
||||
description="Stable 1.0.15"
|
||||
description="Stable 1.0.16"
|
||||
theme={theme}
|
||||
/>
|
||||
<ListItem
|
||||
title="Build Time"
|
||||
description="30-04-21 11:00 AM"
|
||||
description="30-04-21 11:30 PM"
|
||||
theme={theme}
|
||||
/>
|
||||
<ListItem
|
||||
|
||||
@@ -2,8 +2,8 @@ import React from "react";
|
||||
import { StyleSheet, View, Image } from "react-native";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
import { Appbar } from "../../components/Appbar";
|
||||
import { ListItem, ListSection } from "../../components/List";
|
||||
import { Appbar } from "../../Components/Appbar";
|
||||
import { ListItem, ListSection } from "../../Components/List";
|
||||
|
||||
const MoreScreen = ({ navigation }) => {
|
||||
const theme = useSelector((state) => state.themeReducer.theme);
|
||||
@@ -37,7 +37,7 @@ const MoreScreen = ({ navigation }) => {
|
||||
title="Settings"
|
||||
icon="cog-outline"
|
||||
onPress={() =>
|
||||
navigation.navigate("SettingsStack", {
|
||||
navigation.navigate("MoreStack", {
|
||||
screen: "Settings",
|
||||
})
|
||||
}
|
||||
@@ -47,7 +47,7 @@ const MoreScreen = ({ navigation }) => {
|
||||
title="Tracking"
|
||||
icon="sync"
|
||||
onPress={() =>
|
||||
navigation.navigate("SettingsStack", {
|
||||
navigation.navigate("MoreStack", {
|
||||
screen: "Trackers",
|
||||
})
|
||||
}
|
||||
@@ -57,7 +57,7 @@ const MoreScreen = ({ navigation }) => {
|
||||
title="About"
|
||||
icon="information-outline"
|
||||
onPress={() =>
|
||||
navigation.navigate("SettingsStack", {
|
||||
navigation.navigate("MoreStack", {
|
||||
screen: "About",
|
||||
})
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ import {
|
||||
restoreFromBackup,
|
||||
} from "../../database/queries/NovelQueries";
|
||||
|
||||
import { Appbar } from "../../components/Appbar";
|
||||
import { Appbar } from "../../Components/Appbar";
|
||||
import {
|
||||
Divider,
|
||||
ListItem,
|
||||
ListSection,
|
||||
ListSubHeader,
|
||||
} from "../../components/List";
|
||||
} from "../../Components/List";
|
||||
import DisplayModeModal from "./components/DisplayModeModal";
|
||||
import GridSizeModal from "./components/GridSizeModal";
|
||||
import ThemeModal from "./components/ThemeModal";
|
||||
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
myAnimeListConfig,
|
||||
getAccessToken,
|
||||
malTokenWatcher,
|
||||
} from "../../trackers/MyAnimeList";
|
||||
import { Appbar } from "../../components/Appbar";
|
||||
} from "../../Services/Trackers/myAnimeList";
|
||||
import { Appbar } from "../../Components/Appbar";
|
||||
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import {
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
ListItem,
|
||||
ListSection,
|
||||
ListSubHeader,
|
||||
} from "../../components/List";
|
||||
} from "../../Components/List";
|
||||
import { removeTracker, setTracker } from "../../redux/tracker/tracker.actions";
|
||||
|
||||
const TrackerScreen = ({ navigation }) => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import { Text, StyleSheet } from "react-native";
|
||||
import { Portal, Modal } from "react-native-paper";
|
||||
import Slider from "@react-native-community/slider";
|
||||
import { RadioButton, RadioButtonGroup } from "../../../components/RadioButton";
|
||||
import { RadioButton, RadioButtonGroup } from "../../../Components/RadioButton";
|
||||
|
||||
const GridSizeModal = ({
|
||||
itemsPerRow,
|
||||
|
||||
@@ -89,7 +89,7 @@ const ChapterCard = ({
|
||||
<TouchableRipple
|
||||
style={styles.chapterCardContainer}
|
||||
onPress={() =>
|
||||
navigation.navigate("ChapterItem", {
|
||||
navigation.navigate("Chapter", {
|
||||
chapterId: chapter.chapterId,
|
||||
chapterUrl: chapter.chapterUrl,
|
||||
extensionId,
|
||||
|
||||
@@ -17,7 +17,7 @@ const ReadButton = ({ navigation, novel, chapters, theme }) => {
|
||||
uppercase={false}
|
||||
labelStyle={{ letterSpacing: 0 }}
|
||||
onPress={() => {
|
||||
navigation.navigate("ChapterItem", {
|
||||
navigation.navigate("Chapter", {
|
||||
chapterId: lastRead.chapterId,
|
||||
chapterUrl: lastRead.chapterUrl,
|
||||
novelUrl: novel.novelUrl,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Modal, TextInput } from "react-native-paper";
|
||||
import {
|
||||
RadioButton,
|
||||
RadioButtonGroup,
|
||||
} from "../../../../components/RadioButton";
|
||||
} from "../../../../Components/RadioButton";
|
||||
|
||||
const SetTrackChaptersDialog = ({
|
||||
trackItem,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Modal } from "react-native-paper";
|
||||
import {
|
||||
RadioButton,
|
||||
RadioButtonGroup,
|
||||
} from "../../../../components/RadioButton";
|
||||
} from "../../../../Components/RadioButton";
|
||||
|
||||
const SetTrackScoreDialog = ({
|
||||
trackItem,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Modal } from "react-native-paper";
|
||||
import {
|
||||
RadioButton,
|
||||
RadioButtonGroup,
|
||||
} from "../../../../components/RadioButton";
|
||||
} from "../../../../Components/RadioButton";
|
||||
|
||||
const SetTrackStatusDialog = ({
|
||||
trackItem,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { StyleSheet, Text, View, Image, ActivityIndicator } from "react-native";
|
||||
import { Button, Modal, TextInput, TouchableRipple } from "react-native-paper";
|
||||
import { searchNovels } from "../../../../trackers/MyAnimeList";
|
||||
import { searchNovels } from "../../../../Services/Trackers/myAnimeList";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import { ScrollView } from "react-native-gesture-handler";
|
||||
import { trackNovel } from "../../../../redux/tracker/tracker.actions";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useFocusEffect } from "@react-navigation/native";
|
||||
import { StyleSheet, View, FlatList, ActivityIndicator } from "react-native";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import EmptyView from "../../components/EmptyView";
|
||||
import EmptyView from "../../Components/EmptyView";
|
||||
import { getUpdatesAction } from "../../redux/updates/updates.actions";
|
||||
import { Appbar } from "./components/Appbar";
|
||||
import UpdateCard from "./components/UpdateCard";
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import { Appbar as MaterialAppbar } from "react-native-paper";
|
||||
|
||||
import { useSelector } from "react-redux";
|
||||
import { updateAllNovels } from "../../../services/updates";
|
||||
import { updateAllNovels } from "../../../Services/updates";
|
||||
|
||||
export const Appbar = () => {
|
||||
const theme = useSelector((state) => state.themeReducer.theme);
|
||||
|
||||
@@ -16,7 +16,7 @@ const UpdateCard = ({ item }) => {
|
||||
style={styles.updateCard}
|
||||
onPress={() =>
|
||||
// console.log(item);
|
||||
navigation.navigate("ChapterItem", {
|
||||
navigation.navigate("Chapter", {
|
||||
chapterId: item.chapterId,
|
||||
chapterUrl: item.chapterUrl,
|
||||
extensionId: item.sourceId,
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import React from "react";
|
||||
import * as SQLite from "expo-sqlite";
|
||||
import { getLibrary } from "../database/queries/LibraryQueries";
|
||||
import { fetchChapters, fetchNovel } from "../source/Source";
|
||||
import { fetchChapters, fetchNovel } from "../Services/Source/source";
|
||||
const db = SQLite.openDatabase("lnreader.db");
|
||||
import { ToastAndroid } from "react-native";
|
||||
import NewUpdateDialog from "../components/NewUpdateDialog";
|
||||
|
||||
export const checkGithubRelease = async () => {
|
||||
const res = await fetch(
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export const useTheme = () => {
|
||||
const currentTheme = useSelector((state) => state.themeReducer.theme);
|
||||
|
||||
return currentTheme;
|
||||
};
|
||||
Reference in New Issue
Block a user