@riosst100/pwa-marketplace 1.2.4 → 1.2.6

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 (61) hide show
  1. package/package.json +1 -1
  2. package/src/components/OperatingHours/index.js +1 -0
  3. package/src/components/OperatingHours/operatingHours.js +32 -0
  4. package/src/components/Seller/seller.js +2 -119
  5. package/src/components/Seller/sellerAddressCard.js +48 -0
  6. package/src/components/SellerDetail/index.js +1 -0
  7. package/src/components/SellerDetail/sellerDetail.js +158 -0
  8. package/src/components/SellerInformation/sellerInformation.js +20 -29
  9. package/src/components/SellerLocation/sellerLocation.js +4 -5
  10. package/src/components/SellerLocation/sellerLocationItem.js +6 -8
  11. package/src/components/SellerProducts/sellerProducts.js +212 -40
  12. package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/MegaMenu.spec.js +91 -0
  13. package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/MegaMenuItem.spec.js +123 -0
  14. package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/Submenu.spec.js +61 -0
  15. package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/SubmenuColumn.spec.js +50 -0
  16. package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenu.spec.js.snap +114 -0
  17. package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenuItem.spec.js.snap +71 -0
  18. package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/__snapshots__/Submenu.spec.js.snap +59 -0
  19. package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/__snapshots__/SubmenuColumn.spec.js.snap +34 -0
  20. package/src/overwrites/venia-ui/lib/components/MegaMenu/index.js +1 -0
  21. package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenu.js +90 -0
  22. package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenu.module.css +12 -0
  23. package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +156 -0
  24. package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.module.css +31 -0
  25. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +89 -0
  26. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.module.css +43 -0
  27. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.js +99 -0
  28. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.module.css +28 -0
  29. package/src/overwrites/venia-ui/lib/components/SearchBar/__stories__/searchBar.js +11 -0
  30. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/__snapshots__/searchField.spec.js.snap +72 -0
  31. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/__snapshots__/suggestedCategories.spec.js.snap +30 -0
  32. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/__snapshots__/suggestedProduct.spec.js.snap +69 -0
  33. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/__snapshots__/suggestedProducts.spec.js.snap +7 -0
  34. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/__snapshots__/suggestions.spec.js.snap +12 -0
  35. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/autocomplete.spec.js +52 -0
  36. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/searchBar.spec.js +82 -0
  37. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/searchField.spec.js +87 -0
  38. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/suggestedCategories.spec.js +45 -0
  39. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/suggestedProduct.spec.js +43 -0
  40. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/suggestedProducts.spec.js +45 -0
  41. package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/suggestions.spec.js +110 -0
  42. package/src/overwrites/venia-ui/lib/components/SearchBar/autocomplete.js +172 -0
  43. package/src/overwrites/venia-ui/lib/components/SearchBar/autocomplete.module.css +62 -0
  44. package/src/overwrites/venia-ui/lib/components/SearchBar/index.js +1 -0
  45. package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +74 -0
  46. package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.module.css +50 -0
  47. package/src/overwrites/venia-ui/lib/components/SearchBar/searchField.js +40 -0
  48. package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedCategories.js +48 -0
  49. package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedCategories.module.css +13 -0
  50. package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedCategory.js +49 -0
  51. package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedCategory.module.css +0 -0
  52. package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedProduct.js +97 -0
  53. package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedProduct.module.css +24 -0
  54. package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedProducts.js +43 -0
  55. package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedProducts.module.css +13 -0
  56. package/src/overwrites/venia-ui/lib/components/SearchBar/suggestions.js +75 -0
  57. package/src/overwrites/venia-ui/lib/components/SearchBar/suggestions.module.css +6 -0
  58. package/src/talons/Seller/seller.gql.js +70 -5
  59. package/src/talons/Seller/useSeller.js +6 -1
  60. package/src/talons/SellerProducts/useSellerProducts.js +129 -0
  61. package/src/theme/vars.js +7 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riosst100/pwa-marketplace",
3
3
  "author": "riosst100@gmail.com",
4
- "version": "1.2.4",
4
+ "version": "1.2.6",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -0,0 +1 @@
1
+ export { default } from './operatingHours';
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+
3
+ const OperatingHours = ({ values }) => {
4
+ return <>
5
+ <table>
6
+ {values ? <Hours values={values} /> : ''}
7
+ </table>
8
+ </>
9
+ }
10
+
11
+ const Hours = ({ values }) => {
12
+ return values && values.map((value, index) =>
13
+ <>
14
+ <tr>
15
+ <td>{value.day}</td>
16
+ <td>
17
+ {value.status == "open" && value.time ? <Time times={value.time} /> : <tr><td>Closed</td></tr>}
18
+ </td>
19
+ </tr>
20
+ </>)
21
+ }
22
+
23
+ const Time = ({ times }) => {
24
+ return times ? times.map((value, index) =>
25
+ <>
26
+ <tr>
27
+ <td>{value.opening_time} - {value.closing_time}</td>
28
+ </tr>
29
+ </>) : ''
30
+ }
31
+
32
+ export default OperatingHours;
@@ -4,20 +4,7 @@ import { useSeller } from '@riosst100/pwa-marketplace/src/talons/Seller/useSelle
4
4
  import ErrorView from '@magento/venia-ui/lib/components/ErrorView';
5
5
  import { StoreTitle, Meta } from '@magento/venia-ui/lib/components/Head';
6
6
  import mapSeller from '@riosst100/pwa-marketplace/src/util/mapSeller';
7
- import Slider from '@riosst100/pwa-marketplace/src/components/commons/Slider';
8
- import Tabs from '@riosst100/pwa-marketplace/src/components/commons/Tabs';
9
- import SellerProducts from '../SellerProducts';
10
- import SellerInformation from '../SellerInformation';
11
- import Reviews from '../SellerReview';
12
- import {
13
- Verify,
14
- Sms,
15
- Message,
16
- Heart,
17
- Share,
18
- BoxTick,
19
- Star1,
20
- } from 'iconsax-react';
7
+ import SellerDetail from '@riosst100/pwa-marketplace/src/components/SellerDetail';
21
8
 
22
9
  const Seller = props => {
23
10
  const talonProps = useSeller({
@@ -47,113 +34,9 @@ const Seller = props => {
47
34
  <Fragment>
48
35
  <StoreTitle>{seller.name}</StoreTitle>
49
36
  <Meta name="description" content={seller.description} />
50
- <SellerDetail seller={seller} />
37
+ {seller && <SellerDetail seller={seller} />}
51
38
  </Fragment>
52
39
  );
53
40
  };
54
41
 
55
- const SellerDetail = ({ seller }) => {
56
- const dataTabs =
57
- [
58
- {
59
- id: 'product-tab',
60
- title: 'All Products',
61
- content: <SellerProducts />
62
- },
63
- {
64
- id: 'store-information',
65
- title: 'Store Information',
66
- content: <SellerInformation seller={seller} />
67
- },
68
- {
69
- id: 'reviews',
70
- title: 'Reviews',
71
- content: <Reviews />
72
- }
73
- ];
74
-
75
- return (
76
- <div className='py-8'>
77
- <Slider seller={seller} rootClassname='mb-[30px]' />
78
- <div className='flex items-center justify-between mb-[30px] p-[20px] rounded-[6px] border border-solid border-[#e6e9ea] shadow-[0px_0px_5px_3px_#d9d9d933]'>
79
- <div className='inline-flex items-center gap-[15px] relative flex-[0_0_auto]'>
80
- <img className="relative w-[100px] h-[100px] object-cover" alt="Rectangle" src={seller ? seller.thumbnail : ''} />
81
- <div className='inline-flex flex-col h-[100px] items-start justify-between relative flex-[0_0_auto]'>
82
- <div className='inline-flex flex-col items-start gap-[6px] relative flex-[0_0_auto]'>
83
- <div className="items-center gap-[10px] inline-flex relative flex-[0_0_auto]">
84
- <div className="relative w-fit mt-[-1.00px] font-semibold text-[#1b1b1b] text-[20px] tracking-[0] leading-[24px] whitespace-nowrap">
85
- {seller ? seller.name : ''}
86
- </div>
87
- <div className="inline-flex items-center gap-[5px] relative flex-[0_0_auto]">
88
- <Verify variant='Bold' color='#4E31DB' size={20} />
89
- <div className="relative w-fit font-medium text-[#192221b3] text-[12px] tracking-[0] leading-[normal] whitespace-nowrap">
90
- Verified
91
- </div>
92
- </div>
93
- </div>
94
- <div class="relative w-fit font-normal text-[#999999] text-[12px] tracking-[0] leading-[14px] whitespace-nowrap">
95
- Jurong west
96
- </div>
97
- </div>
98
- <div className='inline-flex items-start gap-[15px] relative flex-[0_0_auto]'>
99
- <div class="flex items-center justify-center gap-[5px] px-[20px] py-[8px] relative bg-white rounded-[30px] border border-solid border-[#6243fa]">
100
- <div class="inline-flex items-center justify-center gap-[10px] relative flex-[0_0_auto]">
101
- <Sms color="#6243FA" size={14} variant="Outline" className='stroke-[#6243FA]' />
102
- <div class="relative w-fit mt-[-1.00px] font-medium text-[#6243fa] text-[14px] tracking-[0] leading-[20px] whitespace-nowrap">
103
- Message
104
- </div>
105
- </div>
106
- </div>
107
- <div class="flex items-center justify-center gap-[5px] px-[20px] py-[8px] relative bg-[#280135] rounded-[30px] border border-solid border-[#280135]">
108
- <div class="inline-flex items-center justify-center gap-[10px] relative flex-[0_0_auto]">
109
- <Message color='#FFFFFF' size={14} variant="Outline" className='stroke-[#FFFFFF]' />
110
- <div class="relative w-fit mt-[-1.00px] font-medium text-[#fff] text-[14px] tracking-[0] leading-[20px] whitespace-nowrap">
111
- Chat With Seller
112
- </div>
113
- </div>
114
- </div>
115
- <div class="inline-flex items-center justify-center gap-[5px] p-[11px] relative flex-[0_0_auto] bg-white rounded-[30px] overflow-hidden border border-solid border-[#6243fa]">
116
- <Heart color='#6243FA' size={14} variant="Outline" className='stroke-[#6243FA]' />
117
- </div>
118
- <div class="inline-flex items-center justify-center gap-[5px] p-[11px] relative flex-[0_0_auto] bg-white rounded-[30px] overflow-hidden border border-solid border-[#6243fa]">
119
- <Share color='#6243FA' size={14} variant="Outline" className='stroke-[#6243FA]' />
120
- </div>
121
- </div>
122
- </div>
123
- </div>
124
- <div class="inline-flex items-center gap-[20px] px-[10px] py-[30px] relative flex-[0_0_auto]">
125
- <div class="inline-flex flex-col items-center justify-center gap-[9px] p-[10px] relative flex-[0_0_auto]">
126
- <div class="inline-flex items-center gap-[6px] relative flex-[0_0_auto]">
127
- <BoxTick color="#B9AEC5" variant="Outline" size={18} className='stroke-[#B9AEC5] stroke-[.5px]' />
128
- <div class="[font-family:'Noto_Sans',Helvetica] font-semibold text-[#005947] text-[18px] relative w-fit tracking-[0] leading-[normal] whitespace-nowrap">
129
- 121
130
- </div>
131
- </div>
132
- <div class="relative w-fit [font-family:'Frederik-Regular',Helvetica] font-normal text-[#009a7b] text-[10px] tracking-[0] leading-[normal] whitespace-nowrap">
133
- Total Sales
134
- </div>
135
- </div>
136
- <img class="relative self-stretch w-px object-cover" alt="Line" src="https://c.animaapp.com/2pP7niVX/img/line-16.svg" />
137
- <div class="inline-flex flex-col items-center justify-center gap-[9px] p-[10px] relative flex-[0_0_auto]">
138
- <div class="inline-flex items-center gap-[5px] relative flex-[0_0_auto]">
139
- <Star1 color='#F7C317' size={18} className='fill-[#F7C317]' />
140
- <div class="relative self-stretch w-[25px] mt-[-1.00px] font-bold text-[#005947] text-[18px] tracking-[0] leading-[normal] whitespace-nowrap">
141
- 4.7
142
- </div>
143
- </div>
144
- <div class="relative w-fit [font-family:'Frederik-Regular',Helvetica] font-normal text-[#009a7b] text-[10px] tracking-[0] leading-[normal] whitespace-nowrap">
145
- Rating &amp; Reviews
146
- </div>
147
- </div>
148
- </div>
149
- </div>
150
- <Tabs
151
- data={dataTabs}
152
- tabContentWrapperClassName='!p-0'
153
- hasContent
154
- />
155
- </div>
156
- )
157
- }
158
-
159
42
  export default Seller;
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import { useStyle } from '@magento/venia-ui/lib/classify';
3
+ import defaultClasses from '@magento/venia-ui/lib/components/AddressBookPage/addressCard.module.css';
4
+
5
+ const SellerAddressCard = ({ address }) => {
6
+ const {
7
+ address_line_1,
8
+ address_line_2,
9
+ city,
10
+ country,
11
+ postcode,
12
+ region
13
+ } = address;
14
+
15
+ const classes = useStyle(defaultClasses, null);
16
+
17
+ // const nameString = [firstname, middlename, lastname]
18
+ // .filter(name => !!name)
19
+ // .join(' ');
20
+
21
+ let additionalAddressString = `${city || ''}`;
22
+
23
+ if (region || postcode) {
24
+ additionalAddressString += `, ${region || ''} ${postcode || ''}`;
25
+ }
26
+
27
+ return (
28
+ <div
29
+ className={classes.contentContainer}
30
+ data-cy="addressCard-contentContainer"
31
+ >
32
+ <span className={classes.streetRow}>
33
+ {address_line_1 || ''}
34
+ </span>
35
+ <span className={classes.streetRow}>
36
+ {address_line_2 || ''}
37
+ </span>
38
+ <span className={classes.additionalAddress}>
39
+ {additionalAddressString || ''}
40
+ </span>
41
+ <span className={classes.country}>
42
+ {country || ''}
43
+ </span>
44
+ </div>
45
+ );
46
+ };
47
+
48
+ export default SellerAddressCard;
@@ -0,0 +1 @@
1
+ export { default } from './sellerDetail';
@@ -0,0 +1,158 @@
1
+ import React, { Fragment } from 'react';
2
+ import { FormattedMessage } from 'react-intl';
3
+ import { useSeller } from '@riosst100/pwa-marketplace/src/talons/Seller/useSeller';
4
+ import ErrorView from '@magento/venia-ui/lib/components/ErrorView';
5
+ import { StoreTitle, Meta } from '@magento/venia-ui/lib/components/Head';
6
+ import mapSeller from '@riosst100/pwa-marketplace/src/util/mapSeller';
7
+ import Slider from '@riosst100/pwa-marketplace/src/components/commons/Slider';
8
+ import Tabs from '@riosst100/pwa-marketplace/src/components/commons/Tabs';
9
+ import SellerProducts from '../SellerProducts';
10
+ import SellerInformation from '../SellerInformation';
11
+ import Reviews from '../SellerReview';
12
+ import {
13
+ Verify,
14
+ Sms,
15
+ Message,
16
+ Heart,
17
+ Share,
18
+ BoxTick,
19
+ Star1,
20
+ } from 'iconsax-react';
21
+ import Image from '@magento/venia-ui/lib/components/Image';
22
+
23
+ const SellerDetail = props => {
24
+ const talonProps = useSeller({
25
+ mapSeller
26
+ });
27
+
28
+ const { error, loading, seller } = talonProps;
29
+
30
+ if (loading && !seller)
31
+ return '';
32
+ // return <SellerShimmer />;
33
+ if (error && !seller) return <ErrorView />;
34
+ if (!seller) {
35
+ return (
36
+ <h1>
37
+ <FormattedMessage
38
+ id={'seller.notFound'}
39
+ defaultMessage={
40
+ 'Seller Not Found.'
41
+ }
42
+ />
43
+ </h1>
44
+ );
45
+ }
46
+
47
+ const dataTabs =
48
+ [
49
+ {
50
+ id: 'product-tab',
51
+ title: 'All Products',
52
+ content: <SellerProducts data={seller.products} />
53
+ },
54
+ {
55
+ id: 'store-information',
56
+ title: 'Store Information',
57
+ content: <SellerInformation seller={seller} />
58
+ },
59
+ {
60
+ id: 'reviews',
61
+ title: 'Reviews',
62
+ content: <Reviews />
63
+ }
64
+ ];
65
+
66
+ return (
67
+ <Fragment>
68
+ <StoreTitle>{seller.name}</StoreTitle>
69
+ <Meta name="description" content={seller.description} />
70
+ <div className='py-8'>
71
+ <Slider seller={seller} rootClassname='mb-[30px]' />
72
+ <div className='flex items-center justify-between mb-[30px] p-[20px] rounded-[6px] border border-solid border-[#e6e9ea] shadow-[0px_0px_5px_3px_#d9d9d933]'>
73
+ <div className='inline-flex items-center gap-[15px] relative flex-[0_0_auto]'>
74
+ {seller && seller.thumbnail && seller.thumbnail !== undefined ? <Image
75
+ alt={seller.name}
76
+ width='100'
77
+ src={seller.thumbnail || ''}
78
+ /> : ''}
79
+ <div className='inline-flex flex-col h-[100px] items-start justify-between relative flex-[0_0_auto]'>
80
+ <div className='inline-flex flex-col items-start gap-[6px] relative flex-[0_0_auto]'>
81
+ <div className="items-center gap-[10px] inline-flex relative flex-[0_0_auto]">
82
+ <div className="relative w-fit mt-[-1.00px] font-semibold text-[#1b1b1b] text-[20px] tracking-[0] leading-[24px] whitespace-nowrap">
83
+ {seller ? seller.name : ''}
84
+ </div>
85
+ <div className="inline-flex items-center gap-[5px] relative flex-[0_0_auto]">
86
+ <Verify variant='Bold' color='#4E31DB' size={20} />
87
+ <div className="relative w-fit font-medium text-[#192221b3] text-[12px] tracking-[0] leading-[normal] whitespace-nowrap">
88
+ Verified
89
+ </div>
90
+ </div>
91
+ </div>
92
+ <div class="relative w-fit font-normal text-[#999999] text-[12px] tracking-[0] leading-[14px] whitespace-nowrap">
93
+ Jurong west
94
+ </div>
95
+ </div>
96
+ <div className='inline-flex items-start gap-[15px] relative flex-[0_0_auto]'>
97
+ <div class="flex items-center justify-center gap-[5px] px-[20px] py-[8px] relative bg-white rounded-[30px] border border-solid border-[#6243fa]">
98
+ <div class="inline-flex items-center justify-center gap-[10px] relative flex-[0_0_auto]">
99
+ <Sms color="#6243FA" size={14} variant="Outline" className='stroke-[#6243FA]' />
100
+ <div class="relative w-fit mt-[-1.00px] font-medium text-[#6243fa] text-[14px] tracking-[0] leading-[20px] whitespace-nowrap">
101
+ Message
102
+ </div>
103
+ </div>
104
+ </div>
105
+ <div class="flex items-center justify-center gap-[5px] px-[20px] py-[8px] relative bg-[#280135] rounded-[30px] border border-solid border-[#280135]">
106
+ <div class="inline-flex items-center justify-center gap-[10px] relative flex-[0_0_auto]">
107
+ <Message color='#FFFFFF' size={14} variant="Outline" className='stroke-[#FFFFFF]' />
108
+ <div class="relative w-fit mt-[-1.00px] font-medium text-[#fff] text-[14px] tracking-[0] leading-[20px] whitespace-nowrap">
109
+ Chat With Seller
110
+ </div>
111
+ </div>
112
+ </div>
113
+ <div class="inline-flex items-center justify-center gap-[5px] p-[11px] relative flex-[0_0_auto] bg-white rounded-[30px] overflow-hidden border border-solid border-[#6243fa]">
114
+ <Heart color='#6243FA' size={14} variant="Outline" className='stroke-[#6243FA]' />
115
+ </div>
116
+ <div class="inline-flex items-center justify-center gap-[5px] p-[11px] relative flex-[0_0_auto] bg-white rounded-[30px] overflow-hidden border border-solid border-[#6243fa]">
117
+ <Share color='#6243FA' size={14} variant="Outline" className='stroke-[#6243FA]' />
118
+ </div>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ <div class="inline-flex items-center gap-[20px] px-[10px] py-[30px] relative flex-[0_0_auto]">
123
+ <div class="inline-flex flex-col items-center justify-center gap-[9px] p-[10px] relative flex-[0_0_auto]">
124
+ <div class="inline-flex items-center gap-[6px] relative flex-[0_0_auto]">
125
+ <BoxTick color="#B9AEC5" variant="Outline" size={18} className='stroke-[#B9AEC5] stroke-[.5px]' />
126
+ <div class="[font-family:'Noto_Sans',Helvetica] font-semibold text-[#005947] text-[18px] relative w-fit tracking-[0] leading-[normal] whitespace-nowrap">
127
+ {seller ? seller.sale : 0}
128
+ </div>
129
+ </div>
130
+ <div class="relative w-fit [font-family:'Frederik-Regular',Helvetica] font-normal text-[#009a7b] text-[10px] tracking-[0] leading-[normal] whitespace-nowrap">
131
+ Total Sales
132
+ </div>
133
+ </div>
134
+ <img class="relative self-stretch w-px object-cover" alt="Line" src="https://c.animaapp.com/2pP7niVX/img/line-16.svg" />
135
+ <div class="inline-flex flex-col items-center justify-center gap-[9px] p-[10px] relative flex-[0_0_auto]">
136
+ <div class="inline-flex items-center gap-[5px] relative flex-[0_0_auto]">
137
+ <Star1 color='#F7C317' size={18} className='fill-[#F7C317]' />
138
+ <div class="relative self-stretch w-[25px] mt-[-1.00px] font-bold text-[#005947] text-[18px] tracking-[0] leading-[normal] whitespace-nowrap">
139
+ 4.7
140
+ </div>
141
+ </div>
142
+ <div class="relative w-fit [font-family:'Frederik-Regular',Helvetica] font-normal text-[#009a7b] text-[10px] tracking-[0] leading-[normal] whitespace-nowrap">
143
+ Rating &amp; Reviews
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ <Tabs
149
+ data={dataTabs}
150
+ tabContentWrapperClassName='!p-0'
151
+ hasContent
152
+ />
153
+ </div>
154
+ </Fragment>
155
+ )
156
+ }
157
+
158
+ export default SellerDetail;
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import SellerLocation from '../SellerLocation';
3
3
  import { Location, ShopAdd } from 'iconsax-react';
4
+ import OperatingHours from '@riosst100/pwa-marketplace/src/components/OperatingHours';
5
+ import SellerAddressCard from '@riosst100/pwa-marketplace/src/components/Seller/sellerAddressCard';
4
6
 
5
7
  const SellerInformation = ({ seller }) => {
6
- console.log(seller.operating_hours)
7
8
  return (
8
9
  <>
9
10
  <div class="flex flex-col items-start gap-[30px] px-[10px]">
@@ -21,11 +22,11 @@ const SellerInformation = ({ seller }) => {
21
22
  </div>
22
23
  <div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
23
24
  <Location color="#009A7B" size={18} variant="Outline" className='stroke-[#009A7B] stroke-[0.5px]' />
24
- <p class="relative w-fit [font-family:'Frederik-Regular',Helvetica] font-normal text-[#009a7b] text-[14px] tracking-[0] leading-[normal] whitespace-nowrap">612, Jurong West Street 65</p>
25
+ <p class="relative w-fit [font-family:'Frederik-Regular',Helvetica] font-normal text-[#009a7b] text-[14px] tracking-[0] leading-[normal] whitespace-nowrap"><SellerAddressCard address={seller} /></p>
25
26
  </div>
26
27
  <div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
27
28
  <ShopAdd color="#009A7B" size={18} variant="Outline" className='stroke-[#009A7B] stroke-[0.5px]' />
28
- <div class="relative self-stretch w-[151px] mt-[-1.00px] [font-family:'Frederik-Regular',Helvetica] font-normal text-[#009a7b] text-[14px] tracking-[0] leading-[normal]">Joined: December 2023</div>
29
+ <div class="relative self-stretch w-[151px] mt-[-1.00px] [font-family:'Frederik-Regular',Helvetica] font-normal text-[#009a7b] text-[14px] tracking-[0] leading-[normal]">Joined: {seller ? seller.creation_time : ''}</div>
29
30
  </div>
30
31
  </div>
31
32
  </div>
@@ -36,11 +37,7 @@ const SellerInformation = ({ seller }) => {
36
37
  <div class="inline-flex flex-col items-start relative flex-[0_0_auto]">
37
38
  <div class="inline-flex items-start gap-[10px] relative flex-[0_0_auto]">
38
39
  <p class="relative w-[186px] mt-[-1.00px] [font-family:'Frederik-Regular',Helvetica] font-normal text-[#1b1b1b] text-[14px] tracking-[0] leading-[normal]">
39
- Monday - Friday 9 AM - 5 PM<br />
40
- <br />
41
- Saturday 11 AM - 3 PM<br />
42
- <br />
43
- Sunday Close
40
+ <OperatingHours values={seller.operating_hours} />
44
41
  </p>
45
42
  </div>
46
43
  </div>
@@ -52,26 +49,7 @@ const SellerInformation = ({ seller }) => {
52
49
  <div class="relative w-fit mt-[-1.00px] [font-family:'Frederik-DemiBold',Helvetica] font-bold text-[#1b1b1b] text-[16px] tracking-[0] leading-[normal] whitespace-nowrap">Ship To</div>
53
50
  </div>
54
51
  <div class="flex flex-wrap w-[300px] items-start gap-[10px_10px] relative flex-[0_0_auto]">
55
- <div class="flex flex-wrap items-center gap-[0px_10px] px-0 py-[5px] relative flex-1 grow">
56
- <div class="inline-flex items-center justify-center gap-[10px] px-[10px] py-0 relative flex-[0_0_auto] border-r [border-right-style:solid] border-[#e6e9ea]">
57
- <div class="relative w-fit mt-[-1.00px] [font-family:'Frederik-Regular',Helvetica] font-normal text-[#1b1b1b] text-[14px] tracking-[0] leading-[normal] whitespace-nowrap">Yishun</div>
58
- </div>
59
- <div class="inline-flex items-center justify-center gap-[10px] px-[10px] py-0 relative flex-[0_0_auto] border-r [border-right-style:solid] border-[#e6e9ea]">
60
- <div class="relative w-fit mt-[-1.00px] [font-family:'Frederik-Regular',Helvetica] font-normal text-[#1b1b1b] text-[14px] tracking-[0] leading-[normal] whitespace-nowrap">Jurong West</div>
61
- </div>
62
- <div class="inline-flex items-center justify-center gap-[10px] px-[10px] py-0 relative flex-[0_0_auto] border-r [border-right-style:solid] border-[#e6e9ea]">
63
- <div class="relative w-fit mt-[-1.00px] [font-family:'Frederik-Regular',Helvetica] font-normal text-[#1b1b1b] text-[14px] tracking-[0] leading-[normal] whitespace-nowrap">Jurong East</div>
64
- </div>
65
- <div class="inline-flex items-center justify-center gap-[10px] px-[10px] py-0 relative flex-[0_0_auto] border-r [border-right-style:solid] border-[#e6e9ea]">
66
- <div class="relative w-fit mt-[-1.00px] [font-family:'Frederik-Regular',Helvetica] font-normal text-[#1b1b1b] text-[14px] tracking-[0] leading-[normal] whitespace-nowrap">Seletar</div>
67
- </div>
68
- <div class="inline-flex items-center justify-center gap-[10px] px-[10px] py-0 relative flex-[0_0_auto] border-r [border-right-style:solid] border-[#e6e9ea]">
69
- <div class="mt-[-1.00px] [font-family:'Frederik-Regular',Helvetica] text-[#1b1b1b] text-[14px] leading-[normal] whitespace-nowrap relative w-fit font-normal tracking-[0]">Serangoon</div>
70
- </div>
71
- <div class="inline-flex items-center justify-center gap-[10px] px-[10px] py-0 relative flex-[0_0_auto]">
72
- <div class="relative w-fit mt-[-1.00px] [font-family:'Frederik-Regular',Helvetica] font-normal text-[#1b1b1b] text-[14px] tracking-[0] leading-[normal] whitespace-nowrap">Bukit Batok</div>
73
- </div>
74
- </div>
52
+ {seller ? <SellerShipTo seller={seller} /> : '' }
75
53
  </div>
76
54
  </div>
77
55
  </div>
@@ -85,10 +63,23 @@ const SellerInformation = ({ seller }) => {
85
63
  </div>
86
64
  </div>
87
65
  </div>
88
- <SellerLocation />
66
+ {seller ? <SellerLocation storeLocators={seller.store_locators} /> : ''}
89
67
  </div>
90
68
  </>
91
69
  )
92
70
  }
93
71
 
72
+ const SellerShipTo = ({seller}) => {
73
+ const shipTo = seller ? seller.ship_to : '';
74
+ const shipToCountry = seller ? seller.ship_to_country : '';
75
+
76
+ return <>
77
+ <div class="flex flex-wrap items-center gap-[0px_10px] px-0 py-[5px] relative flex-1 grow">
78
+ <div class="inline-flex items-center justify-center gap-[10px] px-[10px] py-0 relative flex-[0_0_auto] border-r [border-right-style:solid] border-[#e6e9ea]">
79
+ <div class="relative w-fit mt-[-1.00px] [font-family:'Frederik-Regular',Helvetica] font-normal text-[#1b1b1b] text-[14px] tracking-[0] leading-[normal] whitespace-nowrap">{shipTo}<br />{shipToCountry}</div>
80
+ </div>
81
+ </div>
82
+ </>
83
+ }
84
+
94
85
  export default SellerInformation;
@@ -1,16 +1,15 @@
1
1
  import React from 'react';
2
2
  import SellerLocationItem from './sellerLocationItem';
3
3
 
4
- const SellerLocation = () => {
4
+ const SellerLocation = ({ storeLocators }) => {
5
5
  return (
6
6
  <>
7
7
  <div class="w-full flex flex-col items-start gap-[25px]">
8
8
  <div class="relative w-fit font-semibold text-[20px] tracking-[0] leading-[normal]">Our Store</div>
9
9
  <div class="w-full grid grid-cols-3 gap-4">
10
- <SellerLocationItem />
11
- <SellerLocationItem />
12
- <SellerLocationItem />
13
- <SellerLocationItem />
10
+ {storeLocators && storeLocators.map((value, index) =>
11
+ <SellerLocationItem storeLocator={value} />
12
+ )}
14
13
  </div>
15
14
  </div>
16
15
  </>
@@ -1,24 +1,22 @@
1
1
  import React from 'react';
2
2
  import { Location, Clock } from 'iconsax-react';
3
+ import OperatingHours from '@riosst100/pwa-marketplace/src/components/OperatingHours';
4
+ import SellerAddressCard from '@riosst100/pwa-marketplace/src/components/Seller/sellerAddressCard';
3
5
 
4
- const SellerLocationItem = () => {
6
+ const SellerLocationItem = ({ storeLocator }) => {
5
7
  return (
6
8
  <>
7
9
  <div class="flex flex-col w-full items-start gap-[15px] p-[20px] relative rounded-[8px] border border-solid border-[#e6e9ea]">
8
- <div class="relative w-fit mt-[-1.00px] [font-family:'Noto_Sans',Helvetica] font-semibold text-[16px] tracking-[0] leading-[normal]">Zen Market Kitchener</div>
10
+ <div class="relative w-fit mt-[-1.00px] [font-family:'Noto_Sans',Helvetica] font-semibold text-[16px] tracking-[0] leading-[normal]">{storeLocator ? storeLocator.name : ''}</div>
9
11
  <div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
10
12
  <Location color="#1B1B1B" size={18} variant="Outline" className='stroke-[#1B1B1B] stroke-[0.5px]' />
11
- <div class="relative w-fit mt-[-1.00px] [font-family:'Noto_Sans',Helvetica] font-normal text-[14px] tracking-[0] leading-[normal]">180 Kitchener Rd, Singapura</div>
13
+ <div class="relative w-fit mt-[-1.00px] [font-family:'Noto_Sans',Helvetica] font-normal text-[14px] tracking-[0] leading-[normal]"><SellerAddressCard address={storeLocator} /></div>
12
14
  </div>
13
15
  <div class="flex flex-col w-[320px] items-end relative flex-[0_0_auto] mr-[-10.00px]">
14
16
  <div class="flex items-center gap-[10px] relative self-stretch w-full flex-[0_0_auto]">
15
17
  <Clock color="#1B1B1B" size={18} variant="Outline" className='stroke-[#1B1B1B] stroke-[0.5px]' />
16
- <p class="relative w-fit mt-[-1.00px] [font-family:'Noto_Sans',Helvetica] font-normal text-[14px] tracking-[0] leading-[24px] whitespace-nowrap">Monday - Friday 9 AM - 5 PM</p>
18
+ {storeLocator ? <OperatingHours values={storeLocator.operating_hours} /> : ''}
17
19
  </div>
18
- <p class="relative w-[292px] [font-family:'Noto_Sans',Helvetica] font-normal text-[14px] tracking-[0] leading-[24px]">
19
- Saturday 11 AM - 3 PM<br />
20
- Sunday Close
21
- </p>
22
20
  </div>
23
21
  </div>
24
22
  </>