@procraft/widget-order 2.21.4 → 2.21.7

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.21.4",
4
+ "version": "2.21.7",
5
5
  "private": false,
6
6
  "main": "dist",
7
7
  "scripts": {
@@ -8,7 +8,7 @@ import OldPrice from '../../components/OldPrice'
8
8
  import Typography from '../../components/Typography'
9
9
  import { useOrderLink } from '../../hooks/useOrderLink'
10
10
  import {
11
- CourseKind,
11
+ CourseSubKind,
12
12
  CourseTariffPriceDetailsChangeByTimeItem,
13
13
  CourseTariffPriceKind,
14
14
  } from '../../modules/gql/generated/types'
@@ -176,10 +176,34 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
176
176
  // // subscription_amount: subscription.period.amount,
177
177
  // // }
178
178
  // }
179
- const freeLabel =
180
- course.kind === CourseKind.WEBINAR
181
- ? 'Бесплатный вебинар'
182
- : 'Бесплатный курс'
179
+
180
+ let freeLabel;
181
+
182
+ switch(course.subKind) {
183
+ case CourseSubKind.WEBINAR:
184
+ freeLabel = 'Бесплатный вебинар'; break;
185
+ case CourseSubKind.ABONNEMENT:
186
+ freeLabel = 'Бесплатный абонемент'; break;
187
+ case CourseSubKind.CLUB:
188
+ freeLabel = 'Бесплатный клуб'; break;
189
+ case CourseSubKind.FACULTY:
190
+ freeLabel = 'Бесплатный факультет'; break;
191
+ case CourseSubKind.INTENSIVE:
192
+ freeLabel = 'Бесплатный интенсив'; break;
193
+ case CourseSubKind.MARATHON:
194
+ freeLabel = 'Бесплатный марафон'; break;
195
+ case CourseSubKind.MASTERCLASS:
196
+ freeLabel = 'Бесплатный мастер-класс'; break;
197
+ case CourseSubKind.PRERECORDING:
198
+ freeLabel = 'Предзапись'; break;
199
+ case CourseSubKind.WORKSHOP:
200
+ freeLabel = 'Бесплатный воркшоп'; break;
201
+ case CourseSubKind.SUBSCRIPTION:
202
+ freeLabel = 'Бесплатная подписка'; break;
203
+ default:
204
+ freeLabel = 'Бесплатный курс'; break;
205
+ }
206
+
183
207
  content.push(
184
208
  <Container key="buy" variant="white" className="buy">
185
209
  {oldPrice && oldPrice > price ? <OldPrice price={oldPrice} /> : null}
@@ -220,5 +244,6 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
220
244
  toggleDateIndex,
221
245
  uri,
222
246
  course.kind,
247
+ course.uid,
223
248
  ])
224
249
  }
@@ -24,7 +24,13 @@ import { FieldValuesByType } from './FieldValuesByType'
24
24
  // import { useCatalogItemSubscription } from '../hooks/useCatalogItemSubscription'
25
25
 
26
26
  const CourseItem: React.FC<CourseItemComponentProps> = (props) => {
27
- const { orderLink, materialsLimit, course, catalogItem: item, ratesVisible } = props;
27
+ const {
28
+ orderLink,
29
+ materialsLimit,
30
+ course,
31
+ catalogItem: item,
32
+ ratesVisible,
33
+ } = props
28
34
 
29
35
  /**
30
36
  * ID текущего элемента
@@ -138,8 +144,6 @@ const CourseItem: React.FC<CourseItemComponentProps> = (props) => {
138
144
 
139
145
  // const items: WidgetOrderCourseItem[] = []
140
146
 
141
- console.log('>>> ratesVisible', ratesVisible)
142
-
143
147
  return (
144
148
  <>
145
149
  <WidgetStyled>
@@ -176,6 +176,7 @@ export enum CourseSubKind {
176
176
  CLUB = 'Club',
177
177
  SUBSCRIPTION = 'Subscription',
178
178
  WORKSHOP = 'Workshop',
179
+ PRERECORDING = 'PreRecording',
179
180
  MASTERCLASS = 'MasterClass',
180
181
  WEBINAR = 'Webinar',
181
182
  FACULTY = 'Faculty',