@coorpacademy/app-review 0.8.10-alpha.2 → 0.9.1-alpha.12

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/index.js CHANGED
@@ -15,7 +15,7 @@ const ConnectedApp = (options) => {
15
15
  const props = {
16
16
  viewName: useSelector((state) => state.ui.navigation[state.ui.navigation.length - 1]),
17
17
  slides: useSelector((state) => mapStateToSlidesProps(state, dispatch, options)),
18
- skills: useSelector((state) => mapStateToSkillsProps(state)),
18
+ skills: useSelector((state) => mapStateToSkillsProps(state, options)),
19
19
  navigateBack: () => dispatch(navigateBack),
20
20
  onboarding: {}
21
21
  };
@@ -151,7 +151,7 @@ export declare type Options = {
151
151
  export declare type ConnectedOptions = {
152
152
  translate: Translate;
153
153
  onQuitClick: () => void;
154
- skin: PrimarySkin;
154
+ skin: Skin;
155
155
  };
156
156
  export declare type AppOptions = ConnectedOptions & {
157
157
  token: string;
@@ -175,7 +175,7 @@ export declare type JWT = {
175
175
  export declare type WithRequired<T, K extends keyof T> = T & {
176
176
  [P in K]-?: T[P];
177
177
  };
178
- export declare type PrimarySkin = {
178
+ export declare type Skin = {
179
179
  common: {
180
180
  primary: string;
181
181
  };
@@ -1,3 +1,4 @@
1
1
  import { ReviewSkillsProps } from '@coorpacademy/components/es/template/app-review/skills/prop-types';
2
2
  import { StoreState } from '../../reducers';
3
- export declare const mapStateToSkillsProps: (state: StoreState) => ReviewSkillsProps;
3
+ import type { ConnectedOptions } from '../../types/common';
4
+ export declare const mapStateToSkillsProps: (state: StoreState, options: ConnectedOptions) => ReviewSkillsProps;
@@ -1,23 +1,26 @@
1
- export const mapStateToSkillsProps = (state) => {
1
+ export const mapStateToSkillsProps = (state, options) => {
2
+ const { translate } = options;
2
3
  return {
3
- 'aria-label': '@todo aria-label',
4
- title: '@todo title',
4
+ 'aria-label': translate('list_aria_label'),
5
+ title: translate('list_title'),
5
6
  isLoading: false,
6
- isLoadingAriaLabel: '@todo loading',
7
+ isLoadingAriaLabel: 'Review skills container is loading',
7
8
  listSkills: state.data.skills.map(skill => ({
8
- 'aria-label': '@todo aria-label skill',
9
+ 'aria-label': translate('card.aria_label'),
9
10
  isCustom: skill.custom,
10
11
  skillTitle: skill.name,
11
- skillAriaLabel: '@todo skill aria label',
12
- buttonLabel: '@todo button',
13
- buttonAriaLabel: '@todo button aria label',
14
- reviseLabel: '@todo revise',
15
- reviseAriaLabel: '@todo revise aria label',
12
+ skillAriaLabel: skill.name,
13
+ buttonLabel: translate('card.button_text'),
14
+ buttonAriaLabel: translate('card.button_text'),
15
+ reviseLabel: translate('card.text', { total: `${skill.slidesToReview}` }),
16
+ reviseAriaLabel: translate('card.text', {
17
+ total: `${skill.slidesToReview}`
18
+ }),
16
19
  // eslint-disable-next-line no-console
17
20
  onClick: () => console.log('@todo plug dispatcher select skill')
18
21
  })),
19
- titleNoSkills: '@todo title no skills',
20
- textNoSkills: '@todo text no skills',
21
- iconSkillAriaLabel: '@todo iconSkillAriaLabel'
22
+ titleNoSkills: translate('no_skills.title'),
23
+ textNoSkills: translate('no_skills.text'),
24
+ iconSkillAriaLabel: 'Image without information'
22
25
  };
23
26
  };
@@ -219,13 +219,13 @@ const buildQuitPopinProps = (dispatch) => (onQuitClick, translate, skin) => {
219
219
  secondButton: {
220
220
  label: translate('Continue learning'),
221
221
  type: 'primary',
222
+ customStyle: {
223
+ backgroundColor: skin.common.primary
224
+ },
222
225
  handleOnclick: () => {
223
226
  dispatch(closeQuitPopin);
224
227
  },
225
- 'aria-label': translate('Continue learning'),
226
- customStyle: {
227
- color: skin.common.primary
228
- }
228
+ 'aria-label': translate('Continue learning')
229
229
  }
230
230
  };
231
231
  };
package/lib/index.js CHANGED
@@ -43,7 +43,7 @@ const ConnectedApp = (options) => {
43
43
  const props = {
44
44
  viewName: (0, react_redux_1.useSelector)((state) => state.ui.navigation[state.ui.navigation.length - 1]),
45
45
  slides: (0, react_redux_1.useSelector)((state) => (0, slides_1.mapStateToSlidesProps)(state, dispatch, options)),
46
- skills: (0, react_redux_1.useSelector)((state) => (0, skills_1.mapStateToSkillsProps)(state)),
46
+ skills: (0, react_redux_1.useSelector)((state) => (0, skills_1.mapStateToSkillsProps)(state, options)),
47
47
  navigateBack: () => dispatch(navigation_1.navigateBack),
48
48
  onboarding: {}
49
49
  };
@@ -151,7 +151,7 @@ export declare type Options = {
151
151
  export declare type ConnectedOptions = {
152
152
  translate: Translate;
153
153
  onQuitClick: () => void;
154
- skin: PrimarySkin;
154
+ skin: Skin;
155
155
  };
156
156
  export declare type AppOptions = ConnectedOptions & {
157
157
  token: string;
@@ -175,7 +175,7 @@ export declare type JWT = {
175
175
  export declare type WithRequired<T, K extends keyof T> = T & {
176
176
  [P in K]-?: T[P];
177
177
  };
178
- export declare type PrimarySkin = {
178
+ export declare type Skin = {
179
179
  common: {
180
180
  primary: string;
181
181
  };
@@ -1,3 +1,4 @@
1
1
  import { ReviewSkillsProps } from '@coorpacademy/components/es/template/app-review/skills/prop-types';
2
2
  import { StoreState } from '../../reducers';
3
- export declare const mapStateToSkillsProps: (state: StoreState) => ReviewSkillsProps;
3
+ import type { ConnectedOptions } from '../../types/common';
4
+ export declare const mapStateToSkillsProps: (state: StoreState, options: ConnectedOptions) => ReviewSkillsProps;
@@ -1,27 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mapStateToSkillsProps = void 0;
4
- const mapStateToSkillsProps = (state) => {
4
+ const mapStateToSkillsProps = (state, options) => {
5
+ const { translate } = options;
5
6
  return {
6
- 'aria-label': '@todo aria-label',
7
- title: '@todo title',
7
+ 'aria-label': translate('list_aria_label'),
8
+ title: translate('list_title'),
8
9
  isLoading: false,
9
- isLoadingAriaLabel: '@todo loading',
10
+ isLoadingAriaLabel: 'Review skills container is loading',
10
11
  listSkills: state.data.skills.map(skill => ({
11
- 'aria-label': '@todo aria-label skill',
12
+ 'aria-label': translate('card.aria_label'),
12
13
  isCustom: skill.custom,
13
14
  skillTitle: skill.name,
14
- skillAriaLabel: '@todo skill aria label',
15
- buttonLabel: '@todo button',
16
- buttonAriaLabel: '@todo button aria label',
17
- reviseLabel: '@todo revise',
18
- reviseAriaLabel: '@todo revise aria label',
15
+ skillAriaLabel: skill.name,
16
+ buttonLabel: translate('card.button_text'),
17
+ buttonAriaLabel: translate('card.button_text'),
18
+ reviseLabel: translate('card.text', { total: `${skill.slidesToReview}` }),
19
+ reviseAriaLabel: translate('card.text', {
20
+ total: `${skill.slidesToReview}`
21
+ }),
19
22
  // eslint-disable-next-line no-console
20
23
  onClick: () => console.log('@todo plug dispatcher select skill')
21
24
  })),
22
- titleNoSkills: '@todo title no skills',
23
- textNoSkills: '@todo text no skills',
24
- iconSkillAriaLabel: '@todo iconSkillAriaLabel'
25
+ titleNoSkills: translate('no_skills.title'),
26
+ textNoSkills: translate('no_skills.text'),
27
+ iconSkillAriaLabel: 'Image without information'
25
28
  };
26
29
  };
27
30
  exports.mapStateToSkillsProps = mapStateToSkillsProps;
@@ -226,13 +226,13 @@ const buildQuitPopinProps = (dispatch) => (onQuitClick, translate, skin) => {
226
226
  secondButton: {
227
227
  label: translate('Continue learning'),
228
228
  type: 'primary',
229
+ customStyle: {
230
+ backgroundColor: skin.common.primary
231
+ },
229
232
  handleOnclick: () => {
230
233
  dispatch(quit_popin_1.closeQuitPopin);
231
234
  },
232
- 'aria-label': translate('Continue learning'),
233
- customStyle: {
234
- color: skin.common.primary
235
- }
235
+ 'aria-label': translate('Continue learning')
236
236
  }
237
237
  };
238
238
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/app-review",
3
- "version": "0.8.10-alpha.2+3ba0e3af2",
3
+ "version": "0.9.1-alpha.12+238f6dd65",
4
4
  "description": "",
5
5
  "engines": {
6
6
  "node": ">=16.15.0"
@@ -35,9 +35,9 @@
35
35
  "main": "lib/index.js",
36
36
  "module": "es/index.js",
37
37
  "dependencies": {
38
- "@coorpacademy/components": "10.28.7",
38
+ "@coorpacademy/components": "10.29.1-alpha.12+238f6dd65",
39
39
  "@coorpacademy/redux-task": "1.1.6",
40
- "@coorpacademy/translate": "6.1.5",
40
+ "@coorpacademy/translate": "6.2.0",
41
41
  "cross-fetch": "^3.1.5",
42
42
  "jwt-decode": "^3.1.2",
43
43
  "react-redux": "^7.2.9",
@@ -71,5 +71,5 @@
71
71
  "webpack-cli": "^4.10.0",
72
72
  "webpack-dev-server": "^4.11.1"
73
73
  },
74
- "gitHead": "3ba0e3af21047cf11dde0e5a3afd7ca892d5abb7"
74
+ "gitHead": "238f6dd650f5af8fcb1d52f35eaadf9a4abc91e6"
75
75
  }