@procraft/widget-order 2.26.0 → 2.27.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.
- package/dist/CourseItem/OrderButton/index.js +4 -2
- package/dist/CourseItem/OrderButton/index.js.map +1 -1
- package/dist/CourseItem/index.js +6 -2
- package/dist/CourseItem/index.js.map +1 -1
- package/dist/components/OldPrice/index.js +3 -4
- package/dist/components/OldPrice/index.js.map +1 -1
- package/dist/components/OldPrice/interfaces.d.ts +2 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/CourseItem/OrderButton/index.tsx +6 -3
- package/src/CourseItem/index.tsx +5 -2
- package/src/components/OldPrice/index.tsx +3 -2
- package/src/components/OldPrice/interfaces.ts +2 -0
package/package.json
CHANGED
|
@@ -244,9 +244,12 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
|
|
|
244
244
|
break
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
+
const currencyPrefix = getCurrencyPrefix(catalogItem.master?.currency || '')
|
|
248
|
+
const currencySuffix = getCurrencySuffix(catalogItem.master?.currency || '')
|
|
249
|
+
|
|
247
250
|
content.push(
|
|
248
251
|
<Container key="buy" variant="white" className="buy">
|
|
249
|
-
{oldPrice && oldPrice > price ? <OldPrice price={oldPrice} /> : null}
|
|
252
|
+
{oldPrice && oldPrice > price ? <OldPrice prefix={currencyPrefix} suffix={currencySuffix} price={oldPrice} /> : null}
|
|
250
253
|
|
|
251
254
|
{!price ? (
|
|
252
255
|
<Typography className="free" component="span">
|
|
@@ -268,8 +271,8 @@ export const OrderButton: React.FC<OrderButtonProps> = ({
|
|
|
268
271
|
value={price}
|
|
269
272
|
displayType="text"
|
|
270
273
|
thousandSeparator={' '}
|
|
271
|
-
prefix={
|
|
272
|
-
suffix={
|
|
274
|
+
prefix={currencyPrefix}
|
|
275
|
+
suffix={currencySuffix}
|
|
273
276
|
/>
|
|
274
277
|
</>
|
|
275
278
|
) : (
|
package/src/CourseItem/index.tsx
CHANGED
|
@@ -38,10 +38,13 @@ const CourseItem: React.FC<CourseItemComponentProps> = (props) => {
|
|
|
38
38
|
|
|
39
39
|
const {extraBenefits} = useMemo(() => {
|
|
40
40
|
const flowId = fieldsValueSelected.filter(x => x.fieldId === -1808).map(fv => +fv.uid.substr(6))[0]
|
|
41
|
-
const
|
|
41
|
+
const tariffId = item.course?.tariffId
|
|
42
|
+
|
|
43
|
+
const extraBenefits = (course.tariffPerFlowDataItems || [])
|
|
44
|
+
.filter(x => x.flowId === flowId && (!tariffId || x.courseTariffId === tariffId))
|
|
42
45
|
.map(pfdi => pfdi.marketingBenefitsComputed)[0] || []
|
|
43
46
|
return {extraBenefits}
|
|
44
|
-
}, [fieldsValueSelected, course.tariffPerFlowDataItems])
|
|
47
|
+
}, [fieldsValueSelected, course.tariffPerFlowDataItems, item.course?.tariffId])
|
|
45
48
|
|
|
46
49
|
|
|
47
50
|
// console.log('useEffect fieldsValueSelected', [...fieldsValueSelected]);
|
|
@@ -3,7 +3,7 @@ import NumberFormat from 'react-number-format'
|
|
|
3
3
|
import { OldPriceProps } from './interfaces'
|
|
4
4
|
import { OldPriceStyled } from './styles'
|
|
5
5
|
|
|
6
|
-
const OldPrice: React.FC<OldPriceProps> = ({ price, ...other }) => {
|
|
6
|
+
const OldPrice: React.FC<OldPriceProps> = ({ price, prefix, suffix, ...other }) => {
|
|
7
7
|
return (
|
|
8
8
|
<OldPriceStyled component="span" {...other}>
|
|
9
9
|
<NumberFormat
|
|
@@ -11,8 +11,9 @@ const OldPrice: React.FC<OldPriceProps> = ({ price, ...other }) => {
|
|
|
11
11
|
displayType={'text'}
|
|
12
12
|
thousandSeparator={' '}
|
|
13
13
|
decimalScale={0}
|
|
14
|
+
prefix={prefix}
|
|
15
|
+
suffix={suffix}
|
|
14
16
|
/>{' '}
|
|
15
|
-
₽
|
|
16
17
|
</OldPriceStyled>
|
|
17
18
|
)
|
|
18
19
|
}
|