@procraft/widget-order 2.30.4 → 2.30.6

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@procraft/widget-order",
3
3
  "description": "Order widget for landing",
4
- "version": "2.30.4",
4
+ "version": "2.30.6",
5
5
  "private": false,
6
6
  "main": "dist",
7
7
  "scripts": {
@@ -11,8 +11,7 @@ import {
11
11
  } from '../constants/colors'
12
12
  import { usePrices } from '../hooks/usePrices'
13
13
  import {
14
- CatalogFieldValueType,
15
- CourseTariffFlowBehaviour,
14
+ CatalogFieldValueType, CourseSubKind,
16
15
  } from '../modules/gql/generated/types'
17
16
  import { FieldValuesProps } from './FieldValues/interfaces'
18
17
  import { FieldValuesByType } from './FieldValuesByType'
@@ -22,6 +21,7 @@ import { OrderButton } from './OrderButton'
22
21
  import { Reviews } from './Reviews'
23
22
  import Sales from './Sales'
24
23
  import { BoxStyled, NavigationStyled, WidgetStyled } from './styles'
24
+ import { formatCourseSubKindLabel } from '../models/Course'
25
25
 
26
26
  const CourseItem: React.FC<CourseItemComponentProps> = (props) => {
27
27
  const {
@@ -135,21 +135,10 @@ const CourseItem: React.FC<CourseItemComponentProps> = (props) => {
135
135
 
136
136
  const tariff = course.tariffs?.find((n) => n.uid === item.course?.tariffId)
137
137
 
138
- let flowBehaviourTitle: string | undefined
139
-
140
- switch (tariff?.flowBehaviour) {
141
- case CourseTariffFlowBehaviour.CONTINUOUS:
142
- flowBehaviourTitle = 'Постоянный набор'
143
- break
144
-
145
- case CourseTariffFlowBehaviour.MULTIPLE:
146
- flowBehaviourTitle = 'Поточный набор'
147
- break
148
-
149
- case CourseTariffFlowBehaviour.SINGLE:
150
- flowBehaviourTitle = 'Разовый набор'
151
- break
152
- }
138
+ const title = formatCourseSubKindLabel({
139
+ subKind: course.subKind ?? CourseSubKind.COURSE,
140
+ subKindLabel: course.subKindLabel,
141
+ })
153
142
 
154
143
  return (
155
144
  <>
@@ -157,7 +146,7 @@ const CourseItem: React.FC<CourseItemComponentProps> = (props) => {
157
146
  <NavigationStyled style={{ backgroundColor: titleBgColor }}>
158
147
  <Typography>
159
148
  <span style={{ color: titleTextColor }}>
160
- {flowBehaviourTitle}
149
+ {title}
161
150
  </span>
162
151
  </Typography>
163
152
  </NavigationStyled>
@@ -2837,6 +2837,12 @@
2837
2837
  "isDeprecated": false,
2838
2838
  "deprecationReason": null
2839
2839
  },
2840
+ {
2841
+ "name": "FreeByOption",
2842
+ "description": null,
2843
+ "isDeprecated": false,
2844
+ "deprecationReason": null
2845
+ },
2840
2846
  {
2841
2847
  "name": "Fixed",
2842
2848
  "description": null,
@@ -343,6 +343,7 @@ export enum CourseTariffPriceKind {
343
343
  CHANGESBYSALES = 'ChangesBySales',
344
344
  CHANGESBYTIME = 'ChangesByTime',
345
345
  FIXEDBYOPTION = 'FixedByOption',
346
+ FREEBYOPTION = 'FreeByOption',
346
347
  FIXED = 'Fixed',
347
348
  FREE = 'Free'
348
349
  }