@coorpacademy/app-review 0.0.14-alpha.6.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.
Files changed (112) hide show
  1. package/es/actions/index.d.ts +0 -6
  2. package/es/actions/index.d.ts.map +1 -1
  3. package/es/actions/index.js +0 -2
  4. package/es/actions/navigation.d.ts +4 -11
  5. package/es/actions/navigation.d.ts.map +1 -1
  6. package/es/actions/navigation.js +0 -5
  7. package/es/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +1 -0
  8. package/es/components/__tmp-backup-vues-mobile/revision-home.stories.js +14 -14
  9. package/es/configure-store.d.ts +3 -11
  10. package/es/configure-store.d.ts.map +1 -1
  11. package/es/configure-store.js +2 -4
  12. package/es/index.d.ts +3 -9
  13. package/es/index.d.ts.map +1 -1
  14. package/es/index.js +4 -4
  15. package/es/reducers/index.d.ts +0 -2
  16. package/es/reducers/index.d.ts.map +1 -1
  17. package/es/reducers/index.js +1 -5
  18. package/es/reducers/navigation.d.ts +2 -2
  19. package/es/reducers/navigation.d.ts.map +1 -1
  20. package/es/reducers/navigation.js +0 -3
  21. package/lib/actions/index.d.ts +0 -6
  22. package/lib/actions/index.d.ts.map +1 -1
  23. package/lib/actions/index.js +0 -2
  24. package/lib/actions/navigation.d.ts +4 -11
  25. package/lib/actions/navigation.d.ts.map +1 -1
  26. package/lib/actions/navigation.js +1 -7
  27. package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +1 -0
  28. package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.js +16 -14
  29. package/lib/configure-store.d.ts +3 -11
  30. package/lib/configure-store.d.ts.map +1 -1
  31. package/lib/configure-store.js +2 -4
  32. package/lib/index.d.ts +3 -9
  33. package/lib/index.d.ts.map +1 -1
  34. package/lib/index.js +3 -3
  35. package/lib/reducers/index.d.ts +0 -2
  36. package/lib/reducers/index.d.ts.map +1 -1
  37. package/lib/reducers/index.js +1 -5
  38. package/lib/reducers/navigation.d.ts +2 -2
  39. package/lib/reducers/navigation.d.ts.map +1 -1
  40. package/lib/reducers/navigation.js +0 -3
  41. package/package.json +11 -13
  42. package/readme.md +0 -24
  43. package/src/actions/index.ts +0 -8
  44. package/src/actions/navigation.ts +4 -16
  45. package/src/components/__tmp-backup-vues-mobile/revision-home.stories.tsx +14 -14
  46. package/src/configure-store.ts +2 -15
  47. package/src/index.tsx +3 -12
  48. package/src/reducers/index.ts +1 -6
  49. package/src/reducers/navigation.ts +3 -11
  50. package/es/actions/courses.d.ts +0 -7
  51. package/es/actions/courses.d.ts.map +0 -1
  52. package/es/actions/courses.js +0 -5
  53. package/es/actions/token.d.ts +0 -7
  54. package/es/actions/token.d.ts.map +0 -1
  55. package/es/actions/token.js +0 -5
  56. package/es/middlewares/on-start-app.d.ts +0 -7
  57. package/es/middlewares/on-start-app.d.ts.map +0 -1
  58. package/es/middlewares/on-start-app.js +0 -17
  59. package/es/reducers/courses.d.ts +0 -6
  60. package/es/reducers/courses.d.ts.map +0 -1
  61. package/es/reducers/courses.js +0 -14
  62. package/es/reducers/token.d.ts +0 -7
  63. package/es/reducers/token.d.ts.map +0 -1
  64. package/es/reducers/token.js +0 -16
  65. package/es/services/fetch-demo.d.ts +0 -12
  66. package/es/services/fetch-demo.d.ts.map +0 -1
  67. package/es/services/fetch-demo.js +0 -26
  68. package/es/services/fetch-demo.test.d.ts +0 -2
  69. package/es/services/fetch-demo.test.d.ts.map +0 -1
  70. package/es/services/fetch-demo.test.js +0 -12
  71. package/es/services/fetch-responses.d.ts +0 -20
  72. package/es/services/fetch-responses.d.ts.map +0 -1
  73. package/es/services/fetch-responses.js +0 -33
  74. package/es/services/fetch.mocks.d.ts +0 -10
  75. package/es/services/fetch.mocks.d.ts.map +0 -1
  76. package/es/services/fetch.mocks.js +0 -12
  77. package/lib/actions/courses.d.ts +0 -7
  78. package/lib/actions/courses.d.ts.map +0 -1
  79. package/lib/actions/courses.js +0 -9
  80. package/lib/actions/token.d.ts +0 -7
  81. package/lib/actions/token.d.ts.map +0 -1
  82. package/lib/actions/token.js +0 -9
  83. package/lib/middlewares/on-start-app.d.ts +0 -7
  84. package/lib/middlewares/on-start-app.d.ts.map +0 -1
  85. package/lib/middlewares/on-start-app.js +0 -22
  86. package/lib/reducers/courses.d.ts +0 -6
  87. package/lib/reducers/courses.d.ts.map +0 -1
  88. package/lib/reducers/courses.js +0 -27
  89. package/lib/reducers/token.d.ts +0 -7
  90. package/lib/reducers/token.d.ts.map +0 -1
  91. package/lib/reducers/token.js +0 -21
  92. package/lib/services/fetch-demo.d.ts +0 -12
  93. package/lib/services/fetch-demo.d.ts.map +0 -1
  94. package/lib/services/fetch-demo.js +0 -76
  95. package/lib/services/fetch-demo.test.d.ts +0 -2
  96. package/lib/services/fetch-demo.test.d.ts.map +0 -1
  97. package/lib/services/fetch-demo.test.js +0 -59
  98. package/lib/services/fetch-responses.d.ts +0 -20
  99. package/lib/services/fetch-responses.d.ts.map +0 -1
  100. package/lib/services/fetch-responses.js +0 -118
  101. package/lib/services/fetch.mocks.d.ts +0 -10
  102. package/lib/services/fetch.mocks.d.ts.map +0 -1
  103. package/lib/services/fetch.mocks.js +0 -31
  104. package/src/actions/courses.ts +0 -11
  105. package/src/actions/token.ts +0 -11
  106. package/src/middlewares/on-start-app.ts +0 -30
  107. package/src/reducers/courses.ts +0 -22
  108. package/src/reducers/token.ts +0 -26
  109. package/src/services/fetch-demo.test.ts +0 -16
  110. package/src/services/fetch-demo.ts +0 -55
  111. package/src/services/fetch-responses.ts +0 -53
  112. package/src/services/fetch.mocks.ts +0 -26
@@ -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,OAAO,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AACzC,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAEnC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AAExB,oBAAY,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -1,3 +1 @@
1
- export * from './courses';
2
1
  export * from './navigation';
3
- export * from './token';
@@ -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 const START_APP = "@@navigation/START_APP";
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 NavigateBack = {
8
+ export declare type $NAVIGATE_BACK = {
11
9
  type: '@@navigation/NAVIGATE_BACK';
12
10
  };
13
- export declare type StartApp = {
14
- type: '@@navigation/START_APP';
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;AACpC,OAAO,EAAC,UAAU,EAAC,MAAM,IAAI,CAAC;AAE9B,eAAO,MAAM,WAAW,6BAA6B,CAAC;AACtD,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAC1D,eAAO,MAAM,SAAS,2BAA2B,CAAC;AAElD,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,UAAU,CAG/C,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,YAAY,CAEnD,CAAC;AAEH,eAAO,MAAM,QAAQ,YAAa,UAAU,KAAG,QAG7C,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,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 +1,2 @@
1
+ export {};
1
2
  //# sourceMappingURL=revision-home.stories.d.ts.map
@@ -1,14 +1,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: {title: string; info: string}[] = [
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', () => <RevisionHome skillsToRevise={emptySkills} />)
14
- // .add('Few skills', () => <RevisionHome skillsToRevise={skillsToRevise} />);
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 }));
@@ -1,14 +1,6 @@
1
- import { State as NavigationState } from './reducers/navigation';
2
- import { State as TokenState } from './reducers/token';
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":"AAMA,OAAO,EAAC,KAAK,IAAI,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAC,KAAK,IAAI,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAOrD,MAAM,CAAC,OAAO,UAAU,cAAc;;;;;;EAcrC;AAID,oBAAY,UAAU,GAAG;IACvB,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC"}
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"}
@@ -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, onStartApp));
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: ({ options }: Props) => JSX.Element;
2
- declare type Props = {
3
- options: AppOptions;
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,gBAAe,KAAK,gBAgBpC,CAAC;AAIF,aAAK,KAAK,GAAG;IAAC,OAAO,EAAE,UAAU,CAAA;CAAC,CAAC;AAEnC,oBAAY,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;AAEF,eAAe,WAAW,CAAC"}
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, startApp } from './actions/navigation';
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 = ({ options }) => {
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;
@@ -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":"AAMA,QAAA,MAAM,WAAW;;;;8BAIf,CAAC;AAEH,eAAe,WAAW,CAAC"}
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"}
@@ -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
- courses,
7
- navigation,
8
- token
4
+ navigation
9
5
  });
10
6
  export default rootReducer;
@@ -1,7 +1,7 @@
1
- import type { NavigateTo, NavigateBack } from '../actions/navigation';
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: NavigateTo | NavigateBack) => State;
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,UAAU,EAAE,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAIpE,oBAAY,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAClC,eAAO,MAAM,YAAY,EAAE,KAAgB,CAAC;AAI5C,QAAA,MAAM,OAAO,yBAAyC,UAAU,GAAG,YAAY,UAa9E,CAAC;AAIF,eAAO,MAAM,kBAAkB,wBAAkE,CAAC;AAIlG,eAAe,OAAO,CAAC"}
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;
@@ -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,OAAO,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AACzC,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAEnC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AAExB,oBAAY,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -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 const START_APP = "@@navigation/START_APP";
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 NavigateBack = {
8
+ export declare type $NAVIGATE_BACK = {
11
9
  type: '@@navigation/NAVIGATE_BACK';
12
10
  };
13
- export declare type StartApp = {
14
- type: '@@navigation/START_APP';
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;AACpC,OAAO,EAAC,UAAU,EAAC,MAAM,IAAI,CAAC;AAE9B,eAAO,MAAM,WAAW,6BAA6B,CAAC;AACtD,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAC1D,eAAO,MAAM,SAAS,2BAA2B,CAAC;AAElD,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,UAAU,CAG/C,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,YAAY,CAEnD,CAAC;AAEH,eAAO,MAAM,QAAQ,YAAa,UAAU,KAAG,QAG7C,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.startApp = exports.navigateBack = exports.navigateTo = exports.START_APP = exports.NAVIGATE_BACK = exports.NAVIGATE_TO = void 0;
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 +1,2 @@
1
+ export {};
1
2
  //# sourceMappingURL=revision-home.stories.d.ts.map
@@ -1,14 +1,16 @@
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: {title: string; info: string}[] = [
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', () => <RevisionHome skillsToRevise={emptySkills} />)
14
- // .add('Few skills', () => <RevisionHome skillsToRevise={skillsToRevise} />);
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 }); });
@@ -1,14 +1,6 @@
1
- import { State as NavigationState } from './reducers/navigation';
2
- import { State as TokenState } from './reducers/token';
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":"AAMA,OAAO,EAAC,KAAK,IAAI,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAC,KAAK,IAAI,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAOrD,MAAM,CAAC,OAAO,UAAU,cAAc;;;;;;EAcrC;AAID,oBAAY,UAAU,GAAG;IACvB,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC"}
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"}
@@ -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, on_start_app_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: ({ options }: Props) => JSX.Element;
2
- declare type Props = {
3
- options: AppOptions;
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,WAAW,gBAAe,KAAK,gBAgBpC,CAAC;AAIF,aAAK,KAAK,GAAG;IAAC,OAAO,EAAE,UAAU,CAAA;CAAC,CAAC;AAEnC,oBAAY,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;AAEF,eAAe,WAAW,CAAC"}
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 options = _a.options;
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;
@@ -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":"AAMA,QAAA,MAAM,WAAW;;;;8BAIf,CAAC;AAEH,eAAe,WAAW,CAAC"}
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"}
@@ -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
- courses: courses_1.default,
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 { NavigateTo, NavigateBack } from '../actions/navigation';
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: NavigateTo | NavigateBack) => State;
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,UAAU,EAAE,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAIpE,oBAAY,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAClC,eAAO,MAAM,YAAY,EAAE,KAAgB,CAAC;AAI5C,QAAA,MAAM,OAAO,yBAAyC,UAAU,GAAG,YAAY,UAa9E,CAAC;AAIF,eAAO,MAAM,kBAAkB,wBAAkE,CAAC;AAIlG,eAAe,OAAO,CAAC"}
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-alpha.6.6+65c827e5d",
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": "ava"
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.6-alpha.6.6+65c827e5d",
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
- "ava": "^4.2.0",
49
- "chalk": "^4.1.2",
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": "65c827e5dea557a4b16b9e9aca568fc2c78a1ac9"
60
+ "gitHead": "24bbf404184a7bacb5a5e85cb35263be7af457dc"
63
61
  }