@procraft/widget-order 2.28.0 → 2.30.0

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 (84) hide show
  1. package/dist/CourseItem/FieldValues/index.js +13 -44
  2. package/dist/CourseItem/FieldValues/index.js.map +1 -1
  3. package/dist/CourseItem/FieldValues/interfaces.d.ts +4 -0
  4. package/dist/CourseItem/FieldValuesByType/index.js +12 -11
  5. package/dist/CourseItem/FieldValuesByType/index.js.map +1 -1
  6. package/dist/CourseItem/FieldValuesByType/interfaces.d.ts +4 -0
  7. package/dist/CourseItem/Materials/index.js +16 -17
  8. package/dist/CourseItem/Materials/index.js.map +1 -1
  9. package/dist/CourseItem/Materials/interfaces.d.ts +3 -0
  10. package/dist/CourseItem/OrderButton/index.js +17 -4
  11. package/dist/CourseItem/OrderButton/index.js.map +1 -1
  12. package/dist/CourseItem/OrderButton/interfaces.d.ts +6 -1
  13. package/dist/CourseItem/OrderButton/styles.js +2 -2
  14. package/dist/CourseItem/OrderButton/styles.js.map +1 -1
  15. package/dist/CourseItem/PlacesLeft/index.js +10 -8
  16. package/dist/CourseItem/PlacesLeft/index.js.map +1 -1
  17. package/dist/CourseItem/PlacesLeft/interfaces.d.ts +2 -0
  18. package/dist/CourseItem/Reviews/index.js +7 -6
  19. package/dist/CourseItem/Reviews/index.js.map +1 -1
  20. package/dist/CourseItem/Reviews/interfaces.d.ts +1 -0
  21. package/dist/CourseItem/Sales/Sale/index.js +16 -38
  22. package/dist/CourseItem/Sales/Sale/index.js.map +1 -1
  23. package/dist/CourseItem/Sales/Sale/interfaces.d.ts +4 -0
  24. package/dist/CourseItem/Sales/Sale/styles.d.ts +3 -1
  25. package/dist/CourseItem/Sales/Sale/styles.js +1 -0
  26. package/dist/CourseItem/Sales/Sale/styles.js.map +1 -1
  27. package/dist/CourseItem/Sales/index.js +11 -3
  28. package/dist/CourseItem/Sales/index.js.map +1 -1
  29. package/dist/CourseItem/Sales/interfaces.d.ts +4 -0
  30. package/dist/CourseItem/index.js +44 -26
  31. package/dist/CourseItem/index.js.map +1 -1
  32. package/dist/CourseItem/styles.js +0 -2
  33. package/dist/CourseItem/styles.js.map +1 -1
  34. package/dist/components/Button/index.js +5 -1
  35. package/dist/components/Button/index.js.map +1 -1
  36. package/dist/components/Button/interfaces.d.ts +3 -1
  37. package/dist/components/Container/styles.d.ts +1 -0
  38. package/dist/components/Container/styles.js +2 -0
  39. package/dist/components/Container/styles.js.map +1 -1
  40. package/dist/components/RadioGroup/index.js +3 -6
  41. package/dist/components/RadioGroup/index.js.map +1 -1
  42. package/dist/components/RadioGroup/interfaces.d.ts +2 -0
  43. package/dist/components/RadioGroup/styles.d.ts +2 -0
  44. package/dist/components/RadioGroup/styles.js +4 -3
  45. package/dist/components/RadioGroup/styles.js.map +1 -1
  46. package/dist/components/Typography/styles.js +1 -1
  47. package/dist/constants/colors.d.ts +7 -0
  48. package/dist/constants/colors.js +11 -0
  49. package/dist/constants/colors.js.map +1 -0
  50. package/dist/index.d.ts +1 -1
  51. package/dist/index.js +4 -4
  52. package/dist/index.js.map +1 -1
  53. package/dist/tsconfig.build.tsbuildinfo +1 -1
  54. package/package.json +1 -1
  55. package/src/CourseItem/FieldValues/index.tsx +52 -89
  56. package/src/CourseItem/FieldValues/interfaces.ts +4 -1
  57. package/src/CourseItem/FieldValuesByType/index.tsx +18 -4
  58. package/src/CourseItem/FieldValuesByType/interfaces.tsx +4 -0
  59. package/src/CourseItem/Materials/index.tsx +35 -6
  60. package/src/CourseItem/Materials/interfaces.ts +3 -0
  61. package/src/CourseItem/OrderButton/index.tsx +36 -3
  62. package/src/CourseItem/OrderButton/interfaces.ts +7 -15
  63. package/src/CourseItem/OrderButton/styles.ts +2 -2
  64. package/src/CourseItem/PlacesLeft/index.tsx +27 -17
  65. package/src/CourseItem/PlacesLeft/interfaces.ts +2 -0
  66. package/src/CourseItem/Reviews/index.tsx +14 -8
  67. package/src/CourseItem/Reviews/interfaces.ts +1 -2
  68. package/src/CourseItem/Sales/Sale/index.tsx +23 -45
  69. package/src/CourseItem/Sales/Sale/interfaces.ts +4 -2
  70. package/src/CourseItem/Sales/Sale/styles.ts +4 -1
  71. package/src/CourseItem/Sales/index.tsx +17 -2
  72. package/src/CourseItem/Sales/interfaces.ts +4 -4
  73. package/src/CourseItem/index.tsx +81 -30
  74. package/src/CourseItem/interfaces.ts +1 -8
  75. package/src/CourseItem/styles.ts +0 -2
  76. package/src/components/Button/index.tsx +10 -2
  77. package/src/components/Button/interfaces.ts +3 -1
  78. package/src/components/Container/styles.ts +3 -0
  79. package/src/components/RadioGroup/index.tsx +6 -22
  80. package/src/components/RadioGroup/interfaces.ts +2 -0
  81. package/src/components/RadioGroup/styles.ts +9 -3
  82. package/src/components/Typography/styles.ts +1 -1
  83. package/src/constants/colors.ts +7 -0
  84. package/src/index.tsx +4 -3
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.28.0",
4
+ "version": "2.30.0",
5
5
  "private": false,
6
6
  "main": "dist",
7
7
  "scripts": {
@@ -11,15 +11,15 @@ import { FieldValuesStyled } from './styles'
11
11
  * Выводим список элементов для заказа
12
12
  */
13
13
  export const FieldValues: React.FC<FieldValuesProps> = ({
14
- // catalogItem,
15
14
  fieldValues,
16
15
  fieldsValueSelected,
17
16
  fieldsValueSelectedSetter,
17
+ checkedBgColor,
18
+ checkedTextColor,
19
+ placesLeftBgColor,
20
+ placesLeftTextColor,
18
21
  type,
19
22
  }) => {
20
- // console.log('FieldValues fieldValues', fieldValues)
21
- // console.log('FieldValues fieldsValueSelected', fieldsValueSelected)
22
-
23
23
  const [tabIndex, tabIndexSetter] = useState(0)
24
24
 
25
25
  /**
@@ -42,8 +42,6 @@ export const FieldValues: React.FC<FieldValuesProps> = ({
42
42
  return groupNames
43
43
  }, [fieldValues])
44
44
 
45
- // console.log('FieldValues groupNames', groupNames)
46
-
47
45
  /**
48
46
  * Выбранные элементы конкретно текущего типа
49
47
  */
@@ -78,44 +76,42 @@ export const FieldValues: React.FC<FieldValuesProps> = ({
78
76
  (groupName: string | undefined) => {
79
77
  const items: RadioGroupItem[] = []
80
78
 
81
- fieldValues
82
- // .filter((n) => (n.groupName === groupName))
83
- .forEach((fieldValue) => {
84
- /**
85
- * Если указана группа, то фильтруем по группе
86
- */
87
- if (groupName && fieldValue.groupName !== groupName) {
88
- return
89
- }
90
-
91
- /**
92
- * Если всего один элемент и это 'Без потока', пропускаем его
93
- */
94
- if (
95
- fieldValues.length === 1 &&
96
- fieldValue.optionName === 'Без потока'
97
- ) {
98
- return
99
- }
100
-
101
- /**
102
- * Добавляем элемент к конечному массиву
103
- */
104
- items.push({
105
- uid: fieldValue.uid,
106
- label: (
107
- <>
108
- <Typography
109
- variant="grey-sm"
110
- component="label"
111
- className="altItemText"
112
- >
113
- {fieldValue.optionName}
114
- </Typography>
115
- </>
116
- ),
117
- })
79
+ fieldValues.forEach((fieldValue) => {
80
+ /**
81
+ * Если указана группа, то фильтруем по группе
82
+ */
83
+ if (groupName && fieldValue.groupName !== groupName) {
84
+ return
85
+ }
86
+
87
+ /**
88
+ * Если всего один элемент и это 'Без потока', пропускаем его
89
+ */
90
+ if (
91
+ fieldValues.length === 1 &&
92
+ fieldValue.optionName === 'Без потока'
93
+ ) {
94
+ return
95
+ }
96
+
97
+ /**
98
+ * Добавляем элемент к конечному массиву
99
+ */
100
+ items.push({
101
+ uid: fieldValue.uid,
102
+ label: (
103
+ <>
104
+ <Typography
105
+ variant="grey-sm"
106
+ component="label"
107
+ className="altItemText"
108
+ >
109
+ {fieldValue.optionName}
110
+ </Typography>
111
+ </>
112
+ ),
118
113
  })
114
+ })
119
115
 
120
116
  const radioGroup = (
121
117
  <>
@@ -123,10 +119,13 @@ export const FieldValues: React.FC<FieldValuesProps> = ({
123
119
  items={items}
124
120
  value={fieldsValueSelectedByType[0]?.uid}
125
121
  onChangeIndex={onChangeIndex}
122
+ checkedBgColor={checkedBgColor}
123
+ checkedTextColor={checkedTextColor}
126
124
  />
127
125
 
128
126
  <PlacesLeft
129
- // fieldsValueSelected={fieldsValueSelected}
127
+ bgColor={placesLeftBgColor}
128
+ textColor={placesLeftTextColor}
130
129
  fieldsValueSelected={fieldsValueSelectedByType}
131
130
  />
132
131
  </>
@@ -137,7 +136,15 @@ export const FieldValues: React.FC<FieldValuesProps> = ({
137
136
  radioGroup,
138
137
  }
139
138
  },
140
- [fieldValues, fieldsValueSelectedByType, onChangeIndex]
139
+ [
140
+ fieldValues,
141
+ fieldsValueSelectedByType,
142
+ onChangeIndex,
143
+ checkedBgColor,
144
+ checkedTextColor,
145
+ placesLeftBgColor,
146
+ placesLeftTextColor,
147
+ ]
141
148
  )
142
149
 
143
150
  return useMemo(() => {
@@ -161,59 +168,15 @@ export const FieldValues: React.FC<FieldValuesProps> = ({
161
168
  tabIndex={tabIndex}
162
169
  onChangeTabIndex={tabIndexSetter}
163
170
  tabs={tabs}
164
- // tabs={[
165
- // {
166
- // label: 'GroupName1',
167
- // content: null,
168
- // },
169
- // {
170
- // label: 'GroupName1',
171
- // content: null,
172
- // },
173
- // ]}
174
- // style={{
175
- // marginTop: 15,
176
- // }}
177
171
  />
178
172
  )
179
173
  } else {
180
- /**
181
- * Иначе выводим как есть
182
- */
183
- // const items: RadioGroupItem[] = []
184
-
185
- // fieldValues.forEach((fieldValue) => {
186
- // items.push({
187
- // uid: fieldValue.uid,
188
- // label: (
189
- // <>
190
- // <Typography
191
- // variant="grey-sm"
192
- // component="label"
193
- // className="altItemText"
194
- // >
195
- // {fieldValue.optionName}
196
- // </Typography>
197
- // </>
198
- // ),
199
- // })
200
- // })
201
-
202
- // const dates = (
203
- // <RadioGroup
204
- // items={items}
205
- // value={fieldsValueSelectedByType[0]?.uid}
206
- // onChangeIndex={onChangeIndex}
207
- // />
208
- // )
209
-
210
174
  const { radioGroup } = getItems(undefined)
211
175
 
212
176
  let title = ''
213
177
 
214
178
  switch (type) {
215
179
  case CatalogFieldValueType.SUBSCRIPTION:
216
- // title = 'Подписка'
217
180
  title = fieldsValueSelected.filter((n) => n.type === type)[0]
218
181
  ?.fieldName
219
182
 
@@ -5,7 +5,10 @@ import {
5
5
  } from '../../modules/gql/generated/types'
6
6
 
7
7
  export type FieldValuesProps = {
8
- // catalogItem: OrderCatalogItemFragment
8
+ checkedBgColor?: string
9
+ checkedTextColor?: string
10
+ placesLeftBgColor?: string
11
+ placesLeftTextColor?: string
9
12
  fieldValues: CatalogFieldValue[]
10
13
  fieldsValueSelected: NonNullable<OrderCatalogItemFragment['fieldValues']>
11
14
  fieldsValueSelectedSetter: React.Dispatch<
@@ -9,10 +9,13 @@ import { FieldValuesByTypeStyled } from './styles'
9
9
  * Сейчас мы выводим в один радиогрупп не все элементы сразу, а отдельно подписки и отдельно потоки.
10
10
  */
11
11
  export const FieldValuesByType: React.FC<FieldValuesByTypeProps> = ({
12
- // catalogItem,
13
12
  fieldValuesInfo,
14
13
  fieldsValueSelected,
15
14
  fieldsValueSelectedSetter,
15
+ checkedBgColor,
16
+ checkedTextColor,
17
+ placesLeftBgColor,
18
+ placesLeftTextColor,
16
19
  type,
17
20
  }) => {
18
21
  /**
@@ -33,8 +36,10 @@ export const FieldValuesByType: React.FC<FieldValuesByTypeProps> = ({
33
36
  return (
34
37
  <FieldValuesByTypeStyled>
35
38
  <FieldValues
36
- // catalogItem={catalogItem}
37
- // fieldsValueSelected={fieldsValueSelected.filter(n => n.type === type)}
39
+ checkedBgColor={checkedBgColor}
40
+ checkedTextColor={checkedTextColor}
41
+ placesLeftBgColor={placesLeftBgColor}
42
+ placesLeftTextColor={placesLeftTextColor}
38
43
  fieldsValueSelected={fieldsValueSelected}
39
44
  fieldsValueSelectedSetter={fieldsValueSelectedSetter}
40
45
  fieldValues={fieldValuesByType}
@@ -42,5 +47,14 @@ export const FieldValuesByType: React.FC<FieldValuesByTypeProps> = ({
42
47
  />
43
48
  </FieldValuesByTypeStyled>
44
49
  )
45
- }, [fieldValuesByType, fieldsValueSelected, fieldsValueSelectedSetter, type])
50
+ }, [
51
+ fieldValuesByType,
52
+ fieldsValueSelected,
53
+ fieldsValueSelectedSetter,
54
+ type,
55
+ checkedBgColor,
56
+ checkedTextColor,
57
+ placesLeftBgColor,
58
+ placesLeftTextColor,
59
+ ])
46
60
  }
@@ -5,6 +5,10 @@ import { FieldValuesProps } from '../FieldValues/interfaces'
5
5
  export type FieldValuesByTypeProps = {
6
6
  fieldValuesInfo: ReturnType<typeof usePrices>
7
7
 
8
+ checkedBgColor?: string
9
+ checkedTextColor?: string
10
+ placesLeftBgColor?: string
11
+ placesLeftTextColor?: string
8
12
  type: CatalogFieldValueType
9
13
 
10
14
  fieldsValueSelected: FieldValuesProps['fieldsValueSelected']
@@ -1,8 +1,19 @@
1
1
  import React, { useCallback, useMemo, useState } from 'react'
2
+ import {
3
+ CONTENT_BG_DEFAULT_COLOR,
4
+ CONTENT_TEXT_DEFAULT_COLOR,
5
+ } from '../../constants/colors'
2
6
  import { MaterialsProps } from './interfaces'
3
7
  import { MaterialsStyled } from './styles'
4
8
 
5
- const Materials: React.FC<MaterialsProps> = ({ benefits, extraBenefits, limit, ...other }) => {
9
+ const Materials: React.FC<MaterialsProps> = ({
10
+ benefits,
11
+ extraBenefits,
12
+ limit,
13
+ backgroundColor,
14
+ textColor,
15
+ linkColor,
16
+ }) => {
6
17
  const [showAll, showAllSetter] = useState(false)
7
18
 
8
19
  const renderBenefit = useMemo(
@@ -19,7 +30,11 @@ const Materials: React.FC<MaterialsProps> = ({ benefits, extraBenefits, limit, .
19
30
  const parts = benefit.split('||')
20
31
 
21
32
  if (parts.length === 2) {
22
- content = <a href={parts[1]}>{parts[0]}</a>
33
+ content = (
34
+ <a style={{ color: linkColor }} href={parts[1]}>
35
+ {parts[0]}
36
+ </a>
37
+ )
23
38
  } else {
24
39
  content = benefit
25
40
  }
@@ -45,7 +60,7 @@ const Materials: React.FC<MaterialsProps> = ({ benefits, extraBenefits, limit, .
45
60
  )
46
61
  }
47
62
  },
48
- []
63
+ [linkColor]
49
64
  )
50
65
 
51
66
  const showAllOnClick = useCallback(() => {
@@ -67,7 +82,8 @@ const Materials: React.FC<MaterialsProps> = ({ benefits, extraBenefits, limit, .
67
82
  ) : null
68
83
 
69
84
  return {
70
- materials: showAll || !hasMore ? allBenefits : allBenefits.slice(0, limit),
85
+ materials:
86
+ showAll || !hasMore ? allBenefits : allBenefits.slice(0, limit),
71
87
  showAllButton,
72
88
  }
73
89
  }, [showAll, showAllOnClick, limit, benefits, extraBenefits])
@@ -78,13 +94,26 @@ const Materials: React.FC<MaterialsProps> = ({ benefits, extraBenefits, limit, .
78
94
  }
79
95
 
80
96
  return (
81
- <MaterialsStyled variant="white" {...other}>
97
+ <MaterialsStyled
98
+ style={{
99
+ backgroundColor: backgroundColor ?? CONTENT_BG_DEFAULT_COLOR,
100
+ color: textColor ?? CONTENT_TEXT_DEFAULT_COLOR,
101
+ }}
102
+ variant="white"
103
+ >
82
104
  <ol>{materials.map(renderBenefit)}</ol>
83
105
 
84
106
  {showAllButton}
85
107
  </MaterialsStyled>
86
108
  )
87
- }, [materials, other, renderBenefit, showAllButton])
109
+ }, [
110
+ materials,
111
+ renderBenefit,
112
+ showAllButton,
113
+ backgroundColor,
114
+ textColor,
115
+ linkColor,
116
+ ])
88
117
  }
89
118
 
90
119
  export default Materials
@@ -2,4 +2,7 @@ export type MaterialsProps = {
2
2
  benefits: string[]
3
3
  extraBenefits: string[]
4
4
  limit: number
5
+ backgroundColor?: string
6
+ textColor?: string
7
+ linkColor?: string
5
8
  }
@@ -4,18 +4,23 @@ import React, {
4
4
  useCallback,
5
5
  useEffect,
6
6
  useMemo,
7
- useState,
7
+ useState
8
8
  } from 'react'
9
9
  import NumberFormat from 'react-number-format'
10
10
  import Button from '../../components/Button'
11
11
  import Container from '../../components/Container'
12
12
  import OldPrice from '../../components/OldPrice'
13
13
  import Typography from '../../components/Typography'
14
+ import {
15
+ COLORED_TEXT_DEFAULT_COLOR,
16
+ TITLE_BG_DEFAULT_COLOR,
17
+ TITLE_TEXT_DEFAULT_COLOR
18
+ } from '../../constants/colors'
14
19
  import { useOrderLink } from '../../hooks/useOrderLink'
15
20
  import { formatFreeLabel } from '../../models/Course'
16
21
  import {
17
22
  CourseTariffPriceDetailsChangeByTimeItem,
18
- CourseTariffPriceKind,
23
+ CourseTariffPriceKind
19
24
  } from '../../modules/gql/generated/types'
20
25
  import { getCurrencyPrefix, getCurrencySuffix } from '../../utils'
21
26
  import { OrderButtonProps } from './interfaces'
@@ -29,6 +34,11 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
29
34
  fieldsValueSelected,
30
35
  orderLink,
31
36
  course,
37
+ buttonBgColor,
38
+ buttonTextColor,
39
+ containerBgColor,
40
+ dateTextColor,
41
+ selectedDateTextColor,
32
42
  }) => {
33
43
  useEffect(() => {
34
44
  dateIndexSetter(0)
@@ -119,11 +129,22 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
119
129
  <OrderButtonByDateSalesStyled
120
130
  key="OrderButtonByDateSalesStyled"
121
131
  variant="white"
132
+ bgColor={containerBgColor}
122
133
  >
123
134
  {changeByTimeItemsNew.map((item, idx) => (
124
135
  <span
125
136
  key={idx}
126
137
  className={dateIndex === idx ? 'active' : undefined}
138
+ style={{
139
+ backgroundColor:
140
+ dateIndex === idx
141
+ ? buttonBgColor ?? TITLE_BG_DEFAULT_COLOR
142
+ : 'transparent',
143
+ color:
144
+ dateIndex === idx
145
+ ? selectedDateTextColor ?? TITLE_TEXT_DEFAULT_COLOR
146
+ : dateTextColor ?? COLORED_TEXT_DEFAULT_COLOR,
147
+ }}
127
148
  data-idx={idx}
128
149
  onClick={onClickDateIndex}
129
150
  >
@@ -177,7 +198,12 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
177
198
  const freeLabel = formatFreeLabel(course)
178
199
 
179
200
  content.push(
180
- <Container key="buy" variant="white" className="buy">
201
+ <Container
202
+ bgColor={containerBgColor}
203
+ key="buy"
204
+ variant="white"
205
+ className="buy"
206
+ >
181
207
  {oldPrice && oldPrice > price ? (
182
208
  <OldPrice
183
209
  prefix={currencyPrefix}
@@ -195,6 +221,8 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
195
221
  <div className="buy">
196
222
  <a href={uri.toString()} className="buy-link">
197
223
  <Button
224
+ style={{color: buttonTextColor}}
225
+ backgroundColor={buttonBgColor}
198
226
  disabled={
199
227
  Boolean(currStartDate) && moment(currStartDate) > moment()
200
228
  }
@@ -230,5 +258,10 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
230
258
  catalogItem.master?.currency,
231
259
  dateIndex,
232
260
  onClickDateIndex,
261
+ buttonBgColor,
262
+ buttonTextColor,
263
+ containerBgColor,
264
+ dateTextColor,
265
+ selectedDateTextColor,
233
266
  ])
234
267
  }
@@ -1,28 +1,20 @@
1
- // import { WidgetOrderCourseItem } from '../../interfaces'
2
1
  import { CourseFragment } from '../../interfaces/CourseFragment'
3
2
  import {
4
3
  CatalogFieldValue,
5
- OrderCatalogItemFragment,
4
+ OrderCatalogItemFragment
6
5
  } from '../../modules/gql/generated/types'
7
- // import { CourseTariffPriceDetailsSubscriptionItem } from '../../modules/gql/generated/types'
8
6
 
9
7
  export type OrderButtonProps = {
10
- // item: WidgetOrderCourseItem
11
-
12
- catalogItem: OrderCatalogItemFragment
13
-
14
8
  /**
15
9
  * Выбранные элементы, которые войдут в заказ
16
10
  */
17
11
  fieldsValueSelected: CatalogFieldValue[]
18
-
19
- // courses: CourseFragment[]
12
+ catalogItem: OrderCatalogItemFragment
20
13
  course: CourseFragment
21
-
22
14
  orderLink: string
23
-
24
- /**
25
- * Выбранный вариант подписки, если есть
26
- */
27
- // subscription: CourseTariffPriceDetailsSubscriptionItem | null
15
+ buttonBgColor?: string
16
+ buttonTextColor?: string
17
+ containerBgColor?: string
18
+ dateTextColor?: string
19
+ selectedDateTextColor?: string
28
20
  }
@@ -1,7 +1,9 @@
1
1
  import styled from 'styled-components'
2
2
  import Container from '../../components/Container'
3
+ import { CONTENT_BG_DEFAULT_COLOR } from '../../constants/colors'
3
4
 
4
5
  export const OrderButtonByDateSalesStyled = styled(Container)`
6
+ background-color: ${({ bgColor }) => bgColor ?? CONTENT_BG_DEFAULT_COLOR};
5
7
  display: flex;
6
8
  flex-wrap: wrap;
7
9
  justify-content: space-around;
@@ -15,9 +17,7 @@ export const OrderButtonByDateSalesStyled = styled(Container)`
15
17
  margin: 2px;
16
18
 
17
19
  &.active {
18
- background: #233d78;
19
20
  border-radius: 4px;
20
- color: #fff;
21
21
  padding: 1px 4px;
22
22
  }
23
23
  }
@@ -9,6 +9,8 @@ import { PlacesLeftStyled } from './styles'
9
9
  */
10
10
  export const PlacesLeft: React.FC<PlacesLeftProps> = ({
11
11
  fieldsValueSelected,
12
+ bgColor,
13
+ textColor,
12
14
  }) => {
13
15
  return useMemo(() => {
14
16
  let placesLeft: number | undefined
@@ -50,25 +52,33 @@ export const PlacesLeft: React.FC<PlacesLeftProps> = ({
50
52
  return null
51
53
  }
52
54
 
55
+ const bgColorAlpha = `${bgColor}10`
56
+
53
57
  return (
54
58
  <PlacesLeftStyled>
55
- <Container variant="white" className="placesLeft">
56
- {placesLeft > 0 ? (
57
- <>
58
- Осталось {placesLeft}{' '}
59
- <ReactDecliner
60
- num={placesLeft}
61
- one="место"
62
- two="места"
63
- many="мест"
64
- />
65
- !
66
- </>
67
- ) : (
68
- 'Места закончились'
69
- )}
59
+ <Container
60
+ bgColor={bgColorAlpha}
61
+ variant="white"
62
+ className="placesLeft"
63
+ >
64
+ <span style={{ color: textColor }}>
65
+ {placesLeft > 0 ? (
66
+ <>
67
+ Осталось {placesLeft}{' '}
68
+ <ReactDecliner
69
+ num={placesLeft}
70
+ one="место"
71
+ two="места"
72
+ many="мест"
73
+ />
74
+ !
75
+ </>
76
+ ) : (
77
+ 'Места закончились'
78
+ )}
79
+ </span>
70
80
  </Container>
71
81
  </PlacesLeftStyled>
72
82
  )
73
- }, [fieldsValueSelected])
74
- }
83
+ }, [fieldsValueSelected, bgColor, textColor])
84
+ }
@@ -2,4 +2,6 @@ import { CatalogFieldValue } from '../../modules/gql/generated/types'
2
2
 
3
3
  export type PlacesLeftProps = {
4
4
  fieldsValueSelected: CatalogFieldValue[]
5
+ bgColor?: string
6
+ textColor?: string
5
7
  }
@@ -11,6 +11,7 @@ import { ReviewsLinkStyled, ReviewsStyled } from './styles'
11
11
  export const Reviews: React.FC<ReviewsProps> = ({
12
12
  reviewsCount,
13
13
  item,
14
+ textColor,
14
15
  ...other
15
16
  }) => {
16
17
  const [active, activeSetter] = useState(false)
@@ -30,14 +31,19 @@ export const Reviews: React.FC<ReviewsProps> = ({
30
31
  <>
31
32
  <ReviewsStyled {...other}>
32
33
  <ReviewsLinkStyled onClick={toggleActive}>
33
- <span className="mean-val">{ratingStd}</span>
34
- <Stars rating={ratingHalfMean} /> {reviewsCount}{' '}
35
- <Recliner
36
- one="отзыв"
37
- two="отзыва"
38
- many="отзывов"
39
- num={reviewsCount}
40
- />
34
+ <span style={{ color: textColor }} className="mean-val">
35
+ {ratingStd}
36
+ </span>
37
+ <Stars rating={ratingHalfMean} />
38
+ <span style={{ color: textColor }}>{reviewsCount}&nbsp;</span>
39
+ <span style={{ color: textColor }}>
40
+ <Recliner
41
+ one="отзыв"
42
+ two="отзыва"
43
+ many="отзывов"
44
+ num={reviewsCount}
45
+ />
46
+ </span>
41
47
  </ReviewsLinkStyled>
42
48
  </ReviewsStyled>
43
49
 
@@ -1,8 +1,7 @@
1
- // import { WidgetOrderCourseItem } from '../../interfaces'
2
1
  import { OrderCatalogItemFragment } from '../../modules/gql/generated/types'
3
2
 
4
3
  export type ReviewsProps = {
5
- // item: WidgetOrderCourseItem
4
+ textColor?: string
6
5
  item: OrderCatalogItemFragment
7
6
  reviewsCount: number
8
7
  }