@procraft/widget-order 2.29.0 → 2.30.1

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 (77) 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 +15 -5
  8. package/dist/CourseItem/Materials/index.js.map +1 -1
  9. package/dist/CourseItem/Materials/interfaces.d.ts +2 -0
  10. package/dist/CourseItem/OrderButton/index.js +17 -5
  11. package/dist/CourseItem/OrderButton/index.js.map +1 -1
  12. package/dist/CourseItem/OrderButton/interfaces.d.ts +5 -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 +27 -15
  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 +1 -1
  35. package/dist/components/Button/index.js.map +1 -1
  36. package/dist/components/Container/styles.d.ts +1 -0
  37. package/dist/components/Container/styles.js +2 -0
  38. package/dist/components/Container/styles.js.map +1 -1
  39. package/dist/components/RadioGroup/index.js +3 -6
  40. package/dist/components/RadioGroup/index.js.map +1 -1
  41. package/dist/components/RadioGroup/interfaces.d.ts +2 -0
  42. package/dist/components/RadioGroup/styles.d.ts +2 -0
  43. package/dist/components/RadioGroup/styles.js +4 -3
  44. package/dist/components/RadioGroup/styles.js.map +1 -1
  45. package/dist/components/Typography/styles.js +1 -1
  46. package/dist/constants/colors.d.ts +6 -2
  47. package/dist/constants/colors.js +7 -3
  48. package/dist/constants/colors.js.map +1 -1
  49. package/dist/tsconfig.build.tsbuildinfo +1 -1
  50. package/package.json +1 -1
  51. package/src/CourseItem/FieldValues/index.tsx +52 -89
  52. package/src/CourseItem/FieldValues/interfaces.ts +4 -1
  53. package/src/CourseItem/FieldValuesByType/index.tsx +18 -4
  54. package/src/CourseItem/FieldValuesByType/interfaces.tsx +4 -0
  55. package/src/CourseItem/Materials/index.tsx +24 -5
  56. package/src/CourseItem/Materials/interfaces.ts +2 -0
  57. package/src/CourseItem/OrderButton/index.tsx +36 -6
  58. package/src/CourseItem/OrderButton/interfaces.ts +6 -3
  59. package/src/CourseItem/OrderButton/styles.ts +2 -2
  60. package/src/CourseItem/PlacesLeft/index.tsx +27 -17
  61. package/src/CourseItem/PlacesLeft/interfaces.ts +2 -0
  62. package/src/CourseItem/Reviews/index.tsx +14 -8
  63. package/src/CourseItem/Reviews/interfaces.ts +1 -2
  64. package/src/CourseItem/Sales/Sale/index.tsx +23 -45
  65. package/src/CourseItem/Sales/Sale/interfaces.ts +4 -2
  66. package/src/CourseItem/Sales/Sale/styles.ts +4 -1
  67. package/src/CourseItem/Sales/index.tsx +17 -2
  68. package/src/CourseItem/Sales/interfaces.ts +4 -4
  69. package/src/CourseItem/index.tsx +47 -14
  70. package/src/CourseItem/styles.ts +0 -2
  71. package/src/components/Button/index.tsx +2 -2
  72. package/src/components/Container/styles.ts +3 -0
  73. package/src/components/RadioGroup/index.tsx +6 -22
  74. package/src/components/RadioGroup/interfaces.ts +2 -0
  75. package/src/components/RadioGroup/styles.ts +9 -3
  76. package/src/components/Typography/styles.ts +1 -1
  77. package/src/constants/colors.ts +6 -2
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.29.0",
4
+ "version": "2.30.1",
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,5 +1,8 @@
1
1
  import React, { useCallback, useMemo, useState } from 'react'
2
- import { INFO_BG_DEFAULT_COLOR } from '../../constants/colors'
2
+ import {
3
+ CONTENT_BG_DEFAULT_COLOR,
4
+ CONTENT_TEXT_DEFAULT_COLOR,
5
+ } from '../../constants/colors'
3
6
  import { MaterialsProps } from './interfaces'
4
7
  import { MaterialsStyled } from './styles'
5
8
 
@@ -8,6 +11,8 @@ const Materials: React.FC<MaterialsProps> = ({
8
11
  extraBenefits,
9
12
  limit,
10
13
  backgroundColor,
14
+ textColor,
15
+ linkColor,
11
16
  }) => {
12
17
  const [showAll, showAllSetter] = useState(false)
13
18
 
@@ -25,7 +30,11 @@ const Materials: React.FC<MaterialsProps> = ({
25
30
  const parts = benefit.split('||')
26
31
 
27
32
  if (parts.length === 2) {
28
- content = <a href={parts[1]}>{parts[0]}</a>
33
+ content = (
34
+ <a style={{ color: linkColor }} href={parts[1]}>
35
+ {parts[0]}
36
+ </a>
37
+ )
29
38
  } else {
30
39
  content = benefit
31
40
  }
@@ -51,7 +60,7 @@ const Materials: React.FC<MaterialsProps> = ({
51
60
  )
52
61
  }
53
62
  },
54
- []
63
+ [linkColor]
55
64
  )
56
65
 
57
66
  const showAllOnClick = useCallback(() => {
@@ -86,7 +95,10 @@ const Materials: React.FC<MaterialsProps> = ({
86
95
 
87
96
  return (
88
97
  <MaterialsStyled
89
- style={{ backgroundColor: backgroundColor ?? INFO_BG_DEFAULT_COLOR }}
98
+ style={{
99
+ backgroundColor: backgroundColor ?? CONTENT_BG_DEFAULT_COLOR,
100
+ color: textColor ?? CONTENT_TEXT_DEFAULT_COLOR,
101
+ }}
90
102
  variant="white"
91
103
  >
92
104
  <ol>{materials.map(renderBenefit)}</ol>
@@ -94,7 +106,14 @@ const Materials: React.FC<MaterialsProps> = ({
94
106
  {showAllButton}
95
107
  </MaterialsStyled>
96
108
  )
97
- }, [materials, renderBenefit, showAllButton, backgroundColor])
109
+ }, [
110
+ materials,
111
+ renderBenefit,
112
+ showAllButton,
113
+ backgroundColor,
114
+ textColor,
115
+ linkColor,
116
+ ])
98
117
  }
99
118
 
100
119
  export default Materials
@@ -3,4 +3,6 @@ export type MaterialsProps = {
3
3
  extraBenefits: string[]
4
4
  limit: number
5
5
  backgroundColor?: string
6
+ textColor?: string
7
+ linkColor?: string
6
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,7 +34,11 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
29
34
  fieldsValueSelected,
30
35
  orderLink,
31
36
  course,
32
- backgroundColor,
37
+ buttonBgColor,
38
+ buttonTextColor,
39
+ containerBgColor,
40
+ dateTextColor,
41
+ selectedDateTextColor,
33
42
  }) => {
34
43
  useEffect(() => {
35
44
  dateIndexSetter(0)
@@ -120,11 +129,22 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
120
129
  <OrderButtonByDateSalesStyled
121
130
  key="OrderButtonByDateSalesStyled"
122
131
  variant="white"
132
+ bgColor={containerBgColor}
123
133
  >
124
134
  {changeByTimeItemsNew.map((item, idx) => (
125
135
  <span
126
136
  key={idx}
127
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
+ }}
128
148
  data-idx={idx}
129
149
  onClick={onClickDateIndex}
130
150
  >
@@ -178,7 +198,12 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
178
198
  const freeLabel = formatFreeLabel(course)
179
199
 
180
200
  content.push(
181
- <Container key="buy" variant="white" className="buy">
201
+ <Container
202
+ bgColor={containerBgColor}
203
+ key="buy"
204
+ variant="white"
205
+ className="buy"
206
+ >
182
207
  {oldPrice && oldPrice > price ? (
183
208
  <OldPrice
184
209
  prefix={currencyPrefix}
@@ -196,7 +221,8 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
196
221
  <div className="buy">
197
222
  <a href={uri.toString()} className="buy-link">
198
223
  <Button
199
- backgroundColor={backgroundColor}
224
+ style={{color: buttonTextColor}}
225
+ backgroundColor={buttonBgColor}
200
226
  disabled={
201
227
  Boolean(currStartDate) && moment(currStartDate) > moment()
202
228
  }
@@ -232,6 +258,10 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
232
258
  catalogItem.master?.currency,
233
259
  dateIndex,
234
260
  onClickDateIndex,
235
- backgroundColor
261
+ buttonBgColor,
262
+ buttonTextColor,
263
+ containerBgColor,
264
+ dateTextColor,
265
+ selectedDateTextColor,
236
266
  ])
237
267
  }
@@ -1,11 +1,10 @@
1
1
  import { CourseFragment } from '../../interfaces/CourseFragment'
2
2
  import {
3
3
  CatalogFieldValue,
4
- OrderCatalogItemFragment,
4
+ OrderCatalogItemFragment
5
5
  } from '../../modules/gql/generated/types'
6
6
 
7
7
  export type OrderButtonProps = {
8
-
9
8
  /**
10
9
  * Выбранные элементы, которые войдут в заказ
11
10
  */
@@ -13,5 +12,9 @@ export type OrderButtonProps = {
13
12
  catalogItem: OrderCatalogItemFragment
14
13
  course: CourseFragment
15
14
  orderLink: string
16
- backgroundColor?: string
15
+ buttonBgColor?: string
16
+ buttonTextColor?: string
17
+ containerBgColor?: string
18
+ dateTextColor?: string
19
+ selectedDateTextColor?: string
17
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
  }