@coorpacademy/app-review 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/__tmp-backup-vues-mobile/revision-home.d.ts.map +1 -0
- package/es/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts.map +1 -0
- package/es/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts.map +1 -0
- package/es/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts.map +1 -0
- package/es/components/root-view.d.ts +6 -0
- package/es/components/root-view.d.ts.map +1 -0
- package/es/components/root-view.js +19 -0
- package/es/components/root-view.native.d.ts +3 -0
- package/es/components/root-view.native.d.ts.map +1 -0
- package/{dist/index.js → es/components/root-view.native.js} +2 -25
- package/es/configure-store.d.ts.map +1 -0
- package/es/configure-store.js +17 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +26 -0
- package/lib/actions/index.d.ts +2 -0
- package/lib/actions/index.d.ts.map +1 -0
- package/lib/actions/index.js +17 -0
- package/lib/actions/navigation.d.ts +13 -0
- package/lib/actions/navigation.d.ts.map +1 -0
- package/lib/actions/navigation.js +14 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-home.d.ts +9 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-home.d.ts.map +1 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-home.js +100 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +2 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts.map +1 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.js +16 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts +3 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts.map +1 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.js +62 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts +18 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts.map +1 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.js +130 -0
- package/lib/components/root-view.d.ts +6 -0
- package/lib/components/root-view.d.ts.map +1 -0
- package/lib/components/root-view.js +33 -0
- package/lib/components/root-view.native.d.ts +3 -0
- package/lib/components/root-view.native.d.ts.map +1 -0
- package/lib/components/root-view.native.js +47 -0
- package/lib/configure-store.d.ts +6 -0
- package/lib/configure-store.d.ts.map +1 -0
- package/lib/configure-store.js +20 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +40 -0
- package/lib/reducers/index.d.ts +5 -0
- package/lib/reducers/index.d.ts.map +1 -0
- package/lib/reducers/index.js +8 -0
- package/lib/reducers/navigation.d.ts +7 -0
- package/lib/reducers/navigation.d.ts.map +1 -0
- package/lib/reducers/navigation.js +32 -0
- package/package.json +27 -7
- package/readme.md +16 -2
- package/src/components/root-view.modules.css +8 -0
- package/src/components/root-view.native.tsx +69 -0
- package/src/components/root-view.tsx +25 -0
- package/src/configure-store.ts +10 -11
- package/src/index.tsx +1 -64
- package/dist/components/revision-home.d.ts.map +0 -1
- package/dist/components/revision-home.stories.d.ts.map +0 -1
- package/dist/components/revision-onboarding.d.ts.map +0 -1
- package/dist/components/revision-quizzer.d.ts.map +0 -1
- package/dist/configure-store.d.ts.map +0 -1
- package/dist/configure-store.js +0 -18
- package/dist/index.d.ts.map +0 -1
- /package/{dist → es}/actions/index.d.ts +0 -0
- /package/{dist → es}/actions/index.d.ts.map +0 -0
- /package/{dist → es}/actions/index.js +0 -0
- /package/{dist → es}/actions/navigation.d.ts +0 -0
- /package/{dist → es}/actions/navigation.d.ts.map +0 -0
- /package/{dist → es}/actions/navigation.js +0 -0
- /package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-home.d.ts +0 -0
- /package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-home.js +0 -0
- /package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-home.stories.d.ts +0 -0
- /package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-home.stories.js +0 -0
- /package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-onboarding.d.ts +0 -0
- /package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-onboarding.js +0 -0
- /package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-quizzer.d.ts +0 -0
- /package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-quizzer.js +0 -0
- /package/{dist → es}/configure-store.d.ts +0 -0
- /package/{dist → es}/index.d.ts +0 -0
- /package/{dist → es}/reducers/index.d.ts +0 -0
- /package/{dist → es}/reducers/index.d.ts.map +0 -0
- /package/{dist → es}/reducers/index.js +0 -0
- /package/{dist → es}/reducers/navigation.d.ts +0 -0
- /package/{dist → es}/reducers/navigation.d.ts.map +0 -0
- /package/{dist → es}/reducers/navigation.js +0 -0
- /package/src/components/{revision-home.stories.tsx → __tmp-backup-vues-mobile/revision-home.stories.tsx} +0 -0
- /package/src/components/{revision-home.tsx → __tmp-backup-vues-mobile/revision-home.tsx} +0 -0
- /package/src/components/{revision-onboarding.tsx → __tmp-backup-vues-mobile/revision-onboarding.tsx} +0 -0
- /package/src/components/{revision-quizzer.tsx → __tmp-backup-vues-mobile/revision-quizzer.tsx} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var react_1 = require("react");
|
|
4
|
+
var react_native_1 = require("react-native");
|
|
5
|
+
// -----------------------------------------------------------------------------
|
|
6
|
+
var styles = react_native_1.StyleSheet.create({
|
|
7
|
+
rootView: {
|
|
8
|
+
flex: 1,
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
justifyContent: 'center'
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
// -----------------------------------------------------------------------------
|
|
14
|
+
var NavText = function (_a) {
|
|
15
|
+
var viewName = _a.viewName, navigateTo = _a.navigateTo;
|
|
16
|
+
switch (viewName) {
|
|
17
|
+
case 'home':
|
|
18
|
+
return (react_1.default.createElement(react_native_1.Pressable, { onPress: function () {
|
|
19
|
+
navigateTo('onboarding');
|
|
20
|
+
} },
|
|
21
|
+
react_1.default.createElement(react_native_1.Text, null, "view home")));
|
|
22
|
+
case 'onboarding':
|
|
23
|
+
return (react_1.default.createElement(react_native_1.Pressable, { onPress: function () { return navigateTo('quizzer'); } },
|
|
24
|
+
react_1.default.createElement(react_native_1.Text, null, "view onboarding")));
|
|
25
|
+
case 'quizzer':
|
|
26
|
+
return (react_1.default.createElement(react_native_1.Pressable, { onPress: function () { return navigateTo('home'); } },
|
|
27
|
+
react_1.default.createElement(react_native_1.Text, null, "view quizzer")));
|
|
28
|
+
default:
|
|
29
|
+
return react_1.default.createElement(react_native_1.Text, null, "view (none selected)");
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
// -----------------------------------------------------------------------------
|
|
33
|
+
var RootView = function (props) {
|
|
34
|
+
var backAction = function () {
|
|
35
|
+
props.navigateBack();
|
|
36
|
+
return true;
|
|
37
|
+
};
|
|
38
|
+
(0, react_1.useEffect)(function () {
|
|
39
|
+
// https://reactnative.dev/docs/backhandler
|
|
40
|
+
var backHandler = react_native_1.BackHandler.addEventListener('hardwareBackPress', backAction);
|
|
41
|
+
return function () { return backHandler.remove(); };
|
|
42
|
+
}, []);
|
|
43
|
+
return (react_1.default.createElement(react_native_1.View, { style: styles.rootView },
|
|
44
|
+
react_1.default.createElement(NavText, { viewName: props.viewName, navigateTo: props.navigateTo })));
|
|
45
|
+
};
|
|
46
|
+
// -----------------------------------------------------------------------------
|
|
47
|
+
exports.default = RootView;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export default function configureStore(services: any): import("redux").Store<import("redux").EmptyObject & {
|
|
2
|
+
navigation: import("./reducers/navigation").State;
|
|
3
|
+
}, import("redux").AnyAction> & {
|
|
4
|
+
dispatch: unknown;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=configure-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure-store.d.ts","sourceRoot":"","sources":["../src/configure-store.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,QAAQ,KAAA;;;;EAc9C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var redux_1 = require("redux");
|
|
4
|
+
var redux_thunk_1 = require("redux-thunk");
|
|
5
|
+
var redux_devtools_extension_1 = require("redux-devtools-extension");
|
|
6
|
+
var reducers_1 = require("./reducers");
|
|
7
|
+
var preloadedState = undefined;
|
|
8
|
+
function configureStore(services) {
|
|
9
|
+
var _compose = process.env.NODE_ENV !== 'production'
|
|
10
|
+
? (0, redux_devtools_extension_1.composeWithDevTools)({
|
|
11
|
+
name: 'app-review',
|
|
12
|
+
trace: true,
|
|
13
|
+
traceLimit: 25
|
|
14
|
+
})
|
|
15
|
+
: redux_1.compose;
|
|
16
|
+
var enhancer = _compose((0, redux_1.applyMiddleware)(redux_thunk_1.default));
|
|
17
|
+
var store = (0, redux_1.createStore)(reducers_1.default, preloadedState, enhancer);
|
|
18
|
+
return store;
|
|
19
|
+
}
|
|
20
|
+
exports.default = configureStore;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,WAAW;;iBAehB,CAAC;AAIF,eAAe,WAAW,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var react_1 = require("react");
|
|
15
|
+
var react_redux_1 = require("react-redux");
|
|
16
|
+
var configure_store_1 = require("./configure-store");
|
|
17
|
+
var navigation_1 = require("./actions/navigation");
|
|
18
|
+
var navigation_2 = require("./reducers/navigation");
|
|
19
|
+
var root_view_1 = require("./components/root-view");
|
|
20
|
+
// -----------------------------------------------------------------------------
|
|
21
|
+
var mapStateToProps = function (state, ownProps) {
|
|
22
|
+
return __assign(__assign({}, ownProps), { viewName: (0, navigation_2.getCurrentViewName)(state) });
|
|
23
|
+
};
|
|
24
|
+
var mapDispatchToProps = { navigateTo: navigation_1.navigateTo, navigateBack: navigation_1.navigateBack };
|
|
25
|
+
var App = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(root_view_1.default);
|
|
26
|
+
// -----------------------------------------------------------------------------
|
|
27
|
+
var AppRevision = function (_a) {
|
|
28
|
+
var services = _a.services;
|
|
29
|
+
var _b = (0, react_1.useState)(null), store = _b[0], setStore = _b[1];
|
|
30
|
+
(0, react_1.useEffect)(function () {
|
|
31
|
+
var store = (0, configure_store_1.default)(services);
|
|
32
|
+
setStore(store);
|
|
33
|
+
}, []);
|
|
34
|
+
if (!store)
|
|
35
|
+
return null;
|
|
36
|
+
return (react_1.default.createElement(react_redux_1.Provider, { store: store },
|
|
37
|
+
react_1.default.createElement(App, null)));
|
|
38
|
+
};
|
|
39
|
+
// -----------------------------------------------------------------------------
|
|
40
|
+
exports.default = AppRevision;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reducers/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,WAAW;;8BAEf,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var redux_1 = require("redux");
|
|
4
|
+
var navigation_1 = require("./navigation");
|
|
5
|
+
var rootReducer = (0, redux_1.combineReducers)({
|
|
6
|
+
navigation: navigation_1.default
|
|
7
|
+
});
|
|
8
|
+
exports.default = rootReducer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { $NAVIGATE_TO, $NAVIGATE_BACK } from '../actions/navigation';
|
|
2
|
+
export declare type State = Array<string>;
|
|
3
|
+
export declare const initialState: State;
|
|
4
|
+
declare const reducer: (state: State, action: $NAVIGATE_TO | $NAVIGATE_BACK) => State;
|
|
5
|
+
export declare const getCurrentViewName: (appState: any) => any;
|
|
6
|
+
export default reducer;
|
|
7
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/reducers/navigation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAExE,oBAAY,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAElC,eAAO,MAAM,YAAY,EAAE,KAAgB,CAAC;AAE5C,QAAA,MAAM,OAAO,yBAAyC,YAAY,GAAG,cAAc,UAalF,CAAC;AAEF,eAAO,MAAM,kBAAkB,wBAAkE,CAAC;AAClG,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getCurrentViewName = exports.initialState = void 0;
|
|
13
|
+
var navigation_1 = require("../actions/navigation");
|
|
14
|
+
exports.initialState = ['home'];
|
|
15
|
+
var reducer = function (state, action) {
|
|
16
|
+
if (state === void 0) { state = exports.initialState; }
|
|
17
|
+
switch (action.type) {
|
|
18
|
+
case navigation_1.NAVIGATE_TO: {
|
|
19
|
+
return __spreadArray(__spreadArray([], state, true), [action.payload], false);
|
|
20
|
+
}
|
|
21
|
+
case navigation_1.NAVIGATE_BACK: {
|
|
22
|
+
var newState = __spreadArray([], state, true);
|
|
23
|
+
newState.pop();
|
|
24
|
+
return newState;
|
|
25
|
+
}
|
|
26
|
+
default:
|
|
27
|
+
return state;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var getCurrentViewName = function (appState) { return appState.navigation[appState.navigation.length - 1]; };
|
|
31
|
+
exports.getCurrentViewName = getCurrentViewName;
|
|
32
|
+
exports.default = reducer;
|
package/package.json
CHANGED
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/app-review",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=16.15.0"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"
|
|
10
|
+
"start": "node scripts/start.js",
|
|
11
|
+
"static": "node scripts/build.js",
|
|
12
|
+
"poststatic": "cp -r public static",
|
|
13
|
+
"prepare": "npm run clean && npm run build --production",
|
|
14
|
+
"build:commonjs": "tsc -p tsconfig.lib.json",
|
|
15
|
+
"build:es": "tsc -p tsconfig.es.json",
|
|
16
|
+
"build": "concurrently \"npm run build:commonjs\" \"npm run build:es\"",
|
|
17
|
+
"clean:commonjs": "rm -rf lib",
|
|
18
|
+
"clean:es": "rm -rf es",
|
|
19
|
+
"clean": "concurrently \"npm run clean:commonjs\" \"npm run clean:es\"",
|
|
20
|
+
"test:unit": "echo @todo setup unit tests"
|
|
11
21
|
},
|
|
12
22
|
"author": "CoorpAcademy",
|
|
13
23
|
"files": [
|
|
14
|
-
"
|
|
24
|
+
"lib",
|
|
25
|
+
"es",
|
|
15
26
|
"src",
|
|
16
27
|
"readme.md"
|
|
17
28
|
],
|
|
18
|
-
"main": "./
|
|
29
|
+
"main": "./es/index.js",
|
|
19
30
|
"exports": {
|
|
20
31
|
".": {
|
|
21
|
-
"import": "./
|
|
22
|
-
"
|
|
32
|
+
"import": "./es/index.js",
|
|
33
|
+
"commonjs": "./lib/index.js",
|
|
34
|
+
"types": "./es/index.d.ts"
|
|
23
35
|
},
|
|
24
36
|
"./package.json": "./package.json"
|
|
25
37
|
},
|
|
@@ -31,8 +43,16 @@
|
|
|
31
43
|
},
|
|
32
44
|
"devDependencies": {
|
|
33
45
|
"@storybook/react-native": "^5.3.25",
|
|
46
|
+
"chalk": "^5.0.1",
|
|
47
|
+
"concurrently": "^5.2.0",
|
|
48
|
+
"connect-history-api-fallback": "^1.6.0",
|
|
49
|
+
"esbuild": "^0.14.39",
|
|
50
|
+
"esbuild-css-modules-plugin": "^2.2.16",
|
|
51
|
+
"esbuild-plugin-svgr": "^1.0.1",
|
|
52
|
+
"live-server": "^1.2.2",
|
|
53
|
+
"react-dom": "^17.0.2",
|
|
34
54
|
"redux-devtools-extension": "^2.13.9",
|
|
35
55
|
"typescript": "^4.6.4"
|
|
36
56
|
},
|
|
37
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "60a05637c27cbcae438fa31d147462672d2b200d"
|
|
38
58
|
}
|
package/readme.md
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
# App Review
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## start local sandbox
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```sh
|
|
6
|
+
npm start
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## generate /static
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm run static
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
(This script is generated by lerna to publish the static web app)
|
|
6
16
|
|
|
7
17
|
## dependencies notes
|
|
8
18
|
|
|
@@ -11,3 +21,7 @@ export: <https://stackoverflow.com/a/70020984/959219>
|
|
|
11
21
|
|
|
12
22
|
`react` must also be the same version on this package and the rootApp
|
|
13
23
|
*(possible generic error Warning: Invalid hook call. [...] 3. You might have more than one copy of React in the same app)*
|
|
24
|
+
|
|
25
|
+
### tmp notes
|
|
26
|
+
|
|
27
|
+
export: <https://stackoverflow.com/a/70020984/959219>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, {useEffect} from 'react';
|
|
2
|
+
import {Text, StyleSheet, Pressable, View, BackHandler} from 'react-native';
|
|
3
|
+
|
|
4
|
+
// -----------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
rootView: {
|
|
8
|
+
flex: 1,
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
justifyContent: 'center'
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// -----------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
const NavText = ({viewName, navigateTo}) => {
|
|
17
|
+
switch (viewName) {
|
|
18
|
+
case 'home':
|
|
19
|
+
return (
|
|
20
|
+
<Pressable
|
|
21
|
+
onPress={() => {
|
|
22
|
+
navigateTo('onboarding');
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<Text>view home</Text>
|
|
26
|
+
</Pressable>
|
|
27
|
+
);
|
|
28
|
+
case 'onboarding':
|
|
29
|
+
return (
|
|
30
|
+
<Pressable onPress={() => navigateTo('quizzer')}>
|
|
31
|
+
<Text>view onboarding</Text>
|
|
32
|
+
</Pressable>
|
|
33
|
+
);
|
|
34
|
+
case 'quizzer':
|
|
35
|
+
return (
|
|
36
|
+
<Pressable onPress={() => navigateTo('home')}>
|
|
37
|
+
<Text>view quizzer</Text>
|
|
38
|
+
</Pressable>
|
|
39
|
+
);
|
|
40
|
+
default:
|
|
41
|
+
return <Text>view (none selected)</Text>;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// -----------------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
const RootView = (props) => {
|
|
48
|
+
const backAction = () => {
|
|
49
|
+
props.navigateBack();
|
|
50
|
+
return true;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
// https://reactnative.dev/docs/backhandler
|
|
55
|
+
const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);
|
|
56
|
+
|
|
57
|
+
return () => backHandler.remove();
|
|
58
|
+
}, []);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<View style={styles.rootView}>
|
|
62
|
+
<NavText viewName={props.viewName} navigateTo={props.navigateTo} />
|
|
63
|
+
</View>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// -----------------------------------------------------------------------------
|
|
68
|
+
|
|
69
|
+
export default RootView;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from './root-view.modules.css';
|
|
3
|
+
|
|
4
|
+
// -----------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
const Button = (props) => <p {...props} className={styles.textButton} />;
|
|
7
|
+
|
|
8
|
+
// -----------------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
const RootView = ({viewName, navigateTo}) => {
|
|
11
|
+
switch (viewName) {
|
|
12
|
+
case 'home':
|
|
13
|
+
return <Button onClick={() => navigateTo('onboarding')}>view home</Button>;
|
|
14
|
+
case 'onboarding':
|
|
15
|
+
return <Button onClick={() => navigateTo('quizzer')}>view onboarding</Button>;
|
|
16
|
+
case 'quizzer':
|
|
17
|
+
return <Button onClick={() => navigateTo('home')}>view quizzer</Button>;
|
|
18
|
+
default:
|
|
19
|
+
return <Button>view (none selected)</Button>;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// -----------------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
export default RootView;
|
package/src/configure-store.ts
CHANGED
|
@@ -2,23 +2,22 @@ import {applyMiddleware, compose, createStore} from 'redux';
|
|
|
2
2
|
import thunk from 'redux-thunk';
|
|
3
3
|
import {composeWithDevTools} from 'redux-devtools-extension';
|
|
4
4
|
|
|
5
|
-
import * as actionCreators from './actions';
|
|
6
5
|
import rootReducer from './reducers';
|
|
7
6
|
|
|
8
7
|
const preloadedState = undefined;
|
|
9
8
|
|
|
10
9
|
export default function configureStore(services) {
|
|
11
|
-
const _compose =
|
|
10
|
+
const _compose =
|
|
11
|
+
process.env.NODE_ENV !== 'production'
|
|
12
|
+
? composeWithDevTools({
|
|
13
|
+
name: 'app-review',
|
|
14
|
+
trace: true,
|
|
15
|
+
traceLimit: 25
|
|
16
|
+
})
|
|
17
|
+
: compose;
|
|
12
18
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
name: 'app-review',
|
|
16
|
-
trace: true,
|
|
17
|
-
traceLimit: 25
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const composedEnhancer = composeEnhancers(applyMiddleware(thunk));
|
|
21
|
-
const store = createStore(rootReducer, preloadedState, composedEnhancer);
|
|
19
|
+
const enhancer = _compose(applyMiddleware(thunk));
|
|
20
|
+
const store = createStore(rootReducer, preloadedState, enhancer);
|
|
22
21
|
|
|
23
22
|
return store;
|
|
24
23
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,73 +1,10 @@
|
|
|
1
1
|
import React, {useEffect, useState} from 'react';
|
|
2
|
-
import {Text, StyleSheet, Pressable, View, BackHandler} from 'react-native';
|
|
3
2
|
import {connect, Provider} from 'react-redux';
|
|
4
3
|
|
|
5
4
|
import configureStore from './configure-store';
|
|
6
5
|
import {navigateTo, navigateBack} from './actions/navigation';
|
|
7
6
|
import {getCurrentViewName} from './reducers/navigation';
|
|
8
|
-
|
|
9
|
-
// -----------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const styles = StyleSheet.create({
|
|
12
|
-
rootView: {
|
|
13
|
-
flex: 1,
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
justifyContent: 'center'
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
// -----------------------------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
const NavText = ({viewName, navigateTo}) => {
|
|
22
|
-
switch (viewName) {
|
|
23
|
-
case 'home':
|
|
24
|
-
return (
|
|
25
|
-
<Pressable
|
|
26
|
-
onPress={() => {
|
|
27
|
-
navigateTo('onboarding');
|
|
28
|
-
}}
|
|
29
|
-
>
|
|
30
|
-
<Text>view home</Text>
|
|
31
|
-
</Pressable>
|
|
32
|
-
);
|
|
33
|
-
case 'onboarding':
|
|
34
|
-
return (
|
|
35
|
-
<Pressable onPress={() => navigateTo('quizzer')}>
|
|
36
|
-
<Text>view onboarding</Text>
|
|
37
|
-
</Pressable>
|
|
38
|
-
);
|
|
39
|
-
case 'quizzer':
|
|
40
|
-
return (
|
|
41
|
-
<Pressable onPress={() => navigateTo('home')}>
|
|
42
|
-
<Text>view quizzer</Text>
|
|
43
|
-
</Pressable>
|
|
44
|
-
);
|
|
45
|
-
default:
|
|
46
|
-
return <Text>view (none selected)</Text>;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// -----------------------------------------------------------------------------
|
|
51
|
-
|
|
52
|
-
const RootView = (props) => {
|
|
53
|
-
const backAction = () => {
|
|
54
|
-
props.navigateBack();
|
|
55
|
-
return true;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
// https://reactnative.dev/docs/backhandler
|
|
60
|
-
const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);
|
|
61
|
-
|
|
62
|
-
return () => backHandler.remove();
|
|
63
|
-
}, []);
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<View style={styles.rootView}>
|
|
67
|
-
<NavText viewName={props.viewName} navigateTo={props.navigateTo} />
|
|
68
|
-
</View>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
7
|
+
import RootView from './components/root-view';
|
|
71
8
|
|
|
72
9
|
// -----------------------------------------------------------------------------
|
|
73
10
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revision-home.d.ts","sourceRoot":"","sources":["../../src/components/revision-home.tsx"],"names":[],"mappings":"AAWA,UAAU,KAAK;IACb,cAAc,EAAE;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;CACnD;AAoGD,QAAA,MAAM,YAAY,UAAW,KAAK,gBASjC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revision-home.stories.d.ts","sourceRoot":"","sources":["../../src/components/revision-home.stories.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revision-onboarding.d.ts","sourceRoot":"","sources":["../../src/components/revision-onboarding.tsx"],"names":[],"mappings":"AAkEA,QAAA,MAAM,kBAAkB,mBAevB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revision-quizzer.d.ts","sourceRoot":"","sources":["../../src/components/revision-quizzer.tsx"],"names":[],"mappings":"AASA,oBAAY,QAAQ,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oBAAY,OAAO,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,aAAa,CAAC;IAC3D,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;CACtB,CAAC;AAEF,UAAU,KAAK;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AA2ID,QAAA,MAAM,eAAe,cAAa,KAAK,gBAStC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configure-store.d.ts","sourceRoot":"","sources":["../src/configure-store.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,QAAQ,KAAA;;;;EAc9C"}
|
package/dist/configure-store.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { applyMiddleware, compose, createStore } from 'redux';
|
|
2
|
-
import thunk from 'redux-thunk';
|
|
3
|
-
import { composeWithDevTools } from 'redux-devtools-extension';
|
|
4
|
-
import * as actionCreators from './actions';
|
|
5
|
-
import rootReducer from './reducers';
|
|
6
|
-
const preloadedState = undefined;
|
|
7
|
-
export default function configureStore(services) {
|
|
8
|
-
const _compose = process.env.NODE_ENV !== 'production' ? composeWithDevTools : compose;
|
|
9
|
-
const composeEnhancers = _compose({
|
|
10
|
-
actionCreators,
|
|
11
|
-
name: 'app-review',
|
|
12
|
-
trace: true,
|
|
13
|
-
traceLimit: 25
|
|
14
|
-
});
|
|
15
|
-
const composedEnhancer = composeEnhancers(applyMiddleware(thunk));
|
|
16
|
-
const store = createStore(rootReducer, preloadedState, composedEnhancer);
|
|
17
|
-
return store;
|
|
18
|
-
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAmFA,QAAA,MAAM,WAAW;;iBAehB,CAAC;AAIF,eAAe,WAAW,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-home.stories.d.ts
RENAMED
|
File without changes
|
/package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-home.stories.js
RENAMED
|
File without changes
|
/package/{dist/components → es/components/__tmp-backup-vues-mobile}/revision-onboarding.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{dist → es}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/{revision-onboarding.tsx → __tmp-backup-vues-mobile/revision-onboarding.tsx}
RENAMED
|
File without changes
|
/package/src/components/{revision-quizzer.tsx → __tmp-backup-vues-mobile/revision-quizzer.tsx}
RENAMED
|
File without changes
|