@coorpacademy/app-review 0.0.14-alpha.5.6 → 0.0.14
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/actions/index.d.ts +0 -6
- package/es/actions/index.d.ts.map +1 -1
- package/es/actions/index.js +0 -2
- package/es/actions/navigation.d.ts +4 -11
- package/es/actions/navigation.d.ts.map +1 -1
- package/es/actions/navigation.js +0 -5
- package/es/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +1 -0
- package/es/components/__tmp-backup-vues-mobile/revision-home.stories.js +14 -14
- package/es/configure-store.d.ts +3 -11
- package/es/configure-store.d.ts.map +1 -1
- package/es/configure-store.js +2 -4
- package/es/index.d.ts +3 -9
- package/es/index.d.ts.map +1 -1
- package/es/index.js +4 -4
- package/es/reducers/index.d.ts +0 -2
- package/es/reducers/index.d.ts.map +1 -1
- package/es/reducers/index.js +1 -5
- package/es/reducers/navigation.d.ts +2 -2
- package/es/reducers/navigation.d.ts.map +1 -1
- package/es/reducers/navigation.js +0 -3
- package/lib/actions/index.d.ts +0 -6
- package/lib/actions/index.d.ts.map +1 -1
- package/lib/actions/index.js +0 -2
- package/lib/actions/navigation.d.ts +4 -11
- package/lib/actions/navigation.d.ts.map +1 -1
- package/lib/actions/navigation.js +1 -7
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +1 -0
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.js +16 -14
- package/lib/configure-store.d.ts +3 -11
- package/lib/configure-store.d.ts.map +1 -1
- package/lib/configure-store.js +2 -4
- package/lib/index.d.ts +3 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/reducers/index.d.ts +0 -2
- package/lib/reducers/index.d.ts.map +1 -1
- package/lib/reducers/index.js +1 -5
- package/lib/reducers/navigation.d.ts +2 -2
- package/lib/reducers/navigation.d.ts.map +1 -1
- package/lib/reducers/navigation.js +0 -3
- package/package.json +11 -13
- package/readme.md +0 -24
- package/src/actions/index.ts +0 -8
- package/src/actions/navigation.ts +4 -16
- package/src/components/__tmp-backup-vues-mobile/revision-home.stories.tsx +14 -14
- package/src/configure-store.ts +2 -15
- package/src/index.tsx +3 -12
- package/src/reducers/index.ts +1 -6
- package/src/reducers/navigation.ts +3 -11
- package/es/actions/courses.d.ts +0 -7
- package/es/actions/courses.d.ts.map +0 -1
- package/es/actions/courses.js +0 -5
- package/es/actions/token.d.ts +0 -7
- package/es/actions/token.d.ts.map +0 -1
- package/es/actions/token.js +0 -5
- package/es/middlewares/on-start-app.d.ts +0 -7
- package/es/middlewares/on-start-app.d.ts.map +0 -1
- package/es/middlewares/on-start-app.js +0 -17
- package/es/reducers/courses.d.ts +0 -6
- package/es/reducers/courses.d.ts.map +0 -1
- package/es/reducers/courses.js +0 -14
- package/es/reducers/token.d.ts +0 -7
- package/es/reducers/token.d.ts.map +0 -1
- package/es/reducers/token.js +0 -16
- package/es/services/fetch-demo.d.ts +0 -12
- package/es/services/fetch-demo.d.ts.map +0 -1
- package/es/services/fetch-demo.js +0 -26
- package/es/services/fetch-demo.test.d.ts +0 -2
- package/es/services/fetch-demo.test.d.ts.map +0 -1
- package/es/services/fetch-demo.test.js +0 -12
- package/es/services/fetch-responses.d.ts +0 -20
- package/es/services/fetch-responses.d.ts.map +0 -1
- package/es/services/fetch-responses.js +0 -33
- package/es/services/fetch.mocks.d.ts +0 -10
- package/es/services/fetch.mocks.d.ts.map +0 -1
- package/es/services/fetch.mocks.js +0 -12
- package/lib/actions/courses.d.ts +0 -7
- package/lib/actions/courses.d.ts.map +0 -1
- package/lib/actions/courses.js +0 -9
- package/lib/actions/token.d.ts +0 -7
- package/lib/actions/token.d.ts.map +0 -1
- package/lib/actions/token.js +0 -9
- package/lib/middlewares/on-start-app.d.ts +0 -7
- package/lib/middlewares/on-start-app.d.ts.map +0 -1
- package/lib/middlewares/on-start-app.js +0 -22
- package/lib/reducers/courses.d.ts +0 -6
- package/lib/reducers/courses.d.ts.map +0 -1
- package/lib/reducers/courses.js +0 -27
- package/lib/reducers/token.d.ts +0 -7
- package/lib/reducers/token.d.ts.map +0 -1
- package/lib/reducers/token.js +0 -21
- package/lib/services/fetch-demo.d.ts +0 -12
- package/lib/services/fetch-demo.d.ts.map +0 -1
- package/lib/services/fetch-demo.js +0 -76
- package/lib/services/fetch-demo.test.d.ts +0 -2
- package/lib/services/fetch-demo.test.d.ts.map +0 -1
- package/lib/services/fetch-demo.test.js +0 -59
- package/lib/services/fetch-responses.d.ts +0 -20
- package/lib/services/fetch-responses.d.ts.map +0 -1
- package/lib/services/fetch-responses.js +0 -118
- package/lib/services/fetch.mocks.d.ts +0 -10
- package/lib/services/fetch.mocks.d.ts.map +0 -1
- package/lib/services/fetch.mocks.js +0 -31
- package/src/actions/courses.ts +0 -11
- package/src/actions/token.ts +0 -11
- package/src/middlewares/on-start-app.ts +0 -30
- package/src/reducers/courses.ts +0 -22
- package/src/reducers/token.ts +0 -26
- package/src/services/fetch-demo.test.ts +0 -16
- package/src/services/fetch-demo.ts +0 -55
- package/src/services/fetch-responses.ts +0 -53
- package/src/services/fetch.mocks.ts +0 -26
package/es/actions/index.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import { ReceivedCourse } from './courses';
|
|
2
|
-
import { NavigateBack, NavigateTo, StartApp } from './navigation';
|
|
3
|
-
import { StoreToken } from './token';
|
|
4
|
-
export * from './courses';
|
|
5
1
|
export * from './navigation';
|
|
6
|
-
export * from './token';
|
|
7
|
-
export declare type Action = StartApp | StoreToken | NavigateBack | NavigateTo | ReceivedCourse;
|
|
8
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/es/actions/index.js
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import { ActionCreator } from 'redux';
|
|
2
|
-
import { AppOptions } from '..';
|
|
3
2
|
export declare const NAVIGATE_TO = "@@navigation/NAVIGATE_TO";
|
|
4
3
|
export declare const NAVIGATE_BACK = "@@navigation/NAVIGATE_BACK";
|
|
5
|
-
export declare
|
|
6
|
-
export declare type NavigateTo = {
|
|
4
|
+
export declare type $NAVIGATE_TO = {
|
|
7
5
|
type: '@@navigation/NAVIGATE_TO';
|
|
8
6
|
payload: string;
|
|
9
7
|
};
|
|
10
|
-
export declare type
|
|
8
|
+
export declare type $NAVIGATE_BACK = {
|
|
11
9
|
type: '@@navigation/NAVIGATE_BACK';
|
|
12
10
|
};
|
|
13
|
-
export declare
|
|
14
|
-
|
|
15
|
-
payload: AppOptions;
|
|
16
|
-
};
|
|
17
|
-
export declare const navigateTo: ActionCreator<NavigateTo>;
|
|
18
|
-
export declare const navigateBack: ActionCreator<NavigateBack>;
|
|
19
|
-
export declare const startApp: (options: AppOptions) => StartApp;
|
|
11
|
+
export declare const navigateTo: ActionCreator<$NAVIGATE_TO>;
|
|
12
|
+
export declare const navigateBack: ActionCreator<$NAVIGATE_BACK>;
|
|
20
13
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/actions/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/actions/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEpC,eAAO,MAAM,WAAW,6BAA6B,CAAC;AACtD,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAE1D,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,IAAI,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,YAAY,CAGjD,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,cAAc,CAErD,CAAC"}
|
package/es/actions/navigation.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export const NAVIGATE_TO = '@@navigation/NAVIGATE_TO';
|
|
2
2
|
export const NAVIGATE_BACK = '@@navigation/NAVIGATE_BACK';
|
|
3
|
-
export const START_APP = '@@navigation/START_APP';
|
|
4
3
|
export const navigateTo = (newPath) => ({
|
|
5
4
|
type: NAVIGATE_TO,
|
|
6
5
|
payload: newPath
|
|
@@ -8,7 +7,3 @@ export const navigateTo = (newPath) => ({
|
|
|
8
7
|
export const navigateBack = () => ({
|
|
9
8
|
type: NAVIGATE_BACK
|
|
10
9
|
});
|
|
11
|
-
export const startApp = (options) => ({
|
|
12
|
-
type: START_APP,
|
|
13
|
-
payload: options
|
|
14
|
-
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { storiesOf } from '@storybook/react-native';
|
|
3
|
+
import RevisionHome from './revision-home';
|
|
4
|
+
const emptySkills = [];
|
|
5
|
+
const skillsToRevise = [
|
|
6
|
+
{ title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
|
|
7
|
+
{ title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
|
|
8
|
+
{ title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
|
|
9
|
+
{ title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
|
|
10
|
+
{ title: 'Creativity and innovation', info: '75 questions to revise' }
|
|
11
|
+
];
|
|
12
|
+
storiesOf('RevisionHome', module)
|
|
13
|
+
.add('No skills', () => React.createElement(RevisionHome, { skillsToRevise: emptySkills }))
|
|
14
|
+
.add('Few skills', () => React.createElement(RevisionHome, { skillsToRevise: skillsToRevise }));
|
package/es/configure-store.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
export default function configureStore(): import("redux").Store<import("redux").EmptyObject & {
|
|
4
|
-
courses: import("./reducers/courses").State;
|
|
5
|
-
navigation: NavigationState;
|
|
6
|
-
token: string;
|
|
1
|
+
export default function configureStore(services: any): import("redux").Store<import("redux").EmptyObject & {
|
|
2
|
+
navigation: import("./reducers/navigation").State;
|
|
7
3
|
}, import("redux").AnyAction> & {
|
|
8
|
-
dispatch:
|
|
9
|
-
};
|
|
10
|
-
export declare type StoreState = {
|
|
11
|
-
navigation: NavigationState;
|
|
12
|
-
token: TokenState;
|
|
4
|
+
dispatch: unknown;
|
|
13
5
|
};
|
|
14
6
|
//# sourceMappingURL=configure-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure-store.d.ts","sourceRoot":"","sources":["../src/configure-store.ts"],"names":[],"mappings":"
|
|
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"}
|
package/es/configure-store.js
CHANGED
|
@@ -2,10 +2,8 @@ import { applyMiddleware, compose, createStore } from 'redux';
|
|
|
2
2
|
import thunk from 'redux-thunk';
|
|
3
3
|
import { composeWithDevTools } from 'redux-devtools-extension';
|
|
4
4
|
import rootReducer from './reducers';
|
|
5
|
-
import onStartApp from './middlewares/on-start-app';
|
|
6
5
|
const preloadedState = undefined;
|
|
7
|
-
|
|
8
|
-
export default function configureStore() {
|
|
6
|
+
export default function configureStore(services) {
|
|
9
7
|
const _compose = process.env.NODE_ENV !== 'production'
|
|
10
8
|
? composeWithDevTools({
|
|
11
9
|
name: 'app-review',
|
|
@@ -13,7 +11,7 @@ export default function configureStore() {
|
|
|
13
11
|
traceLimit: 25
|
|
14
12
|
})
|
|
15
13
|
: compose;
|
|
16
|
-
const enhancer = _compose(applyMiddleware(thunk
|
|
14
|
+
const enhancer = _compose(applyMiddleware(thunk));
|
|
17
15
|
const store = createStore(rootReducer, preloadedState, enhancer);
|
|
18
16
|
return store;
|
|
19
17
|
}
|
package/es/index.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
declare const AppRevision: ({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
export declare type AppOptions = {
|
|
6
|
-
token: string;
|
|
7
|
-
theme?: any;
|
|
8
|
-
translations?: any;
|
|
9
|
-
};
|
|
1
|
+
declare const AppRevision: ({ services }: {
|
|
2
|
+
services: any;
|
|
3
|
+
}) => JSX.Element;
|
|
10
4
|
export default AppRevision;
|
|
11
5
|
//# sourceMappingURL=index.d.ts.map
|
package/es/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,WAAW,
|
|
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/es/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { connect, Provider } from 'react-redux';
|
|
3
3
|
import AppReviewRootView from '@coorpacademy/components/es/template/app-review/root-view/root-view';
|
|
4
4
|
import configureStore from './configure-store';
|
|
5
|
-
import { navigateTo, navigateBack
|
|
5
|
+
import { navigateTo, navigateBack } from './actions/navigation';
|
|
6
6
|
import { getCurrentViewName } from './reducers/navigation';
|
|
7
7
|
// -----------------------------------------------------------------------------
|
|
8
8
|
const mapStateToProps = (state, ownProps) => {
|
|
@@ -11,11 +11,10 @@ const mapStateToProps = (state, ownProps) => {
|
|
|
11
11
|
const mapDispatchToProps = { navigateTo, navigateBack };
|
|
12
12
|
const App = connect(mapStateToProps, mapDispatchToProps)(AppReviewRootView);
|
|
13
13
|
// -----------------------------------------------------------------------------
|
|
14
|
-
const AppRevision = ({
|
|
14
|
+
const AppRevision = ({ services }) => {
|
|
15
15
|
const [store, setStore] = useState(null);
|
|
16
16
|
useEffect(() => {
|
|
17
|
-
const store = configureStore();
|
|
18
|
-
store.dispatch(startApp(options));
|
|
17
|
+
const store = configureStore(services);
|
|
19
18
|
setStore(store);
|
|
20
19
|
}, []);
|
|
21
20
|
if (!store)
|
|
@@ -23,4 +22,5 @@ const AppRevision = ({ options }) => {
|
|
|
23
22
|
return (React.createElement(Provider, { store: store },
|
|
24
23
|
React.createElement(App, null)));
|
|
25
24
|
};
|
|
25
|
+
// -----------------------------------------------------------------------------
|
|
26
26
|
export default AppRevision;
|
package/es/reducers/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
declare const rootReducer: import("redux").Reducer<import("redux").CombinedState<{
|
|
2
|
-
courses: import("./courses").State;
|
|
3
2
|
navigation: import("./navigation").State;
|
|
4
|
-
token: string;
|
|
5
3
|
}>, import("redux").AnyAction>;
|
|
6
4
|
export default rootReducer;
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reducers/index.ts"],"names":[],"mappings":"
|
|
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"}
|
package/es/reducers/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { combineReducers } from 'redux';
|
|
2
|
-
import courses from './courses';
|
|
3
2
|
import navigation from './navigation';
|
|
4
|
-
import token from './token';
|
|
5
3
|
const rootReducer = combineReducers({
|
|
6
|
-
|
|
7
|
-
navigation,
|
|
8
|
-
token
|
|
4
|
+
navigation
|
|
9
5
|
});
|
|
10
6
|
export default rootReducer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { $NAVIGATE_TO, $NAVIGATE_BACK } from '../actions/navigation';
|
|
2
2
|
export declare type State = Array<string>;
|
|
3
3
|
export declare const initialState: State;
|
|
4
|
-
declare const reducer: (state: State, action:
|
|
4
|
+
declare const reducer: (state: State, action: $NAVIGATE_TO | $NAVIGATE_BACK) => State;
|
|
5
5
|
export declare const getCurrentViewName: (appState: any) => any;
|
|
6
6
|
export default reducer;
|
|
7
7
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/reducers/navigation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,
|
|
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"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { NAVIGATE_BACK, NAVIGATE_TO } from '../actions/navigation';
|
|
2
2
|
export const initialState = ['home'];
|
|
3
|
-
// -----------------------------------------------------------------------------
|
|
4
3
|
const reducer = (state = initialState, action) => {
|
|
5
4
|
switch (action.type) {
|
|
6
5
|
case NAVIGATE_TO: {
|
|
@@ -15,7 +14,5 @@ const reducer = (state = initialState, action) => {
|
|
|
15
14
|
return state;
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
|
-
// -----------------------------------------------------------------------------
|
|
19
17
|
export const getCurrentViewName = appState => appState.navigation[appState.navigation.length - 1];
|
|
20
|
-
// -----------------------------------------------------------------------------
|
|
21
18
|
export default reducer;
|
package/lib/actions/index.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import { ReceivedCourse } from './courses';
|
|
2
|
-
import { NavigateBack, NavigateTo, StartApp } from './navigation';
|
|
3
|
-
import { StoreToken } from './token';
|
|
4
|
-
export * from './courses';
|
|
5
1
|
export * from './navigation';
|
|
6
|
-
export * from './token';
|
|
7
|
-
export declare type Action = StartApp | StoreToken | NavigateBack | NavigateTo | ReceivedCourse;
|
|
8
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/lib/actions/index.js
CHANGED
|
@@ -14,6 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./courses"), exports);
|
|
18
17
|
__exportStar(require("./navigation"), exports);
|
|
19
|
-
__exportStar(require("./token"), exports);
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import { ActionCreator } from 'redux';
|
|
2
|
-
import { AppOptions } from '..';
|
|
3
2
|
export declare const NAVIGATE_TO = "@@navigation/NAVIGATE_TO";
|
|
4
3
|
export declare const NAVIGATE_BACK = "@@navigation/NAVIGATE_BACK";
|
|
5
|
-
export declare
|
|
6
|
-
export declare type NavigateTo = {
|
|
4
|
+
export declare type $NAVIGATE_TO = {
|
|
7
5
|
type: '@@navigation/NAVIGATE_TO';
|
|
8
6
|
payload: string;
|
|
9
7
|
};
|
|
10
|
-
export declare type
|
|
8
|
+
export declare type $NAVIGATE_BACK = {
|
|
11
9
|
type: '@@navigation/NAVIGATE_BACK';
|
|
12
10
|
};
|
|
13
|
-
export declare
|
|
14
|
-
|
|
15
|
-
payload: AppOptions;
|
|
16
|
-
};
|
|
17
|
-
export declare const navigateTo: ActionCreator<NavigateTo>;
|
|
18
|
-
export declare const navigateBack: ActionCreator<NavigateBack>;
|
|
19
|
-
export declare const startApp: (options: AppOptions) => StartApp;
|
|
11
|
+
export declare const navigateTo: ActionCreator<$NAVIGATE_TO>;
|
|
12
|
+
export declare const navigateBack: ActionCreator<$NAVIGATE_BACK>;
|
|
20
13
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/actions/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/actions/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEpC,eAAO,MAAM,WAAW,6BAA6B,CAAC;AACtD,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAE1D,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,IAAI,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,YAAY,CAGjD,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,cAAc,CAErD,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.navigateBack = exports.navigateTo = exports.NAVIGATE_BACK = exports.NAVIGATE_TO = void 0;
|
|
4
4
|
exports.NAVIGATE_TO = '@@navigation/NAVIGATE_TO';
|
|
5
5
|
exports.NAVIGATE_BACK = '@@navigation/NAVIGATE_BACK';
|
|
6
|
-
exports.START_APP = '@@navigation/START_APP';
|
|
7
6
|
var navigateTo = function (newPath) { return ({
|
|
8
7
|
type: exports.NAVIGATE_TO,
|
|
9
8
|
payload: newPath
|
|
@@ -13,8 +12,3 @@ var navigateBack = function () { return ({
|
|
|
13
12
|
type: exports.NAVIGATE_BACK
|
|
14
13
|
}); };
|
|
15
14
|
exports.navigateBack = navigateBack;
|
|
16
|
-
var startApp = function (options) { return ({
|
|
17
|
-
type: exports.START_APP,
|
|
18
|
-
payload: options
|
|
19
|
-
}); };
|
|
20
|
-
exports.startApp = startApp;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var React = require("react");
|
|
4
|
+
var react_native_1 = require("@storybook/react-native");
|
|
5
|
+
var revision_home_1 = require("./revision-home");
|
|
6
|
+
var emptySkills = [];
|
|
7
|
+
var skillsToRevise = [
|
|
8
|
+
{ title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
|
|
9
|
+
{ title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
|
|
10
|
+
{ title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
|
|
11
|
+
{ title: 'Negotiation and powers of persuasion', info: '75 questions to revise' },
|
|
12
|
+
{ title: 'Creativity and innovation', info: '75 questions to revise' }
|
|
13
|
+
];
|
|
14
|
+
(0, react_native_1.storiesOf)('RevisionHome', module)
|
|
15
|
+
.add('No skills', function () { return React.createElement(revision_home_1.default, { skillsToRevise: emptySkills }); })
|
|
16
|
+
.add('Few skills', function () { return React.createElement(revision_home_1.default, { skillsToRevise: skillsToRevise }); });
|
package/lib/configure-store.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
export default function configureStore(): import("redux").Store<import("redux").EmptyObject & {
|
|
4
|
-
courses: import("./reducers/courses").State;
|
|
5
|
-
navigation: NavigationState;
|
|
6
|
-
token: string;
|
|
1
|
+
export default function configureStore(services: any): import("redux").Store<import("redux").EmptyObject & {
|
|
2
|
+
navigation: import("./reducers/navigation").State;
|
|
7
3
|
}, import("redux").AnyAction> & {
|
|
8
|
-
dispatch:
|
|
9
|
-
};
|
|
10
|
-
export declare type StoreState = {
|
|
11
|
-
navigation: NavigationState;
|
|
12
|
-
token: TokenState;
|
|
4
|
+
dispatch: unknown;
|
|
13
5
|
};
|
|
14
6
|
//# sourceMappingURL=configure-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure-store.d.ts","sourceRoot":"","sources":["../src/configure-store.ts"],"names":[],"mappings":"
|
|
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"}
|
package/lib/configure-store.js
CHANGED
|
@@ -4,10 +4,8 @@ var redux_1 = require("redux");
|
|
|
4
4
|
var redux_thunk_1 = require("redux-thunk");
|
|
5
5
|
var redux_devtools_extension_1 = require("redux-devtools-extension");
|
|
6
6
|
var reducers_1 = require("./reducers");
|
|
7
|
-
var on_start_app_1 = require("./middlewares/on-start-app");
|
|
8
7
|
var preloadedState = undefined;
|
|
9
|
-
|
|
10
|
-
function configureStore() {
|
|
8
|
+
function configureStore(services) {
|
|
11
9
|
var _compose = process.env.NODE_ENV !== 'production'
|
|
12
10
|
? (0, redux_devtools_extension_1.composeWithDevTools)({
|
|
13
11
|
name: 'app-review',
|
|
@@ -15,7 +13,7 @@ function configureStore() {
|
|
|
15
13
|
traceLimit: 25
|
|
16
14
|
})
|
|
17
15
|
: redux_1.compose;
|
|
18
|
-
var enhancer = _compose((0, redux_1.applyMiddleware)(redux_thunk_1.default
|
|
16
|
+
var enhancer = _compose((0, redux_1.applyMiddleware)(redux_thunk_1.default));
|
|
19
17
|
var store = (0, redux_1.createStore)(reducers_1.default, preloadedState, enhancer);
|
|
20
18
|
return store;
|
|
21
19
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
declare const AppRevision: ({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
export declare type AppOptions = {
|
|
6
|
-
token: string;
|
|
7
|
-
theme?: any;
|
|
8
|
-
translations?: any;
|
|
9
|
-
};
|
|
1
|
+
declare const AppRevision: ({ services }: {
|
|
2
|
+
services: any;
|
|
3
|
+
}) => JSX.Element;
|
|
10
4
|
export default AppRevision;
|
|
11
5
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,WAAW,
|
|
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
CHANGED
|
@@ -25,11 +25,10 @@ var mapDispatchToProps = { navigateTo: navigation_1.navigateTo, navigateBack: na
|
|
|
25
25
|
var App = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(root_view_1.default);
|
|
26
26
|
// -----------------------------------------------------------------------------
|
|
27
27
|
var AppRevision = function (_a) {
|
|
28
|
-
var
|
|
28
|
+
var services = _a.services;
|
|
29
29
|
var _b = (0, react_1.useState)(null), store = _b[0], setStore = _b[1];
|
|
30
30
|
(0, react_1.useEffect)(function () {
|
|
31
|
-
var store = (0, configure_store_1.default)();
|
|
32
|
-
store.dispatch((0, navigation_1.startApp)(options));
|
|
31
|
+
var store = (0, configure_store_1.default)(services);
|
|
33
32
|
setStore(store);
|
|
34
33
|
}, []);
|
|
35
34
|
if (!store)
|
|
@@ -37,4 +36,5 @@ var AppRevision = function (_a) {
|
|
|
37
36
|
return (react_1.default.createElement(react_redux_1.Provider, { store: store },
|
|
38
37
|
react_1.default.createElement(App, null)));
|
|
39
38
|
};
|
|
39
|
+
// -----------------------------------------------------------------------------
|
|
40
40
|
exports.default = AppRevision;
|
package/lib/reducers/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
declare const rootReducer: import("redux").Reducer<import("redux").CombinedState<{
|
|
2
|
-
courses: import("./courses").State;
|
|
3
2
|
navigation: import("./navigation").State;
|
|
4
|
-
token: string;
|
|
5
3
|
}>, import("redux").AnyAction>;
|
|
6
4
|
export default rootReducer;
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reducers/index.ts"],"names":[],"mappings":"
|
|
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"}
|
package/lib/reducers/index.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var redux_1 = require("redux");
|
|
4
|
-
var courses_1 = require("./courses");
|
|
5
4
|
var navigation_1 = require("./navigation");
|
|
6
|
-
var token_1 = require("./token");
|
|
7
5
|
var rootReducer = (0, redux_1.combineReducers)({
|
|
8
|
-
|
|
9
|
-
navigation: navigation_1.default,
|
|
10
|
-
token: token_1.default
|
|
6
|
+
navigation: navigation_1.default
|
|
11
7
|
});
|
|
12
8
|
exports.default = rootReducer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { $NAVIGATE_TO, $NAVIGATE_BACK } from '../actions/navigation';
|
|
2
2
|
export declare type State = Array<string>;
|
|
3
3
|
export declare const initialState: State;
|
|
4
|
-
declare const reducer: (state: State, action:
|
|
4
|
+
declare const reducer: (state: State, action: $NAVIGATE_TO | $NAVIGATE_BACK) => State;
|
|
5
5
|
export declare const getCurrentViewName: (appState: any) => any;
|
|
6
6
|
export default reducer;
|
|
7
7
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/reducers/navigation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,
|
|
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"}
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getCurrentViewName = exports.initialState = void 0;
|
|
13
13
|
var navigation_1 = require("../actions/navigation");
|
|
14
14
|
exports.initialState = ['home'];
|
|
15
|
-
// -----------------------------------------------------------------------------
|
|
16
15
|
var reducer = function (state, action) {
|
|
17
16
|
if (state === void 0) { state = exports.initialState; }
|
|
18
17
|
switch (action.type) {
|
|
@@ -28,8 +27,6 @@ var reducer = function (state, action) {
|
|
|
28
27
|
return state;
|
|
29
28
|
}
|
|
30
29
|
};
|
|
31
|
-
// -----------------------------------------------------------------------------
|
|
32
30
|
var getCurrentViewName = function (appState) { return appState.navigation[appState.navigation.length - 1]; };
|
|
33
31
|
exports.getCurrentViewName = getCurrentViewName;
|
|
34
|
-
// -----------------------------------------------------------------------------
|
|
35
32
|
exports.default = reducer;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/app-review",
|
|
3
|
-
"version": "0.0.14
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"engines": {
|
|
6
7
|
"node": ">=16.15.0"
|
|
7
8
|
},
|
|
8
|
-
"license": "UNLICENSED",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "node commands/start.js",
|
|
11
11
|
"static": "node commands/build-static-webapp.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"clean:commonjs": "rm -rf lib",
|
|
18
18
|
"clean:es": "rm -rf es",
|
|
19
19
|
"clean": "concurrently \"npm run clean:commonjs\" \"npm run clean:es\"",
|
|
20
|
-
"test:unit": "
|
|
20
|
+
"test:unit": "echo @todo setup unit tests"
|
|
21
21
|
},
|
|
22
22
|
"author": "CoorpAcademy",
|
|
23
23
|
"files": [
|
|
@@ -36,28 +36,26 @@
|
|
|
36
36
|
"./package.json": "./package.json"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@coorpacademy/components": "10.19.
|
|
40
|
-
"cross-fetch": "^3.1.5",
|
|
41
|
-
"jwt-decode": "^3.1.2",
|
|
42
|
-
"react": "^17.0.2",
|
|
43
|
-
"react-native": "0.68.1",
|
|
39
|
+
"@coorpacademy/components": "10.19.6",
|
|
44
40
|
"react-redux": "^8.0.1",
|
|
45
41
|
"redux": "^4.2.0"
|
|
46
42
|
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"react": "^17.0.2",
|
|
45
|
+
"react-native": "0.68.1"
|
|
46
|
+
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"
|
|
49
|
-
"chalk": "^
|
|
48
|
+
"@storybook/react-native": "^5.3.25",
|
|
49
|
+
"chalk": "^5.0.1",
|
|
50
50
|
"concurrently": "^5.2.0",
|
|
51
51
|
"connect-history-api-fallback": "^1.6.0",
|
|
52
|
-
"dotenv": "^16.0.1",
|
|
53
52
|
"esbuild": "^0.14.39",
|
|
54
53
|
"esbuild-css-modules-plugin": "^2.2.16",
|
|
55
54
|
"esbuild-plugin-svgr": "^1.0.1",
|
|
56
55
|
"live-server": "^1.2.2",
|
|
57
56
|
"react-dom": "^17.0.2",
|
|
58
57
|
"redux-devtools-extension": "^2.13.9",
|
|
59
|
-
"ts-node": "^10.8.0",
|
|
60
58
|
"typescript": "^4.6.4"
|
|
61
59
|
},
|
|
62
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "24bbf404184a7bacb5a5e85cb35263be7af457dc"
|
|
63
61
|
}
|