Skip to content

Commit 0ca0225

Browse files
authored
Merge pull request #2 from afnx/feature/state-management
Feature/state management
2 parents 5873ef3 + 548a29d commit 0ca0225

21 files changed

Lines changed: 691 additions & 9 deletions

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
EXPO_PUBLIC_HOME_PAGE_URL=https://afnprojects.com

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ yarn-error.*
3030

3131
# local env files
3232
.env*.local
33+
.env
3334

3435
# typescript
3536
*.tsbuildinfo

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
},
77
"typescript.tsdk": "node_modules/typescript/lib",
88
"cSpell.words": [
9+
"persistor",
910
"scriptian"
1011
]
1112
}

__tests__/Index-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render } from "@testing-library/react-native";
22

3-
import Index from "@/app/index";
3+
import Index from "@/src/app/index";
44

55
describe("<Index />", () => {
66
test("Text renders correctly on Index", () => {

app/_layout.tsx

Lines changed: 0 additions & 5 deletions
This file was deleted.

package-lock.json

Lines changed: 145 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
},
1414
"dependencies": {
1515
"@expo/vector-icons": "^15.0.2",
16+
"@react-native-async-storage/async-storage": "^2.2.0",
1617
"@react-navigation/bottom-tabs": "^7.4.0",
1718
"@react-navigation/elements": "^2.6.3",
1819
"@react-navigation/native": "^7.1.8",
20+
"@reduxjs/toolkit": "^2.9.0",
1921
"expo": "~54.0.13",
2022
"expo-constants": "~18.0.9",
2123
"expo-dev-client": "~6.0.15",
@@ -38,7 +40,9 @@
3840
"react-native-screens": "~4.16.0",
3941
"react-native-web": "~0.21.0",
4042
"react-native-webview": "13.15.0",
41-
"react-native-worklets": "0.5.1"
43+
"react-native-worklets": "0.5.1",
44+
"react-redux": "^9.2.0",
45+
"redux-persist": "^6.0.0"
4246
},
4347
"devDependencies": {
4448
"@testing-library/react-native": "^13.3.3",
@@ -55,4 +59,4 @@
5559
"jest": {
5660
"preset": "jest-expo"
5761
}
58-
}
62+
}

src/app/_layout.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Stack } from "expo-router";
2+
import { StatusBar } from "expo-status-bar";
3+
import React from "react";
4+
import { ActivityIndicator, Text, View } from "react-native";
5+
import { SafeAreaProvider } from "react-native-safe-area-context";
6+
import { Provider } from "react-redux";
7+
import { PersistGate } from "redux-persist/integration/react";
8+
9+
import { persistor, store } from "../store";
10+
11+
const LoadingComponent = () => (
12+
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
13+
<ActivityIndicator size="large" color="#007AFF" />
14+
<Text style={{ marginTop: 16, fontSize: 16, color: "#8E8E93" }}>
15+
Loading Scriptian...
16+
</Text>
17+
</View>
18+
);
19+
20+
export default function RootLayout() {
21+
return (
22+
<Provider store={store}>
23+
<PersistGate loading={<LoadingComponent />} persistor={persistor}>
24+
<SafeAreaProvider>
25+
<StatusBar style="auto" />
26+
<Stack screenOptions={{ headerShown: false }}>
27+
<Stack.Screen name="index" />
28+
</Stack>
29+
</SafeAreaProvider>
30+
</PersistGate>
31+
</Provider>
32+
);
33+
}
File renamed without changes.

0 commit comments

Comments
 (0)