@riosst100/pwa-marketplace 1.4.6 → 1.4.8
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/i18n/en_US.json +509 -509
- package/i18n/id_ID.json +29 -29
- package/package.json +1 -1
- package/src/componentOverrideMapping.js +3 -0
- package/src/components/BrandLandingPage/brandInfo.js +93 -0
- package/src/components/BrandLandingPage/brandLanding.js +255 -0
- package/src/components/BrandLandingPage/index.js +94 -0
- package/src/components/BrandLandingPage/menu.js +20 -0
- package/src/components/BrandListPage/banner_brands.png +0 -0
- package/src/components/BrandListPage/brandList.js +88 -0
- package/src/components/BrandListPage/index.js +57 -0
- package/src/components/BrandSlider/brandSlider.js +2 -2
- package/src/components/BrandSlider/item.js +24 -6
- package/src/components/CollectibleGameSets/collectibleGameSets.js +2 -1
- package/src/components/FilterTop/CustomFilters/customFilters.js +9 -7
- package/src/components/FilterTop/filterTop.js +2 -128
- package/src/components/Modal/index.js +10 -0
- package/src/components/Modal/modal.js +48 -0
- package/src/components/ProductLineSlider/index.js +1 -0
- package/src/components/ProductLineSlider/item.js +38 -0
- package/src/components/ProductLineSlider/logo_nendoroid.png +0 -0
- package/src/components/ProductLineSlider/nendroid-image.png +0 -0
- package/src/components/ProductLineSlider/productLineSlider.js +91 -0
- package/src/components/SocialMediaShare/index.js +51 -0
- package/src/components/SocialMediaShare/share.js +94 -0
- package/src/intercept.js +41 -27
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilter.js +1 -1
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilter.module.css +5 -4
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.module.css +3 -1
- package/src/overwrites/venia-ui/lib/components/Footer/footer.js +147 -0
- package/src/overwrites/venia-ui/lib/components/Footer/footer.module.css +70 -0
- package/src/overwrites/venia-ui/lib/components/Footer/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Footer/sampleData.js +48 -0
- package/src/overwrites/venia-ui/lib/components/Gallery/gallery.module.css +1 -1
- package/src/overwrites/venia-ui/lib/components/Main/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Main/main.js +39 -0
- package/src/overwrites/venia-ui/lib/components/Main/main.module.css +41 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.js +14 -4
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.module.css +2 -2
- package/src/overwrites/venia-ui/lib/components/Newsletter/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.js +156 -0
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.module.css +90 -0
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.shimmer.js +46 -0
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.shimmer.module.css +21 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +23 -12
- package/src/overwrites/venia-ui/lib/components/TextInput/textInput.js +9 -1
- package/src/theme/vars.js +2 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import Content from './brandList';
|
|
3
|
+
|
|
4
|
+
const index = () => {
|
|
5
|
+
|
|
6
|
+
const [active, setActive] = useState('all')
|
|
7
|
+
const letters = Array.from({ length: 26 }, (_, i) => String.fromCharCode(i + 65));
|
|
8
|
+
|
|
9
|
+
const brands = [
|
|
10
|
+
{ id: 1, name: "Bandai" },
|
|
11
|
+
{ id: 2, name: "Hasbro" },
|
|
12
|
+
{ id: 3, name: "Mattel" },
|
|
13
|
+
{ id: 4, name: "NECA" },
|
|
14
|
+
{ id: 5, name: "Beast Kingdom" },
|
|
15
|
+
{ id: 5, name: "Beast Kingdom" },
|
|
16
|
+
{ id: 5, name: "Beast Kingdom" },
|
|
17
|
+
{ id: 5, name: "Beast Kingdom" },
|
|
18
|
+
{ id: 5, name: "Beast Kingdom" },
|
|
19
|
+
{ id: 5, name: "Beast Kingdom" },
|
|
20
|
+
{ id: 5, name: "Beast Kingdom" },
|
|
21
|
+
{ id: 5, name: "Beast Kingdom" },
|
|
22
|
+
{ id: 5, name: "Beast Kingdom" },
|
|
23
|
+
{ id: 6, name: "McFarlane Toys" },
|
|
24
|
+
{ id: 7, name: "Good Smile Company" },
|
|
25
|
+
{ id: 8, name: "Evolution Toy" },
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const groupBrandsByFirstLetter = (brands) => {
|
|
29
|
+
return brands.reduce((acc, brand) => {
|
|
30
|
+
const firstLetter = brand.name.charAt(0).toUpperCase();
|
|
31
|
+
acc[firstLetter] = acc[firstLetter] || [];
|
|
32
|
+
acc[firstLetter].push(brand);
|
|
33
|
+
return acc;
|
|
34
|
+
}, {});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const groupedBrands = groupBrandsByFirstLetter(brands);
|
|
38
|
+
const availableLetter = Object.keys(groupedBrands).sort();
|
|
39
|
+
|
|
40
|
+
const handleActive = (val) => {
|
|
41
|
+
setActive(val);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const contentProps = {
|
|
45
|
+
letters,
|
|
46
|
+
groupedBrands,
|
|
47
|
+
availableLetter,
|
|
48
|
+
active,
|
|
49
|
+
handleActive,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<Content {...contentProps} />
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default index
|
|
@@ -40,7 +40,7 @@ const brandSlider = (props) => {
|
|
|
40
40
|
{
|
|
41
41
|
breakpoint: 1023,
|
|
42
42
|
settings: {
|
|
43
|
-
slidesToShow:
|
|
43
|
+
slidesToShow: 3,
|
|
44
44
|
slidesToScroll: 1,
|
|
45
45
|
}
|
|
46
46
|
},
|
|
@@ -68,7 +68,7 @@ const brandSlider = (props) => {
|
|
|
68
68
|
<Slider {...settings}>
|
|
69
69
|
{[...Array(9)].map(() => {
|
|
70
70
|
return (
|
|
71
|
-
<Item />
|
|
71
|
+
<Item {...props} />
|
|
72
72
|
)
|
|
73
73
|
})}
|
|
74
74
|
</Slider>
|
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
const Item = () => {
|
|
4
|
+
const Item = (props) => {
|
|
5
|
+
const {
|
|
6
|
+
name = 'Tamashii Nations', rootClassName, onClick = () => { },
|
|
7
|
+
className = "",
|
|
8
|
+
} = props;
|
|
9
|
+
|
|
10
|
+
const initialName = (name) => {
|
|
11
|
+
if (!name) return ""; // Handle empty names
|
|
12
|
+
|
|
13
|
+
const words = name.split(" ");
|
|
14
|
+
let initials = "";
|
|
15
|
+
|
|
16
|
+
for (const word of words) {
|
|
17
|
+
initials += word.charAt(0).toUpperCase();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return initials;
|
|
21
|
+
}
|
|
5
22
|
return (
|
|
6
|
-
<div className='brand-item-container px-2 lg_px-4'>
|
|
23
|
+
<div className={cn('brand-item-container px-2 lg_px-4', rootClassName)} onClick={onClick}>
|
|
7
24
|
<div
|
|
8
25
|
className={cn(
|
|
9
26
|
'm-auto flex flex-col',
|
|
10
27
|
'w-full max-w-[250px]',
|
|
11
|
-
'relative rounded-lg border border-gray-100',
|
|
28
|
+
'relative rounded-lg border border-gray-100 bg-white',
|
|
29
|
+
className,
|
|
12
30
|
)}
|
|
13
31
|
>
|
|
14
32
|
<div className="brand_logo-wrapper w-full min-h-[120px] rounded-t-lg">
|
|
@@ -16,15 +34,15 @@ const Item = () => {
|
|
|
16
34
|
</div>
|
|
17
35
|
<div
|
|
18
36
|
className={cn(
|
|
19
|
-
'bg-darkblue-900 text-white uppercase text-lg font-bold leading-5 absolute',
|
|
37
|
+
'bg-darkblue-900 text-white uppercase text-lg font-bold leading-5 absolute min-w-[60px] text-center',
|
|
20
38
|
'p-5 rounded-md top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2'
|
|
21
39
|
)}
|
|
22
40
|
>
|
|
23
|
-
|
|
41
|
+
{initialName(name)}
|
|
24
42
|
</div>
|
|
25
43
|
<div className='brand_name-wrapper flex items-center justify-center w-full min-h-[110px]'>
|
|
26
44
|
<span className='text-base font-medium'>
|
|
27
|
-
|
|
45
|
+
{name}
|
|
28
46
|
</span>
|
|
29
47
|
</div>
|
|
30
48
|
<style global jsx>
|
|
@@ -40,7 +40,8 @@ const CollectibleGameSets = props => {
|
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<Fragment>
|
|
43
|
-
<StoreTitle>Magic: The Gathering |
|
|
43
|
+
<StoreTitle>Magic: The Gathering | Sets & Expansions</StoreTitle>
|
|
44
|
+
<h3>Sets & Expansions</h3>
|
|
44
45
|
<div>{sets}</div>
|
|
45
46
|
</Fragment>
|
|
46
47
|
);
|
|
@@ -30,7 +30,7 @@ const CustomFilters = props => {
|
|
|
30
30
|
// create elements and params at the same time for efficiency
|
|
31
31
|
const filterElements = useMemo(() => {
|
|
32
32
|
const elements = [];
|
|
33
|
-
customFiltersData.map((filter, index) => {
|
|
33
|
+
customFiltersData && customFiltersData.map((filter, index) => {
|
|
34
34
|
const { label, attribute_code, options } = filter || {};
|
|
35
35
|
|
|
36
36
|
if (options.length) {
|
|
@@ -43,17 +43,19 @@ const CustomFilters = props => {
|
|
|
43
43
|
// );
|
|
44
44
|
// const keyAttr = `${attribute_code}[filter]`;
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
if (params) {
|
|
47
|
+
Object.keys(params).forEach(function(key, index) {
|
|
48
|
+
if (index > 1) {
|
|
49
|
+
delete params[key];
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
51
53
|
|
|
52
54
|
if (value != "all") {
|
|
53
55
|
params[`${attribute_code}[filter]`] = `${label},${value}`;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
const finalParams = Object.keys(params).map(key => `${key}=${params[key]}`).join('&');
|
|
58
|
+
const finalParams = params ? Object.keys(params).map(key => `${key}=${params[key]}`).join('&') : '';
|
|
57
59
|
|
|
58
60
|
// console.log(params)
|
|
59
61
|
|
|
@@ -1,139 +1,13 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { FormattedMessage } from 'react-intl';
|
|
3
|
-
import { array, arrayOf, shape, string, number } from 'prop-types';
|
|
4
|
-
import { useFilterSidebar } from '@magento/peregrine/lib/talons/FilterSidebar';
|
|
5
|
-
|
|
6
|
-
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
-
import LinkButton from '@magento/venia-ui/lib/components/LinkButton';
|
|
1
|
+
import React from 'react';
|
|
8
2
|
import CustomFilters from './CustomFilters';
|
|
9
|
-
import FilterBlock from '@magento/venia-ui/lib/components/FilterModal/filterBlock';
|
|
10
|
-
import defaultClasses from './filterTop.module.css';
|
|
11
|
-
|
|
12
|
-
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
13
|
-
|
|
14
|
-
import { Link } from 'react-router-dom';
|
|
15
|
-
import CurrentFilters from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters';
|
|
16
|
-
|
|
17
|
-
const SCROLL_OFFSET = 150;
|
|
18
3
|
|
|
19
|
-
/**
|
|
20
|
-
* A view that displays applicable and applied filters.
|
|
21
|
-
*
|
|
22
|
-
* @param {Object} props.filters - filters to display
|
|
23
|
-
*/
|
|
24
4
|
const FilterTop = props => {
|
|
25
|
-
const {
|
|
26
|
-
const talonProps = useFilterSidebar({ filters });
|
|
27
|
-
const {
|
|
28
|
-
filterApi,
|
|
29
|
-
filterItems,
|
|
30
|
-
filterNames,
|
|
31
|
-
filterFrontendInput,
|
|
32
|
-
filterState,
|
|
33
|
-
handleApply,
|
|
34
|
-
handleReset
|
|
35
|
-
} = talonProps;
|
|
36
|
-
|
|
37
|
-
const filterRef = useRef();
|
|
38
|
-
const classes = useStyle(defaultClasses, props.classes);
|
|
39
|
-
|
|
40
|
-
const handleApplyFilter = useCallback(
|
|
41
|
-
(...args) => {
|
|
42
|
-
const filterElement = filterRef.current;
|
|
43
|
-
if (
|
|
44
|
-
filterElement &&
|
|
45
|
-
typeof filterElement.getBoundingClientRect === 'function'
|
|
46
|
-
) {
|
|
47
|
-
const filterTop = filterElement.getBoundingClientRect().top;
|
|
48
|
-
const windowScrollY =
|
|
49
|
-
window.scrollY + filterTop - SCROLL_OFFSET;
|
|
50
|
-
window.scrollTo(0, windowScrollY);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
handleApply(...args);
|
|
54
|
-
},
|
|
55
|
-
[handleApply, filterRef]
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
const filtersList = useMemo(
|
|
59
|
-
() =>
|
|
60
|
-
Array.from(filterItems, ([group, items], iteration) => {
|
|
61
|
-
const blockState = filterState.get(group);
|
|
62
|
-
const groupName = filterNames.get(group);
|
|
63
|
-
const frontendInput = filterFrontendInput.get(group);
|
|
64
|
-
return (
|
|
65
|
-
<FilterBlock
|
|
66
|
-
key={group}
|
|
67
|
-
filterApi={filterApi}
|
|
68
|
-
filterState={blockState}
|
|
69
|
-
filterFrontendInput={frontendInput}
|
|
70
|
-
group={group}
|
|
71
|
-
items={items}
|
|
72
|
-
name={groupName}
|
|
73
|
-
onApply={handleApplyFilter}
|
|
74
|
-
initialOpen={iteration < filterCountToOpen}
|
|
75
|
-
/>
|
|
76
|
-
);
|
|
77
|
-
}),
|
|
78
|
-
[
|
|
79
|
-
filterApi,
|
|
80
|
-
filterItems,
|
|
81
|
-
filterNames,
|
|
82
|
-
filterFrontendInput,
|
|
83
|
-
filterState,
|
|
84
|
-
filterCountToOpen,
|
|
85
|
-
handleApplyFilter
|
|
86
|
-
]
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
const clearAll = filterState.size ? (
|
|
90
|
-
<div className={classes.action}>
|
|
91
|
-
<LinkButton
|
|
92
|
-
type="button"
|
|
93
|
-
onClick={handleReset}
|
|
94
|
-
data-cy="FilterSidebar-clearButton"
|
|
95
|
-
>
|
|
96
|
-
<FormattedMessage
|
|
97
|
-
id={'filterModal.all'}
|
|
98
|
-
defaultMessage={'All'}
|
|
99
|
-
/>
|
|
100
|
-
</LinkButton>
|
|
101
|
-
</div>
|
|
102
|
-
) : null;
|
|
103
|
-
|
|
5
|
+
const { category } = props;
|
|
104
6
|
return (
|
|
105
7
|
<CustomFilters
|
|
106
|
-
filterApi={filterApi}
|
|
107
|
-
filterNames={filterNames}
|
|
108
|
-
filterState={filterState}
|
|
109
|
-
clearAll={clearAll}
|
|
110
8
|
category={category}
|
|
111
|
-
onRemove={handleApplyFilter}
|
|
112
9
|
/>
|
|
113
10
|
);
|
|
114
11
|
};
|
|
115
12
|
|
|
116
|
-
FilterTop.defaultProps = {
|
|
117
|
-
filterCountToOpen: 3
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
FilterTop.propTypes = {
|
|
121
|
-
classes: shape({
|
|
122
|
-
action: string,
|
|
123
|
-
blocks: string,
|
|
124
|
-
body: string,
|
|
125
|
-
header: string,
|
|
126
|
-
headerTitle: string,
|
|
127
|
-
root: string,
|
|
128
|
-
root_open: string
|
|
129
|
-
}),
|
|
130
|
-
filters: arrayOf(
|
|
131
|
-
shape({
|
|
132
|
-
attribute_code: string,
|
|
133
|
-
items: array
|
|
134
|
-
})
|
|
135
|
-
),
|
|
136
|
-
filterCountToOpen: number
|
|
137
|
-
};
|
|
138
|
-
|
|
139
13
|
export default FilterTop;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { blackTransparent } from '@riosst100/pwa-marketplace/src/theme/vars'
|
|
4
|
+
|
|
5
|
+
const modal = (props) => {
|
|
6
|
+
const {
|
|
7
|
+
open = false, setOpen = () => { }, children = null,
|
|
8
|
+
rootClassName = '', className = '', closeOutside = false,
|
|
9
|
+
} = props;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
{open && (
|
|
15
|
+
<div
|
|
16
|
+
className={cn(
|
|
17
|
+
'block overflow-hidden fixed top-0 right-0 left-0 z-dialog',
|
|
18
|
+
'justify-center items-center w-full h-full bg-[#11182780]',
|
|
19
|
+
rootClassName,
|
|
20
|
+
)}
|
|
21
|
+
onClick={() => {
|
|
22
|
+
closeOutside ? setOpen(!open) : '';
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
className={cn(
|
|
27
|
+
'relative p-4 w-full min-h-[360px] max-w-md max-h-full',
|
|
28
|
+
'absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-white rounded-lg',
|
|
29
|
+
className
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
|
|
33
|
+
{children}
|
|
34
|
+
</div>
|
|
35
|
+
<style global jsx>
|
|
36
|
+
{`
|
|
37
|
+
body {
|
|
38
|
+
overflow: hidden !important;
|
|
39
|
+
}
|
|
40
|
+
`}
|
|
41
|
+
</style>
|
|
42
|
+
</div>
|
|
43
|
+
)}
|
|
44
|
+
</>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default modal
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './productLineSlider';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import Image from '@magento/venia-ui/lib/components/Image';
|
|
4
|
+
import NendroidImage from './nendroid-image.png';
|
|
5
|
+
import NendroidLogo from './logo_nendoroid.png';
|
|
6
|
+
|
|
7
|
+
const Item = (props) => {
|
|
8
|
+
const {
|
|
9
|
+
name = 'Nendroid Series', rootClassName, onClick = () => { },
|
|
10
|
+
className = "",
|
|
11
|
+
} = props;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className={cn('brand-item-container px-2 lg_px-4', rootClassName)} onClick={onClick}>
|
|
15
|
+
<div
|
|
16
|
+
className={cn(
|
|
17
|
+
'm-auto flex flex-row justify-center items-center',
|
|
18
|
+
'w-full max-w-[300px] px-5 py-2.5',
|
|
19
|
+
'relative rounded-lg border border-gray-100 bg-white',
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
>
|
|
23
|
+
<Image
|
|
24
|
+
alt='image'
|
|
25
|
+
className="relative"
|
|
26
|
+
src={NendroidImage}
|
|
27
|
+
/>
|
|
28
|
+
<Image
|
|
29
|
+
alt='logo'
|
|
30
|
+
className="relative"
|
|
31
|
+
src={NendroidLogo}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default Item;
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Slider from "react-slick";
|
|
3
|
+
import { ArrowLeft2, ArrowRight2 } from 'iconsax-react';
|
|
4
|
+
import cn from 'classnames';
|
|
5
|
+
import Item from './item';
|
|
6
|
+
import { primary900 } from '@riosst100/pwa-marketplace/src/theme/vars';
|
|
7
|
+
|
|
8
|
+
const CustomArrow = (props) => {
|
|
9
|
+
const { isNext = true, onClick, className } = props;
|
|
10
|
+
return (
|
|
11
|
+
<span
|
|
12
|
+
className={cn(
|
|
13
|
+
className,
|
|
14
|
+
'custom_arrow rounded-full w-10 h-10 p-2.5 bg-white hover_!bg-white z-[1] !border !border-solid !border-gray-100 before_hidden',
|
|
15
|
+
isNext ? 'right-2 lg_right-4' : 'left-2 lg_left-4',
|
|
16
|
+
)}
|
|
17
|
+
onClick={onClick}
|
|
18
|
+
>
|
|
19
|
+
{isNext ? (
|
|
20
|
+
<ArrowRight2 className='' size="20" color={primary900} />
|
|
21
|
+
) : (
|
|
22
|
+
<ArrowLeft2 size="20" color={primary900} />
|
|
23
|
+
)}
|
|
24
|
+
</span>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const productSlider = (props) => {
|
|
29
|
+
|
|
30
|
+
const settings = {
|
|
31
|
+
dots: false,
|
|
32
|
+
infinite: false,
|
|
33
|
+
speed: 500,
|
|
34
|
+
slidesToShow: 4,
|
|
35
|
+
slidesToScroll: 1,
|
|
36
|
+
nextArrow: <CustomArrow />,
|
|
37
|
+
prevArrow: <CustomArrow isNext={false} />,
|
|
38
|
+
centerPadding: "60px",
|
|
39
|
+
responsive: [
|
|
40
|
+
{
|
|
41
|
+
breakpoint: 1023,
|
|
42
|
+
settings: {
|
|
43
|
+
slidesToShow: 3,
|
|
44
|
+
slidesToScroll: 1,
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
breakpoint: 767,
|
|
49
|
+
settings: {
|
|
50
|
+
slidesToShow: 3,
|
|
51
|
+
slidesToScroll: 1,
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
breakpoint: 576,
|
|
56
|
+
settings: {
|
|
57
|
+
slidesToShow: 2,
|
|
58
|
+
slidesToScroll: 1
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
};
|
|
63
|
+
return (
|
|
64
|
+
<div className='product_line_items-container flex flex-col gap-x-4 gap-y-5 '>
|
|
65
|
+
<div className='text-[18px] font-medium'>
|
|
66
|
+
Product Line
|
|
67
|
+
</div>
|
|
68
|
+
<Slider {...settings}>
|
|
69
|
+
{[...Array(9)].map(() => {
|
|
70
|
+
return (
|
|
71
|
+
<Item {...props} />
|
|
72
|
+
)
|
|
73
|
+
})}
|
|
74
|
+
</Slider>
|
|
75
|
+
<style global jsx>
|
|
76
|
+
{`
|
|
77
|
+
.product_line_items-container .slick-slider {
|
|
78
|
+
margin: 0 -8px;
|
|
79
|
+
}
|
|
80
|
+
@media only screen and (min-width: 1024px) {
|
|
81
|
+
.product_line_items-container .slick-slider {
|
|
82
|
+
margin: 0 -16px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`}
|
|
86
|
+
</style>
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default productSlider
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Content from './share';
|
|
3
|
+
import { useToasts } from '@magento/peregrine';
|
|
4
|
+
import { Info } from 'react-feather';
|
|
5
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
6
|
+
|
|
7
|
+
const index = (props) => {
|
|
8
|
+
|
|
9
|
+
const [, { addToast }] = useToasts();
|
|
10
|
+
|
|
11
|
+
const InfoIcon = <Icon size={20} src={Info} />;
|
|
12
|
+
|
|
13
|
+
const location = window.location.href;
|
|
14
|
+
const encodedUrl = encodeURIComponent(location);
|
|
15
|
+
const subject = "Check out this awesome product!";
|
|
16
|
+
const messageCopyContent = "Link has been copied.";
|
|
17
|
+
|
|
18
|
+
const loginToastProps = {
|
|
19
|
+
type: 'info',
|
|
20
|
+
message: messageCopyContent,
|
|
21
|
+
timeout: 5000
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const handleShareLink = (type) => {
|
|
25
|
+
switch (type) {
|
|
26
|
+
case 'wa':
|
|
27
|
+
window.open(`https://wa.me/?text=${encodedUrl}`);
|
|
28
|
+
break;
|
|
29
|
+
case 'fb':
|
|
30
|
+
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(encodedUrl)}`);
|
|
31
|
+
break;
|
|
32
|
+
case 'email':
|
|
33
|
+
window.open(`mailto:?subject=${subject}&body=${encodedUrl}`);
|
|
34
|
+
break;
|
|
35
|
+
case 'link':
|
|
36
|
+
navigator.clipboard.writeText(location).then(() => {
|
|
37
|
+
addToast({ ...loginToastProps, icon: InfoIcon });
|
|
38
|
+
}, (err) => {
|
|
39
|
+
console.error('Failed to copy content:', err);
|
|
40
|
+
});
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return (
|
|
47
|
+
<Content handleShareLink={handleShareLink} {...props} />
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default index
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Sms, Whatsapp, Facebook, Link as LinkIcon
|
|
4
|
+
} from 'iconsax-react';
|
|
5
|
+
import cn from 'classnames';
|
|
6
|
+
|
|
7
|
+
const share = (props) => {
|
|
8
|
+
const { rootClassName, className, handleShareLink } = props
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<div className={cn('button_share_group flex flex-wrap gap-4', rootClassName)}>
|
|
12
|
+
<button
|
|
13
|
+
type='button'
|
|
14
|
+
className={cn(
|
|
15
|
+
'button_share border border-solid border-gray-100 p-2.5',
|
|
16
|
+
'rounded-full flex justify-center items-center h-fitContent',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
onClick={() => {
|
|
20
|
+
handleShareLink('wa')
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<Whatsapp
|
|
24
|
+
size="20"
|
|
25
|
+
color="#25D366"
|
|
26
|
+
/>
|
|
27
|
+
</button>
|
|
28
|
+
{/* <button
|
|
29
|
+
type='button'
|
|
30
|
+
className={cn(
|
|
31
|
+
'button_share border border-solid border-gray-100 p-2.5',
|
|
32
|
+
'rounded-full flex justify-center items-center h-fitContent',
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
>
|
|
36
|
+
<Instagram
|
|
37
|
+
size="20"
|
|
38
|
+
color="#ee2a7b"
|
|
39
|
+
/>
|
|
40
|
+
</button> */}
|
|
41
|
+
<button
|
|
42
|
+
type='button'
|
|
43
|
+
className={cn(
|
|
44
|
+
'button_share border border-solid border-gray-100 p-2.5',
|
|
45
|
+
'rounded-full flex justify-center items-center h-fitContent',
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
onClick={() => {
|
|
49
|
+
handleShareLink('fb')
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
<Facebook
|
|
53
|
+
size="20"
|
|
54
|
+
color="#4267B2"
|
|
55
|
+
/>
|
|
56
|
+
</button>
|
|
57
|
+
<button
|
|
58
|
+
type='button'
|
|
59
|
+
className={cn(
|
|
60
|
+
'button_share border border-solid border-gray-100 p-2.5',
|
|
61
|
+
'rounded-full flex justify-center items-center h-fitContent',
|
|
62
|
+
className
|
|
63
|
+
)}
|
|
64
|
+
onClick={() => {
|
|
65
|
+
handleShareLink('email')
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<Sms
|
|
69
|
+
size="20"
|
|
70
|
+
color="#005947"
|
|
71
|
+
/>
|
|
72
|
+
</button>
|
|
73
|
+
<button
|
|
74
|
+
type='button'
|
|
75
|
+
className={cn(
|
|
76
|
+
'button_share border border-solid border-gray-100 p-2.5',
|
|
77
|
+
'rounded-full flex justify-center items-center h-fitContent',
|
|
78
|
+
className
|
|
79
|
+
)}
|
|
80
|
+
onClick={() => {
|
|
81
|
+
handleShareLink('link')
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
<LinkIcon
|
|
85
|
+
size="20"
|
|
86
|
+
color="#999999"
|
|
87
|
+
/>
|
|
88
|
+
</button>
|
|
89
|
+
</div>
|
|
90
|
+
</>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export default share
|