Skip to content

Commit b861d23

Browse files
authored
Merge pull request #40 from CD-Z/useNovel_Refactor
Use novel refactor
2 parents 010a183 + 6672aff commit b861d23

142 files changed

Lines changed: 3713 additions & 2482 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

App.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import AppErrorBoundary from '@components/AppErrorBoundary/AppErrorBoundary';
1616

1717
import Main from './src/navigators/Main';
1818
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
19+
import { Providers } from './src/providers/Providers';
1920

2021
Notifications.setNotificationHandler({
2122
handleNotification: async () => {
@@ -33,16 +34,18 @@ LottieSplashScreen.hide();
3334
const App = () => {
3435
return (
3536
<GestureHandlerRootView style={styles.flex}>
36-
<AppErrorBoundary>
37-
<SafeAreaProvider>
38-
<PaperProvider>
39-
<BottomSheetModalProvider>
40-
<StatusBar translucent={true} backgroundColor="transparent" />
41-
<Main />
42-
</BottomSheetModalProvider>
43-
</PaperProvider>
44-
</SafeAreaProvider>
45-
</AppErrorBoundary>
37+
<Providers>
38+
<AppErrorBoundary>
39+
<SafeAreaProvider>
40+
<PaperProvider>
41+
<BottomSheetModalProvider>
42+
<StatusBar translucent={true} backgroundColor="transparent" />
43+
<Main />
44+
</BottomSheetModalProvider>
45+
</PaperProvider>
46+
</SafeAreaProvider>
47+
</AppErrorBoundary>
48+
</Providers>
4649
</GestureHandlerRootView>
4750
);
4851
};

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = function (api) {
2020
'@strings': './strings',
2121
'@services': './src/services',
2222
'@plugins': './src/plugins',
23+
'@providers': './src/providers',
2324
'@utils': './src/utils',
2425
'@theme': './src/theme',
2526
'@navigators': './src/navigators',

package-lock.json

Lines changed: 40 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"android": {
2626
"javaPackageName": "com.lnreader.spec"
2727
},
28-
"ios": {
28+
"ios": {
2929
"modulesProvider": {
3030
"NativeEpubUtil": "RCTNativeEpubUtil",
3131
"NativeFile": "RCTNativeFile",
@@ -96,8 +96,8 @@
9696
},
9797
"devDependencies": {
9898
"@babel/core": "^7.26.0",
99-
"@babel/preset-env": "7.25.3",
100-
"@babel/runtime": "7.25.0",
99+
"@babel/preset-env": "^7.25.3",
100+
"@babel/runtime": "^7.25.0",
101101
"@react-native-community/cli": "^18.0.0",
102102
"@react-native-community/cli-platform-android": "^18.0.0",
103103
"@react-native-community/cli-platform-ios": "^18.0.0",
@@ -111,7 +111,7 @@
111111
"@types/react": "19.1.3",
112112
"@types/sanitize-html": "^2.11.0",
113113
"babel-plugin-module-resolver": "^5.0.2",
114-
"babel-plugin-react-compiler": "19.1.0-rc.1",
114+
"babel-plugin-react-compiler": "19.1.0-rc.2",
115115
"eslint": "^8.19.0",
116116
"husky": "^7.0.4",
117117
"lint-staged": "^12.3.7",

src/components/Actionbar/Actionbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useTheme } from '@hooks/persisted';
1+
import { useTheme } from '@providers/Providers';
22
import React from 'react';
33
import {
44
Dimensions,
@@ -12,12 +12,12 @@ import MaterialCommunityIcons from '@react-native-vector-icons/material-design-i
1212
import { MaterialDesignIconName } from '@type/icon';
1313
import Animated, { SlideInDown, SlideOutDown } from 'react-native-reanimated';
1414

15-
type Action = {
15+
export type Action = {
1616
icon: MaterialDesignIconName;
1717
onPress: () => void;
1818
};
1919

20-
interface ActionbarProps {
20+
export interface ActionbarProps {
2121
active: boolean;
2222
actions: Action[];
2323
viewStyle?: StyleProp<ViewStyle>;

src/components/AppErrorBoundary/AppErrorBoundary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { StyleSheet, View, Text, StatusBar } from 'react-native';
33
import ErrorBoundary from 'react-native-error-boundary';
44

55
import { Button, List } from '@components';
6-
import { useTheme } from '@hooks/persisted';
6+
import { useTheme } from '@providers/Providers';
77
import { SafeAreaView } from 'react-native-safe-area-context';
88

99
interface ErrorFallbackProps {

src/components/Button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
ButtonProps as PaperButtonProps,
55
} from 'react-native-paper';
66

7-
import { useTheme } from '@hooks/persisted';
7+
import { useTheme } from '@providers/Providers';
88
import { ThemeProp } from 'react-native-paper/lib/typescript/types';
99

1010
interface ButtonProps extends Partial<PaperButtonProps> {

0 commit comments

Comments
 (0)