Skip to content

Commit 5537eca

Browse files
committed
Redux system initialized
1 parent dc46288 commit 5537eca

File tree

7 files changed

+87
-9
lines changed

7 files changed

+87
-9
lines changed

App.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import AppLoading from 'expo-app-loading'
22
import { StatusBar } from 'expo-status-bar'
33
import React, { useState } from 'react'
4-
import {} from 'react-native'
4+
import { Provider } from 'react-redux'
55

6+
import store from './src/store'
67
import { boostrap } from './src/bootstrap'
78
import { AppNavigation } from './src/navigation/AppNavigation'
89

@@ -20,9 +21,9 @@ export default function App() {
2021
}
2122

2223
return (
23-
<>
24+
<Provider store={store}>
2425
<AppNavigation />
2526
<StatusBar style='auto' />
26-
</>
27+
</Provider>
2728
)
2829
}

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"react-navigation-header-buttons": "6",
3030
"react-navigation-material-bottom-tabs": "^2.3.4",
3131
"react-navigation-stack": "^2.10.4",
32-
"react-navigation-tabs": "^2.11.1"
32+
"react-navigation-tabs": "^2.11.1",
33+
"react-redux": "^7.2.5",
34+
"redux": "^4.1.1"
3335
},
3436
"devDependencies": {
3537
"@babel/core": "^7.9.0"

src/navigation/AppNavigation.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ const MainNavigator = createDrawerNavigator(
124124
contentOptions: {
125125
activeTintColor: THEME.PRIMARY_COLOR,
126126
labelStyle: {
127-
fontFamily: 'open-regular',
128-
},
127+
fontFamily: 'open-regular'
128+
}
129129
}
130130
}
131131
)

src/screens/CreateScreen.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ const styles = StyleSheet.create({
2929
center: {
3030
flex: 1,
3131
alignItems: 'center',
32-
justifyContent: 'center',
32+
justifyContent: 'center'
3333
}
3434
})

src/store/index.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { createStore, combineReducers } from 'redux'
2+
3+
import { postReducer } from './reducers/post'
4+
5+
const rootReducer = combineReducers({
6+
post: postReducer
7+
})
8+
9+
export default createStore(rootReducer)

src/store/reducers/post.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const initialState = {}
2+
3+
export const postReducer = (state = initialState, action) => {
4+
return state
5+
}

yarn.lock

+63-2
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@
10851085
pirates "^4.0.0"
10861086
source-map-support "^0.5.16"
10871087

1088-
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.8.4":
1088+
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
10891089
version "7.15.4"
10901090
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a"
10911091
integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==
@@ -1637,6 +1637,14 @@
16371637
resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.40.tgz#ded0240b6ea1ad7afc1e60374c49087aaea5dbd8"
16381638
integrity sha512-VbjwR1fhsn2h2KXAY4oy1fm7dCxaKy0D+deTb8Ilc3Eo3rc5+5eA4rfYmZaHgNJKxVyI0f6WIXzO2zLkVmQPHA==
16391639

1640+
"@types/hoist-non-react-statics@^3.3.0":
1641+
version "3.3.1"
1642+
resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"
1643+
integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==
1644+
dependencies:
1645+
"@types/react" "*"
1646+
hoist-non-react-statics "^3.3.0"
1647+
16401648
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
16411649
version "2.0.3"
16421650
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762"
@@ -1669,6 +1677,35 @@
16691677
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e"
16701678
integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ==
16711679

1680+
"@types/prop-types@*":
1681+
version "15.7.4"
1682+
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11"
1683+
integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==
1684+
1685+
"@types/react-redux@^7.1.16":
1686+
version "7.1.19"
1687+
resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.19.tgz#477bd0a9b01bae6d6bf809418cdfa7d3c16d4c62"
1688+
integrity sha512-L37dSCT0aoJnCgpR8Iuginlbxoh7qhWOXiaDqEsxVMrER1CmVhFD+63NxgJeT4pkmEM28oX0NH4S4f+sXHTZjA==
1689+
dependencies:
1690+
"@types/hoist-non-react-statics" "^3.3.0"
1691+
"@types/react" "*"
1692+
hoist-non-react-statics "^3.3.0"
1693+
redux "^4.0.0"
1694+
1695+
"@types/react@*":
1696+
version "17.0.27"
1697+
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.27.tgz#6498ed9b3ad117e818deb5525fa1946c09f2e0e6"
1698+
integrity sha512-zgiJwtsggVGtr53MndV7jfiUESTqrbxOcBvwfe6KS/9bzaVPCTDieTWnFNecVNx6EAaapg5xsLLWFfHHR437AA==
1699+
dependencies:
1700+
"@types/prop-types" "*"
1701+
"@types/scheduler" "*"
1702+
csstype "^3.0.2"
1703+
1704+
"@types/scheduler@*":
1705+
version "0.16.2"
1706+
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
1707+
integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==
1708+
16721709
"@types/stack-utils@^1.0.1":
16731710
version "1.0.1"
16741711
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
@@ -2555,6 +2592,11 @@ css-in-js-utils@^2.0.0:
25552592
hyphenate-style-name "^1.0.2"
25562593
isobject "^3.0.1"
25572594

2595+
csstype@^3.0.2:
2596+
version "3.0.9"
2597+
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.9.tgz#6410af31b26bd0520933d02cbc64fce9ce3fbf0b"
2598+
integrity sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw==
2599+
25582600
dayjs@^1.8.15:
25592601
version "1.10.7"
25602602
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468"
@@ -4955,7 +4997,7 @@ react-dom@16.13.1:
49554997
prop-types "^15.6.2"
49564998
scheduler "^0.19.1"
49574999

4958-
react-is@^16.12.0, react-is@^16.13.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4:
5000+
react-is@^16.12.0, react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4:
49595001
version "16.13.1"
49605002
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
49615003
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@@ -5116,6 +5158,18 @@ react-navigation@^4.4.4:
51165158
"@react-navigation/core" "^3.7.9"
51175159
"@react-navigation/native" "^3.8.4"
51185160

5161+
react-redux@^7.2.5:
5162+
version "7.2.5"
5163+
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.5.tgz#213c1b05aa1187d9c940ddfc0b29450957f6a3b8"
5164+
integrity sha512-Dt29bNyBsbQaysp6s/dN0gUodcq+dVKKER8Qv82UrpeygwYeX1raTtil7O/fftw/rFqzaf6gJhDZRkkZnn6bjg==
5165+
dependencies:
5166+
"@babel/runtime" "^7.12.1"
5167+
"@types/react-redux" "^7.1.16"
5168+
hoist-non-react-statics "^3.3.2"
5169+
loose-envify "^1.4.0"
5170+
prop-types "^15.7.2"
5171+
react-is "^16.13.1"
5172+
51195173
react-refresh@^0.4.0:
51205174
version "0.4.3"
51215175
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.3.tgz#966f1750c191672e76e16c2efa569150cc73ab53"
@@ -5148,6 +5202,13 @@ readable-stream@^2.0.1, readable-stream@^2.2.2, readable-stream@~2.3.6:
51485202
string_decoder "~1.1.1"
51495203
util-deprecate "~1.0.1"
51505204

5205+
redux@^4.0.0, redux@^4.1.1:
5206+
version "4.1.1"
5207+
resolved "https://registry.yarnpkg.com/redux/-/redux-4.1.1.tgz#76f1c439bb42043f985fbd9bf21990e60bd67f47"
5208+
integrity sha512-hZQZdDEM25UY2P493kPYuKqviVwZ58lEmGQNeQ+gXa+U0gYPUBf7NKYazbe3m+bs/DzM/ahN12DbF+NG8i0CWw==
5209+
dependencies:
5210+
"@babel/runtime" "^7.9.2"
5211+
51515212
regenerate-unicode-properties@^9.0.0:
51525213
version "9.0.0"
51535214
resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz#54d09c7115e1f53dc2314a974b32c1c344efe326"

0 commit comments

Comments
 (0)