tee3apps-cms-sdk-react 0.0.34 → 0.0.36
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/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/rollup.config-1772797822233.cjs +48 -0
- package/src/Page.tsx +89 -69
- package/src/PageComponents/RowComponent.tsx +4 -2
- package/src/PageComponents/Visual-Components/GroupProductComponent.tsx +22 -15
- package/src/PageComponents/Visual-Components/RichTextComponent.tsx +12 -4
- package/src/PageComponents/Visual-Components/Styles/ProductListViewOne.tsx +9 -9
- package/src/PageComponents/Visual-Components/Styles/ProductListViewTwo.tsx +14 -12
- package/src/PageComponents/Visual-Components/TabComponent.tsx +1541 -1529
package/package.json
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var resolve = require('@rollup/plugin-node-resolve');
|
|
6
|
+
var commonjs = require('@rollup/plugin-commonjs');
|
|
7
|
+
var typescript = require('@rollup/plugin-typescript');
|
|
8
|
+
var dts = require('rollup-plugin-dts');
|
|
9
|
+
var terser = require('@rollup/plugin-terser');
|
|
10
|
+
var peerDepsExternal = require('rollup-plugin-peer-deps-external');
|
|
11
|
+
var postcss = require('rollup-plugin-postcss');
|
|
12
|
+
|
|
13
|
+
const packageJson = require("./package.json");
|
|
14
|
+
|
|
15
|
+
var rollup_config = [
|
|
16
|
+
{
|
|
17
|
+
input: "src/index.ts",
|
|
18
|
+
output: [
|
|
19
|
+
{
|
|
20
|
+
file: packageJson.main,
|
|
21
|
+
format: "cjs",
|
|
22
|
+
sourcemap: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
file: packageJson.module,
|
|
26
|
+
format: "esm",
|
|
27
|
+
sourcemap: true,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
plugins: [
|
|
31
|
+
peerDepsExternal(),
|
|
32
|
+
resolve(),
|
|
33
|
+
commonjs(),
|
|
34
|
+
typescript({ tsconfig: "./tsconfig.json" }),
|
|
35
|
+
terser(),
|
|
36
|
+
postcss(),
|
|
37
|
+
],
|
|
38
|
+
external: ["react", "react-dom"],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
input: "src/index.ts",
|
|
42
|
+
output: [{ file: packageJson.types }],
|
|
43
|
+
plugins: [dts.default()],
|
|
44
|
+
external: [/\.css$/],
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
exports.default = rollup_config;
|
package/src/Page.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import GroupProductComponent, { GroupProductComponentProps } from './PageCompone
|
|
|
8
8
|
import VideoComponent, { VideoComponentProps } from './PageComponents/Visual-Components/VideoComponent';
|
|
9
9
|
import GroupBrandComponent, { GroupBrandComponentProps } from './PageComponents/Visual-Components/GroupBrandComponent';
|
|
10
10
|
import LottieComponent, { LottieComponentProps } from './PageComponents/Visual-Components/LottieComponent';
|
|
11
|
-
import {
|
|
11
|
+
import { ImageComponentProps, LinkProps, TextProps } from './common.interface';
|
|
12
12
|
import CarouselComponent, { CarouselProps } from './PageComponents/Visual-Components/CarouselComponent';
|
|
13
13
|
import NavigationComponent, { NavigationProps } from './PageComponents/Visual-Components/NavigationComponent';
|
|
14
14
|
import './index.css'
|
|
@@ -18,9 +18,9 @@ import GroupImageList, { GroupImageListProps } from './PageComponents/Visual-Com
|
|
|
18
18
|
import TabComponent, { TabComponentProps } from './PageComponents/Visual-Components/TabComponent';
|
|
19
19
|
import ErrorBoundary from './ErrorBoundary';
|
|
20
20
|
import RichTextComponent, { RichTextComponentProps } from './PageComponents/Visual-Components/RichTextComponent';
|
|
21
|
-
const Page = ({data}:any) => {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const Page = ({ data, showsp = true, showdiscount = true }: any) => {
|
|
22
|
+
const [deviceMode, setDeviceMode] = useState<string>('web');
|
|
23
|
+
const [screenSize, setScreenSize] = useState({
|
|
24
24
|
width: 0,
|
|
25
25
|
height: 0
|
|
26
26
|
});
|
|
@@ -53,73 +53,93 @@ const Page = ({data}:any) => {
|
|
|
53
53
|
return (
|
|
54
54
|
<>
|
|
55
55
|
<div className=''>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<ErrorBoundary>
|
|
59
|
-
{data.map((row: { props: any; columns: any[]; }, rowIndex: React.Key | null | undefined) => (
|
|
60
|
-
<RowComponent key={rowIndex} props={row.props} deviceMode={deviceMode}>
|
|
61
|
-
{row.columns.map((box, boxIndex) => (
|
|
62
|
-
<BoxComponent
|
|
63
|
-
key={boxIndex}
|
|
64
|
-
props={box.props}
|
|
65
|
-
deviceMode={deviceMode}
|
|
66
|
-
autoAdjustForImages={false}
|
|
67
|
-
>
|
|
68
|
-
{box.components.map((component: { name: string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined; props: TextProps | LinkProps | ImageComponentProps | GroupProductComponentProps | VideoComponentProps | GroupBrandComponentProps | LottieComponentProps | CarouselProps | NavigationProps | GroupVideoListProps | GroupCategoryComponentProps | GroupImageListProps | TabComponentProps | RichTextComponentProps; }, compIndex: React.Key | null | undefined) => {
|
|
69
|
-
const getCurrentBoxHeight = () => {
|
|
70
|
-
const validModes = ['web', 'mobileweb', 'mobileapp', 'tablet'] as const;
|
|
71
|
-
const safeDeviceMode = validModes.includes(deviceMode as any)
|
|
72
|
-
? deviceMode as keyof typeof box.props.mode
|
|
73
|
-
: 'web';
|
|
74
|
-
if(component.name==='ImageComponent') return 'auto' // add this line
|
|
75
|
-
return box.props.mode[safeDeviceMode]?.height || 'auto';
|
|
76
|
-
};
|
|
56
|
+
<div className=''>
|
|
77
57
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
58
|
+
<ErrorBoundary>
|
|
59
|
+
{data.map((row: { props: any; columns: any[]; }, rowIndex: React.Key | null | undefined) => (
|
|
60
|
+
<RowComponent key={rowIndex} props={row.props} deviceMode={deviceMode}>
|
|
61
|
+
{row.columns.map((box, boxIndex) => (
|
|
62
|
+
<BoxComponent
|
|
63
|
+
key={boxIndex}
|
|
64
|
+
props={box.props}
|
|
65
|
+
deviceMode={deviceMode}
|
|
66
|
+
autoAdjustForImages={false}
|
|
67
|
+
>
|
|
68
|
+
{box.components.map((component: { name: string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined; props: TextProps | LinkProps | ImageComponentProps | GroupProductComponentProps | VideoComponentProps | GroupBrandComponentProps | LottieComponentProps | CarouselProps | NavigationProps | GroupVideoListProps | GroupCategoryComponentProps | GroupImageListProps | TabComponentProps | RichTextComponentProps; }, compIndex: React.Key | null | undefined) => {
|
|
69
|
+
const getCurrentBoxHeight = () => {
|
|
70
|
+
const validModes = ['web', 'mobileweb', 'mobileapp', 'tablet'] as const;
|
|
71
|
+
const safeDeviceMode = validModes.includes(deviceMode as any)
|
|
72
|
+
? deviceMode as keyof typeof box.props.mode
|
|
73
|
+
: 'web';
|
|
74
|
+
if (component.name === 'ImageComponent') return 'auto' // add this line
|
|
75
|
+
return box.props.mode[safeDeviceMode]?.height || 'auto';
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
try {
|
|
79
|
+
switch (component.name) {
|
|
80
|
+
case 'TextComponent':
|
|
81
|
+
return <TextComponent key={compIndex} props={component.props as TextProps} />;
|
|
82
|
+
case 'LinkComponent':
|
|
83
|
+
return <LinkComponent key={compIndex} props={component.props as LinkProps} />;
|
|
84
|
+
case 'ImageComponent':
|
|
85
|
+
return <ImageComponent key={compIndex} props={component.props as ImageComponentProps} deviceMode={deviceMode} boxHeight={getCurrentBoxHeight()} />;
|
|
86
|
+
case 'GroupProductComponent':
|
|
87
|
+
{
|
|
88
|
+
const gpProps = component.props as GroupProductComponentProps;
|
|
89
|
+
return <GroupProductComponent
|
|
90
|
+
key={compIndex}
|
|
91
|
+
props={{
|
|
92
|
+
...gpProps,
|
|
93
|
+
showsp: gpProps.showsp ?? showsp,
|
|
94
|
+
showdiscount: gpProps.showdiscount ?? showdiscount
|
|
95
|
+
}}
|
|
96
|
+
deviceMode={deviceMode} />;
|
|
97
|
+
}
|
|
98
|
+
case 'VideoComponent':
|
|
99
|
+
return <VideoComponent key={compIndex} props={component.props as VideoComponentProps} deviceMode={deviceMode} boxHeight={getCurrentBoxHeight()} />;
|
|
100
|
+
case 'GroupBrandComponent':
|
|
101
|
+
return <GroupBrandComponent key={compIndex} props={component.props as GroupBrandComponentProps} deviceMode={deviceMode} />;
|
|
102
|
+
case 'LottieComponent':
|
|
103
|
+
return <LottieComponent key={compIndex} props={component.props as LottieComponentProps} />;
|
|
104
|
+
case 'CarouselComponent':
|
|
105
|
+
return <CarouselComponent key={compIndex} props={component.props as CarouselProps} deviceMode={deviceMode} />;
|
|
106
|
+
case 'NavigationComponent':
|
|
107
|
+
return <NavigationComponent key={compIndex} props={component.props as NavigationProps} boxHeight={getCurrentBoxHeight()} />;
|
|
108
|
+
case 'GroupVideoComponent':
|
|
109
|
+
return <GroupVideoList key={compIndex} props={component.props as GroupVideoListProps} boxHeight={getCurrentBoxHeight()} />;
|
|
110
|
+
case 'GroupCategoryComponent':
|
|
111
|
+
return <GroupCategoryComponent key={compIndex} props={component.props as GroupCategoryComponentProps} deviceMode={deviceMode} />;
|
|
112
|
+
case 'GroupImageComponent':
|
|
113
|
+
return <GroupImageList key={compIndex} props={component.props as GroupImageListProps} deviceMode={deviceMode} />;
|
|
114
|
+
case 'TabComponent':
|
|
115
|
+
{
|
|
116
|
+
const tabProps = component.props as TabComponentProps;
|
|
117
|
+
return <TabComponent
|
|
118
|
+
key={compIndex}
|
|
119
|
+
props={{
|
|
120
|
+
...tabProps,
|
|
121
|
+
showsp: tabProps.showsp ?? showsp,
|
|
122
|
+
showdiscount: tabProps.showdiscount ?? showdiscount
|
|
123
|
+
}}
|
|
124
|
+
deviceMode={deviceMode} />;
|
|
125
|
+
}
|
|
126
|
+
case 'RichTextBoxComponent':
|
|
127
|
+
return <RichTextComponent key={compIndex} props={component.props as RichTextComponentProps} deviceMode={deviceMode} />;
|
|
128
|
+
default:
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
} catch (err) {
|
|
132
|
+
console.error(`Error rendering component: ${component.name}`, err);
|
|
133
|
+
return <div key={compIndex} style={{ color: 'red' }}>Failed to load component: {component.name}</div>;
|
|
134
|
+
}
|
|
135
|
+
})}
|
|
136
|
+
</BoxComponent>
|
|
137
|
+
))}
|
|
138
|
+
</RowComponent>
|
|
139
|
+
))}
|
|
140
|
+
</ErrorBoundary>
|
|
122
141
|
</div>
|
|
142
|
+
</div>
|
|
123
143
|
</>
|
|
124
144
|
)
|
|
125
145
|
}
|
|
@@ -30,6 +30,7 @@ interface RowProps {
|
|
|
30
30
|
nowrap: boolean;
|
|
31
31
|
bgsize: React.CSSProperties['backgroundSize'];
|
|
32
32
|
mode: DeviceModes;
|
|
33
|
+
idname:string;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
interface RowComponentProps {
|
|
@@ -132,7 +133,8 @@ const getJustifyContent = (): React.CSSProperties['justifyContent'] => {
|
|
|
132
133
|
};
|
|
133
134
|
|
|
134
135
|
return (
|
|
135
|
-
<
|
|
136
|
+
<section
|
|
137
|
+
id={props.idname}
|
|
136
138
|
style={{
|
|
137
139
|
minHeight: getRowMinHeight(),
|
|
138
140
|
backgroundColor: props.bgColor,
|
|
@@ -159,7 +161,7 @@ const getJustifyContent = (): React.CSSProperties['justifyContent'] => {
|
|
|
159
161
|
}}
|
|
160
162
|
>
|
|
161
163
|
{children}
|
|
162
|
-
</
|
|
164
|
+
</section>
|
|
163
165
|
);
|
|
164
166
|
};
|
|
165
167
|
|
|
@@ -151,6 +151,8 @@ export interface GroupProductComponentProps {
|
|
|
151
151
|
isHorizontalScroll: DeviceBooleanProps;
|
|
152
152
|
headerBackground: string;
|
|
153
153
|
viewAllLink?: string;
|
|
154
|
+
showsp?: boolean;
|
|
155
|
+
showdiscount?: boolean;
|
|
154
156
|
}
|
|
155
157
|
|
|
156
158
|
interface GroupProductComponentMainProps {
|
|
@@ -209,13 +211,13 @@ const GroupProductComponent: React.FC<GroupProductComponentMainProps> = ({
|
|
|
209
211
|
if (currentstyle === 'STYLE1') {
|
|
210
212
|
return (
|
|
211
213
|
<div key={key}>
|
|
212
|
-
<ProductListViewOne props={product} cardColor={props.cardColor} layout={currentLayout} />
|
|
214
|
+
<ProductListViewOne props={product} cardColor={props.cardColor} layout={currentLayout} showsp={props.showsp} showdiscount={props.showdiscount} />
|
|
213
215
|
</div>
|
|
214
216
|
);
|
|
215
217
|
} else if (currentstyle === 'STYLE2') {
|
|
216
218
|
return (
|
|
217
219
|
<div key={key}>
|
|
218
|
-
<ProductListViewTwo props={product} cardColor={props.cardColor} layout={currentLayout} />
|
|
220
|
+
<ProductListViewTwo props={product} cardColor={props.cardColor} layout={currentLayout} showsp={props.showsp} showdiscount={props.showdiscount} />
|
|
219
221
|
</div>
|
|
220
222
|
);
|
|
221
223
|
} else {
|
|
@@ -313,16 +315,16 @@ const GroupProductComponent: React.FC<GroupProductComponentMainProps> = ({
|
|
|
313
315
|
|
|
314
316
|
{(() => {
|
|
315
317
|
const prices = getProductPrices(product);
|
|
316
|
-
return prices.sellingPrice > 0 ? (
|
|
318
|
+
return props.showsp !== false && prices.sellingPrice > 0 ? (
|
|
317
319
|
<div style={{ marginTop: '8px', textAlign: 'center' }}>
|
|
318
|
-
<p style={{ fontSize: '14px', fontWeight: '700', color: '#333', margin: 0 }}>
|
|
319
|
-
SP: {prices.sellingPrice.toLocaleString("en-IN")}
|
|
320
|
+
<p style={{ fontSize: '14px', fontWeight: '700', color: '#333', margin: 0, display: 'flex', alignItems: 'center', gap: '4px', flexWrap: 'wrap', justifyContent: 'center' }}>
|
|
321
|
+
<span>SP: {prices.sellingPrice.toLocaleString("en-IN")} (incl of all tax)</span>
|
|
322
|
+
{props.showdiscount !== false && prices.mrp > prices.sellingPrice && (
|
|
323
|
+
<span style={{ fontSize: '11px', color: '#666', textDecoration: 'line-through', fontWeight: 'normal' }}>
|
|
324
|
+
MRP: {prices.mrp.toLocaleString("en-IN")}
|
|
325
|
+
</span>
|
|
326
|
+
)}
|
|
320
327
|
</p>
|
|
321
|
-
{prices.mrp > prices.sellingPrice && (
|
|
322
|
-
<p style={{ fontSize: '11px', color: '#666', textDecoration: 'line-through', margin: '1px 0' }}>
|
|
323
|
-
MRP: {prices.mrp.toLocaleString("en-IN")}
|
|
324
|
-
</p>
|
|
325
|
-
)}
|
|
326
328
|
</div>
|
|
327
329
|
) : null;
|
|
328
330
|
})()}
|
|
@@ -337,13 +339,13 @@ const GroupProductComponent: React.FC<GroupProductComponentMainProps> = ({
|
|
|
337
339
|
if (currentstyle === 'STYLE1') {
|
|
338
340
|
return (
|
|
339
341
|
<div key={key}>
|
|
340
|
-
<ProductListViewOne props={product} cardColor={props.cardColor} layout={currentLayout} />
|
|
342
|
+
<ProductListViewOne props={product} cardColor={props.cardColor} layout={currentLayout} showsp={props.showsp} showdiscount={props.showdiscount} />
|
|
341
343
|
</div>
|
|
342
344
|
);
|
|
343
345
|
} else if (currentstyle === 'STYLE2') {
|
|
344
346
|
return (
|
|
345
347
|
<div key={key}>
|
|
346
|
-
<ProductListViewTwo props={product} cardColor={props.cardColor} layout={currentLayout} />
|
|
348
|
+
<ProductListViewTwo props={product} cardColor={props.cardColor} layout={currentLayout} showsp={props.showsp} showdiscount={props.showdiscount} />
|
|
347
349
|
</div>
|
|
348
350
|
);
|
|
349
351
|
} else {
|
|
@@ -439,10 +441,15 @@ const GroupProductComponent: React.FC<GroupProductComponentMainProps> = ({
|
|
|
439
441
|
|
|
440
442
|
{(() => {
|
|
441
443
|
const prices = getProductPrices(product);
|
|
442
|
-
return prices.sellingPrice > 0 ? (
|
|
444
|
+
return props.showsp !== false && prices.sellingPrice > 0 ? (
|
|
443
445
|
<div style={{ marginTop: '5px', textAlign: 'center' }}>
|
|
444
|
-
<p style={{ fontSize: '13px', fontWeight: '700', color: '#333', margin: 0 }}>
|
|
445
|
-
SP: {prices.sellingPrice.toLocaleString("en-IN")}
|
|
446
|
+
<p style={{ fontSize: '13px', fontWeight: '700', color: '#333', margin: 0, display: 'flex', alignItems: 'center', gap: '3px', flexWrap: 'wrap', justifyContent: 'center' }}>
|
|
447
|
+
<span>SP: {prices.sellingPrice.toLocaleString("en-IN")} (incl of all tax)</span>
|
|
448
|
+
{props.showdiscount !== false && prices.mrp > prices.sellingPrice && (
|
|
449
|
+
<span style={{ fontSize: '11px', color: '#666', textDecoration: 'line-through', fontWeight: 'normal' }}>
|
|
450
|
+
MRP: {prices.mrp.toLocaleString("en-IN")}
|
|
451
|
+
</span>
|
|
452
|
+
)}
|
|
446
453
|
</p>
|
|
447
454
|
</div>
|
|
448
455
|
) : null;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
export interface RichTextComponentProps {
|
|
4
|
-
content
|
|
5
|
-
all
|
|
4
|
+
content?: {
|
|
5
|
+
all?: string;
|
|
6
|
+
} | string;
|
|
7
|
+
mode?: {
|
|
8
|
+
[key: string]: {
|
|
9
|
+
content: string;
|
|
10
|
+
};
|
|
6
11
|
};
|
|
7
12
|
}
|
|
8
13
|
|
|
9
|
-
const RichTextComponent: React.FC<{ props: RichTextComponentProps }> = ({ props }) => {
|
|
10
|
-
const
|
|
14
|
+
const RichTextComponent: React.FC<{ props: RichTextComponentProps; deviceMode?: string }> = ({ props, deviceMode = 'web' }) => {
|
|
15
|
+
const modeData = props?.mode?.[deviceMode] as { content?: string } | undefined;
|
|
16
|
+
const contentAll = typeof props?.content === 'string' ? props?.content : props?.content?.all;
|
|
17
|
+
|
|
18
|
+
const htmlContent = modeData?.content || contentAll || '';
|
|
11
19
|
|
|
12
20
|
return (
|
|
13
21
|
<div
|
|
@@ -157,17 +157,17 @@ const ProductListViewOne = (props: any) => {
|
|
|
157
157
|
<h5 style={{ margin: 0, fontWeight: '400', color: '#666' }}>{variantOptions}</h5>
|
|
158
158
|
</div>
|
|
159
159
|
<div className="card_value" style={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
|
|
160
|
-
{finalSellingPrice !== 0 && (
|
|
160
|
+
{props.showsp !== false && finalSellingPrice !== 0 && (
|
|
161
161
|
<div className="card_price" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
|
|
162
|
-
<h4 style={{ margin: 0, fontSize: '
|
|
163
|
-
|
|
164
|
-
{mrpPrice > finalSellingPrice && (
|
|
165
|
-
<
|
|
162
|
+
<h4 style={{ margin: 0, fontSize: '15px', fontWeight: '700', display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'wrap', justifyContent: 'center' }}>
|
|
163
|
+
<span>SP: {finalSellingPrice.toLocaleString("en-IN")} (incl of all tax)</span>
|
|
164
|
+
{props.showdiscount !== false && mrpPrice > finalSellingPrice && (
|
|
165
|
+
<span style={{ fontSize: '12px', color: '#666', textDecoration: 'line-through', fontWeight: 'normal' }}>MRP: {mrpPrice.toLocaleString("en-IN")}</span>
|
|
166
166
|
)}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
)
|
|
170
|
-
|
|
167
|
+
</h4>
|
|
168
|
+
{props.showdiscount !== false && mrpPrice > finalSellingPrice && discount !== null && discount > 0 && (
|
|
169
|
+
<span style={{ fontSize: '11px', color: '#555a56ff', fontWeight: 'bold' }}>({discount}% OFF)</span>
|
|
170
|
+
)}
|
|
171
171
|
</div>
|
|
172
172
|
)}
|
|
173
173
|
</div>
|
|
@@ -159,22 +159,24 @@ const ProductListViewTwo = (props: any) => {
|
|
|
159
159
|
</div>
|
|
160
160
|
<div className="card_bottom" style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', width: '100%' }}>
|
|
161
161
|
<div className="price_container">
|
|
162
|
-
{finalSellingPrice !== 0 && (
|
|
162
|
+
{props.showsp !== false && finalSellingPrice !== 0 && (
|
|
163
163
|
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center' }}>
|
|
164
164
|
<div className="price_row" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
|
|
165
|
-
<h4 className="selling_price" style={{ margin: 0
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
MRP: {mrpPrice.toLocaleString("en-IN")}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
{
|
|
172
|
-
<
|
|
165
|
+
<h4 className="selling_price" style={{ margin: 0, fontSize: '15px', fontWeight: '700', display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'wrap', justifyContent: 'center' }}>
|
|
166
|
+
<span>SP: {finalSellingPrice.toLocaleString("en-IN")} (incl of all tax)</span>
|
|
167
|
+
{props.showdiscount !== false && mrpPrice > finalSellingPrice && (
|
|
168
|
+
<span style={{ fontSize: '12px', color: '#666', textDecoration: 'line-through', fontWeight: 'normal' }}>MRP: {mrpPrice.toLocaleString("en-IN")}</span>
|
|
169
|
+
)}
|
|
170
|
+
</h4>
|
|
171
|
+
{props.showdiscount !== false && mrpPrice > finalSellingPrice && (
|
|
172
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '4px', marginTop: '2px' }}>
|
|
173
|
+
{discount !== null && discount > 0 && (
|
|
174
|
+
<span className="discounts" style={{ fontSize: '11px', color: '#28a745', fontWeight: 'bold' }}>{discount}% OFF</span>
|
|
175
|
+
)}
|
|
176
|
+
<p className="save_amount" style={{ margin: 0, fontSize: '11px', fontWeight: '500' }}>Save {(mrpPrice - finalSellingPrice).toLocaleString("en-IN")}</p>
|
|
177
|
+
</div>
|
|
173
178
|
)}
|
|
174
179
|
</div>
|
|
175
|
-
{mrpPrice > finalSellingPrice && (
|
|
176
|
-
<p className="save_amount" style={{ margin: '2px 0 0 0', fontSize: '11px', fontWeight: '500' }}>Save {(mrpPrice - finalSellingPrice).toLocaleString("en-IN")}</p>
|
|
177
|
-
)}
|
|
178
180
|
</div>
|
|
179
181
|
)}
|
|
180
182
|
</div>
|