@riosst100/pwa-marketplace 1.9.2 → 1.9.3

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.
@@ -0,0 +1,342 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import { StoreTitle } from '@magento/venia-ui/lib/components/Head';
4
+ import Image from '@magento/venia-ui/lib/components/Image';
5
+ import { Link } from 'react-router-dom';
6
+ import Button from '@magento/venia-ui/lib/components/Button';
7
+ import ChatContent from '../LiveChat/chatContent';
8
+ import cn from 'classnames';
9
+ import { Send } from 'iconsax-react';
10
+
11
+ const quoteDetail = () => {
12
+ const { formatMessage } = useIntl();
13
+ const PAGE_TITLE = formatMessage({
14
+ id: 'Quotes.pageTitleTextQuoteDetail',
15
+ defaultMessage: 'Quote Detail'
16
+ });
17
+
18
+ const urlImage = 'https://pwa-tcgcollective.local:8255/media/catalog/product/s/-/s-l1600_6__1.jpg?auto=webp&format=pjpg&width=495&height=618.75&fit=cover';
19
+ const dummyChat = [
20
+ {
21
+ "message": "May I help you",
22
+ "type": "seller",
23
+ "timeStamp": "03-06-2024 2:59 pm"
24
+ },
25
+ {
26
+ "message": "Yes",
27
+ "type": "buyer",
28
+ "timeStamp": "03-06-2024 2:59 pm"
29
+ },
30
+ {
31
+ "message": "can i get a discount",
32
+ "type": "buyer",
33
+ "timeStamp": "03-06-2024 2:59 pm"
34
+ },
35
+ {
36
+ "message": "you can redeem this code 'JunePlay'",
37
+ "type": "seller",
38
+ "timeStamp": "03-06-2024 2:59 pm"
39
+ },
40
+ {
41
+ "message": "or this code 'collectfest'",
42
+ "type": "seller",
43
+ "timeStamp": "03-06-2024 2:59 pm"
44
+ },
45
+ {
46
+ "message": "May I help you",
47
+ "type": "seller",
48
+ "timeStamp": "03-06-2024 2:59 pm"
49
+ },
50
+ {
51
+ "message": "Yes",
52
+ "type": "buyer",
53
+ "timeStamp": "03-06-2024 2:59 pm"
54
+ },
55
+ {
56
+ "message": "can i get a discount",
57
+ "type": "buyer",
58
+ "timeStamp": "03-06-2024 2:59 pm"
59
+ },
60
+ {
61
+ "message": "you can redeem this code 'JunePlay'",
62
+ "type": "seller",
63
+ "timeStamp": "03-06-2024 2:59 pm"
64
+ },
65
+ {
66
+ "message": "or this code 'collectfest'",
67
+ "type": "seller",
68
+ "timeStamp": "03-06-2024 2:59 pm"
69
+ },
70
+ ]
71
+
72
+ return (
73
+ <div className='relative grid gap-y-md'>
74
+ <StoreTitle>{PAGE_TITLE}</StoreTitle>
75
+ <div aria-live="polite" className="text-xl font-medium text-left">
76
+ {PAGE_TITLE} - DEV123123123
77
+ </div>
78
+ <div className='rounded-md border border-gray-100 px-4 py-6 flex flex-col-reverse md_flex-row justify-between gap-x-10'>
79
+ <div className='flex flex-col gap-y-4 w-full md_w-6/12'>
80
+ <div className='block p-2 -ml-2 -mr-2 bg-[#F1EFF6] rounded-md'>
81
+ <p className='text-[13px] text-blue-700 flex justify-between'>
82
+ <span className='font-medium block'>
83
+ {
84
+ formatMessage({
85
+ id: 'Quotes.labelStatus',
86
+ defaultMessage: 'Quote Status'
87
+ })
88
+ }
89
+ </span>
90
+ <span className='font-medium block text-blue-700'>
91
+ Approve
92
+ </span>
93
+ </p>
94
+ </div>
95
+ <div className='block'>
96
+ <p className='text-[13px] text-colorDefault flex justify-between'>
97
+ <span className='font-medium block'>
98
+ {
99
+ formatMessage({
100
+ id: 'Quotes.labelQty',
101
+ defaultMessage: 'Quantity'
102
+ })
103
+ }
104
+ </span>
105
+ <span className='font-normal block'>
106
+ 4 Units
107
+ </span>
108
+ </p>
109
+ </div>
110
+ <div className='block'>
111
+ <p className='text-[13px] text-colorDefault flex justify-between'>
112
+ <span className='font-medium block'>
113
+ {
114
+ formatMessage({
115
+ id: 'Quotes.adminSuggestedQty',
116
+ defaultMessage: 'Admin Suggested Quantity'
117
+ })
118
+ }
119
+ </span>
120
+ <span className='font-normal block'>
121
+ 4 Units
122
+ </span>
123
+ </p>
124
+ </div>
125
+ <div className='block'>
126
+ <p className='text-[13px] text-colorDefault flex justify-between'>
127
+ <span className='font-medium block'>
128
+ {
129
+ formatMessage({
130
+ id: 'Quotes.expectedPrice',
131
+ defaultMessage: 'Expected Price'
132
+ })
133
+ }
134
+ </span>
135
+ <span className='font-normal block'>
136
+ $50.00 Per Unit
137
+ </span>
138
+ </p>
139
+ </div>
140
+ <div className='block'>
141
+ <p className='text-[13px] text-colorDefault flex justify-between'>
142
+ <span className='font-medium block'>
143
+ {
144
+ formatMessage({
145
+ id: 'Quotes.adminSuggestedPrice',
146
+ defaultMessage: 'Admin Suggested Price'
147
+ })
148
+ }
149
+ </span>
150
+ <span className='font-normal block'>
151
+ $55.00 Units
152
+ </span>
153
+ </p>
154
+ </div>
155
+ <div className='block'>
156
+ <p className='text-[13px] text-colorDefault flex justify-between'>
157
+ <span className='font-medium block'>
158
+ {
159
+ formatMessage({
160
+ id: 'Quotes.expectedTotal',
161
+ defaultMessage: 'Expected Total'
162
+ })
163
+ }
164
+ </span>
165
+ <span className='font-medium block'>
166
+ $200.00 Units
167
+ </span>
168
+ </p>
169
+ </div>
170
+ <div className='block'>
171
+ <p className='text-[13px] text-colorDefault flex justify-between'>
172
+ <span className='font-medium block'>
173
+ {
174
+ formatMessage({
175
+ id: 'Quotes.adminSuggestedTotal',
176
+ defaultMessage: 'Admin Suggested Total'
177
+ })
178
+ }
179
+ </span>
180
+ <span className='font-normal block'>
181
+ $220.00 Units
182
+ </span>
183
+ </p>
184
+ </div>
185
+ <div className='block'>
186
+ <p className='text-[13px] text-colorDefault flex justify-between'>
187
+ <span className='font-medium block'>
188
+ {
189
+ formatMessage({
190
+ id: 'Quotes.adminAddedCouponCode',
191
+ defaultMessage: 'Admin Added Coupon Code'
192
+ })
193
+ }
194
+ </span>
195
+ <span className='font-normal block'>
196
+ H20
197
+ </span>
198
+ </p>
199
+ <small className='text-[10px] text-gray-600'>
200
+ {
201
+ formatMessage({
202
+ id: 'Quotes.couponCodeNotes',
203
+ defaultMessage: 'You can apply coupon code when checkout order for this quote'
204
+ })
205
+ }
206
+ </small>
207
+ </div>
208
+ <div className='block'>
209
+ <p className='text-[13px] text-colorDefault flex justify-between'>
210
+ <span className='font-medium block'>
211
+ {
212
+ formatMessage({
213
+ id: 'Quotes.seller',
214
+ defaultMessage: 'Seller'
215
+ })
216
+ }
217
+ </span>
218
+ <span className='font-normal block'>
219
+ Gundam Info
220
+ </span>
221
+ </p>
222
+ </div>
223
+ <div className='block'>
224
+ <p className='text-[13px] text-colorDefault flex justify-between'>
225
+ <span className='font-medium block'>
226
+ {
227
+ formatMessage({
228
+ id: 'Quotes.dateNeedQuote',
229
+ defaultMessage: 'Date Need Quote'
230
+ })
231
+ }
232
+ </span>
233
+ <span className='font-normal block'>
234
+ 2024-08-22
235
+ </span>
236
+ </p>
237
+ </div>
238
+ <div className='block'>
239
+ <p className='text-[13px] text-colorDefault flex justify-between'>
240
+ <span className='font-medium block'>
241
+ {
242
+ formatMessage({
243
+ id: 'Quotes.expiryDateForOrder',
244
+ defaultMessage: 'Expiry Date For Create Order'
245
+ })
246
+ }
247
+ </span>
248
+ <span className='font-normal block'>
249
+ 2024-08-30
250
+ </span>
251
+ </p>
252
+ </div>
253
+ </div>
254
+ <div className='relative flex w-full md_w-6/12 justify-center flex-col mb-10 md_mb-0'>
255
+ <Image
256
+ alt='product image'
257
+ className="relative max-w-[300px]"
258
+ src={urlImage}
259
+ classes={{
260
+ root: ' relative self-center mb-5'
261
+ }}
262
+ />
263
+
264
+ <p className='text-[16px] font-medium text-colorDefault text-center'>
265
+ $60.00
266
+ </p>
267
+
268
+ <Link to="/pop-mart-star-wars-series-blind-box-confirmed-figures-designer-art-new-toys-gift.html" className="max-w-[360px] self-center mb-5">
269
+ <span className=" text-[13px] block text-center font-medium text-colorDefault w-full">
270
+ POP MART Star Wars Series Blind Box Confirmed Figures Designer Art New Toys Gift
271
+ </span>
272
+ </Link>
273
+ <Button
274
+ priority='high'
275
+ classes={{
276
+ content: 'capitalize text-[16px] font-semibold'
277
+ }}
278
+ >
279
+ {
280
+ formatMessage({
281
+ id: 'Quotes.addToCart',
282
+ defaultMessage: 'Add To Cart'
283
+ })
284
+ }
285
+ </Button>
286
+ </div>
287
+ </div>
288
+ <div className=' flex flex-col mb-10'>
289
+ <div aria-live="polite" className="text-lg font-medium text-left mb-4">
290
+ Messages
291
+ </div>
292
+ <div className='rounded-md border border-gray-100 p-4 pr-0 pt-0 flex flex-col gap-y-6'>
293
+ <div className='max-h-[600px] overflow-auto relative chat-container pr-4 pt-4'>
294
+ <ChatContent chatData={dummyChat} />
295
+ </div>
296
+ <div className='flex gap-2 pr-4'>
297
+ <textarea
298
+ className='w-full focus-visible_outline-none border border-gray-100 p-1 rounded-md'
299
+ cols={5}
300
+ />
301
+ <Button
302
+ priority='high'
303
+ classes={{
304
+ content: "flex justify-center gap-x-2.5 items-center text-[14px] font-medium capitalize"
305
+ }}
306
+ className={cn(
307
+ "bg-blue-600 px-6 py-2 rounded-full text-white border ",
308
+ "border-blue-600 hover_bg-blue-700 hover_border-blue-700 focus-visible_outline-none"
309
+ )}
310
+ >
311
+ <Send
312
+ size="24"
313
+ className='text-white'
314
+ />
315
+ </Button>
316
+ </div>
317
+ </div>
318
+ </div>
319
+ <style jsx>
320
+ {`
321
+ .chat-container::-webkit-scrollbar {
322
+ width: 8px;
323
+ border-radius: 5px;
324
+ }
325
+
326
+ .chat-container::-webkit-scrollbar-track {
327
+ background: #f2f2f2;
328
+ border-radius: 8px;
329
+ }
330
+
331
+ .chat-container::-webkit-scrollbar-thumb {
332
+ background-color: #c3c3c3;
333
+ border-radius: 20px;
334
+ border: 2px solid #f2f2f2;
335
+ }
336
+ `}
337
+ </style>
338
+ </div>
339
+ )
340
+ }
341
+
342
+ export default quoteDetail
@@ -0,0 +1,14 @@
1
+ import AccountLayout from '@riosst100/pwa-marketplace/src/components/AccountLayout';
2
+ import QuoteDetail from '@riosst100/pwa-marketplace/src/components/RFQPage/quoteDetail';
3
+
4
+ import React from 'react'
5
+
6
+ const index = () => {
7
+ return (
8
+ <AccountLayout>
9
+ <QuoteDetail />
10
+ </AccountLayout>
11
+ )
12
+ }
13
+
14
+ export default index;
@@ -0,0 +1,227 @@
1
+ import React, { useMemo, useEffect } from 'react';
2
+ import { useIntl, FormattedMessage } from 'react-intl';
3
+ import {
4
+ Search as SearchIcon,
5
+ AlertCircle as AlertCircleIcon,
6
+ ArrowRight as SubmitIcon
7
+ } from 'react-feather';
8
+ import { shape, string } from 'prop-types';
9
+ import { Form } from 'informed';
10
+
11
+ import { useToasts } from '@magento/peregrine/lib/Toasts';
12
+ import OrderHistoryContextProvider from '@magento/peregrine/lib/talons/OrderHistoryPage/orderHistoryContext';
13
+ import { useOrderHistoryPage } from '@magento/peregrine/lib/talons/OrderHistoryPage/useOrderHistoryPage';
14
+
15
+ import { useStyle } from '@magento/venia-ui/lib/classify';
16
+ import Button from '@magento/venia-ui/lib/components/Button';
17
+ import Icon from '@magento/venia-ui/lib/components/Icon';
18
+ import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
19
+ import { StoreTitle } from '@magento/venia-ui/lib/components/Head';
20
+ import TextInput from '@magento/venia-ui/lib/components/TextInput';
21
+
22
+ import defaultClasses from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.module.css';
23
+ import OrderRow from './orderRow';
24
+ import ResetButton from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/OrderHistoryPage/resetButton';
25
+ import { SearchNormal } from 'iconsax-react';
26
+ import cn from 'classnames';
27
+
28
+ const errorIcon = (
29
+ <Icon
30
+ src={AlertCircleIcon}
31
+ attrs={{
32
+ width: 18
33
+ }}
34
+ />
35
+ );
36
+ const searchIcon = <Icon src={SearchIcon} size={24} />;
37
+
38
+ const QuoteList = props => {
39
+ const talonProps = useOrderHistoryPage();
40
+ const {
41
+ errorMessage,
42
+ loadMoreOrders,
43
+ handleReset,
44
+ handleSubmit,
45
+ isBackgroundLoading,
46
+ isLoadingWithoutData,
47
+ orders,
48
+ pageInfo,
49
+ searchText
50
+ } = talonProps;
51
+ const [, { addToast }] = useToasts();
52
+ const { formatMessage } = useIntl();
53
+ const PAGE_TITLE = formatMessage({
54
+ id: 'Quotes.pageTitleText',
55
+ defaultMessage: 'Quotes'
56
+ });
57
+ const SEARCH_PLACE_HOLDER = formatMessage({
58
+ id: 'Quotes.search',
59
+ defaultMessage: 'Search by Quote Number'
60
+ });
61
+
62
+ const ordersCountMessage = formatMessage(
63
+ {
64
+ id: 'orderHistoryPage.ordersCount',
65
+ defaultMessage: 'You have {count} orders in your history.'
66
+ },
67
+ { count: orders.length }
68
+ );
69
+
70
+ const classes = useStyle(defaultClasses, props.classes);
71
+
72
+ const orderRows = useMemo(() => {
73
+ return orders.map(order => {
74
+ return <OrderRow key={order.id} order={order} />;
75
+ });
76
+ }, [orders]);
77
+
78
+ const pageContents = useMemo(() => {
79
+ if (isLoadingWithoutData) {
80
+ return <LoadingIndicator />;
81
+ } else if (!isBackgroundLoading && searchText && !orders.length) {
82
+ return (
83
+ <h3 className={classes.emptyHistoryMessage}>
84
+ <FormattedMessage
85
+ id={'orderHistoryPage.invalidOrderNumber'}
86
+ defaultMessage={`Order "${searchText}" was not found.`}
87
+ values={{
88
+ number: searchText
89
+ }}
90
+ />
91
+ </h3>
92
+ );
93
+ } else if (!isBackgroundLoading && !orders.length) {
94
+ return (
95
+ <h3 className={classes.emptyHistoryMessage}>
96
+ <FormattedMessage
97
+ id={'orderHistoryPage.emptyDataMessage'}
98
+ defaultMessage={"You don't have any orders yet."}
99
+ />
100
+ </h3>
101
+ );
102
+ } else {
103
+ return (
104
+ <ul
105
+ className={classes.orderHistoryTable}
106
+ data-cy="OrderHistoryPage-orderHistoryTable"
107
+ >
108
+ {orderRows}
109
+ </ul>
110
+ );
111
+ }
112
+ }, [
113
+ classes.emptyHistoryMessage,
114
+ classes.orderHistoryTable,
115
+ isBackgroundLoading,
116
+ isLoadingWithoutData,
117
+ orderRows,
118
+ orders.length,
119
+ searchText
120
+ ]);
121
+
122
+ const resetButtonElement = searchText ? (
123
+ <ResetButton onReset={handleReset} />
124
+ ) : null;
125
+
126
+ const submitIcon = (
127
+ <SearchNormal size="18" color="#1b1b1b" className='mt-[4px]' />
128
+ );
129
+
130
+ const pageInfoLabel = pageInfo ? (
131
+ <FormattedMessage
132
+ defaultMessage={'Showing {current} of {total}'}
133
+ id={'orderHistoryPage.pageInfo'}
134
+ values={pageInfo}
135
+ />
136
+ ) : null;
137
+
138
+ const loadMoreButton = loadMoreOrders ? (
139
+ <Button
140
+ classes={{ root_lowPriority: classes.loadMoreButton }}
141
+ disabled={isBackgroundLoading || isLoadingWithoutData}
142
+ onClick={loadMoreOrders}
143
+ priority="low"
144
+ >
145
+ <FormattedMessage
146
+ id={'orderHistoryPage.loadMore'}
147
+ defaultMessage={'Load More'}
148
+ />
149
+ </Button>
150
+ ) : null;
151
+
152
+ useEffect(() => {
153
+ if (errorMessage) {
154
+ addToast({
155
+ type: 'error',
156
+ icon: errorIcon,
157
+ message: errorMessage,
158
+ dismissable: true,
159
+ timeout: 10000
160
+ });
161
+ }
162
+ }, [addToast, errorMessage]);
163
+
164
+ return (
165
+ <OrderHistoryContextProvider>
166
+ <div className="grid gap-y-md">
167
+ <StoreTitle>{PAGE_TITLE}</StoreTitle>
168
+ <div aria-live="polite" className="text-xl font-medium text-left">
169
+ {PAGE_TITLE}
170
+ </div>
171
+ {/* <div>
172
+ <div aria-live="polite" aria-label={ordersCountMessage} />
173
+ </div> */}
174
+
175
+ <div className={classes.filterRow}>
176
+ <Form className="flex gap-x-1 border border-gray-100 rounded-full px-[15px] w-[calc(100%-120px)] max-w-[450px]" onSubmit={handleSubmit}>
177
+ <TextInput
178
+ // after={resetButtonElement}
179
+ // before={searchIcon}
180
+ field="search"
181
+ id={classes.search}
182
+ placeholder={SEARCH_PLACE_HOLDER}
183
+ classes={{
184
+ input: 'focus-visible_outline-none border-none w-full'
185
+ }}
186
+ />
187
+ {searchText ? (
188
+ <>
189
+ {resetButtonElement}
190
+ </>
191
+ ) : (
192
+ <Button
193
+ className="focus-visible_outline-none"
194
+ disabled={
195
+ isBackgroundLoading || isLoadingWithoutData
196
+ }
197
+ priority={'high'}
198
+ type="submit"
199
+ aria-label="submit"
200
+ >
201
+ {submitIcon}
202
+ </Button>
203
+ )}
204
+ </Form>
205
+ <span className={classes.pageInfo}>{pageInfoLabel}</span>
206
+ </div>
207
+ {pageContents}
208
+ {loadMoreButton}
209
+ </div>
210
+ </OrderHistoryContextProvider >
211
+ );
212
+ };
213
+
214
+ export default QuoteList;
215
+
216
+ QuoteList.propTypes = {
217
+ classes: shape({
218
+ root: string,
219
+ heading: string,
220
+ emptyHistoryMessage: string,
221
+ orderHistoryTable: string,
222
+ search: string,
223
+ searchButton: string,
224
+ submitIcon: string,
225
+ loadMoreButton: string
226
+ })
227
+ };
package/src/intercept.js CHANGED
@@ -116,6 +116,34 @@ module.exports = targets => {
116
116
  pattern: "/brand",
117
117
  path: require.resolve("./components/BrandLandingPage/index.js"),
118
118
  authed: false,
119
+ },
120
+ {
121
+ exact: true,
122
+ name: "MtgSinglesPage",
123
+ pattern: "/mtg-singles",
124
+ path: require.resolve("./components/MtgSinglesPage/index.js"),
125
+ authed: false,
126
+ },
127
+ {
128
+ exact: true,
129
+ name: "FavoriteSeller",
130
+ pattern: "/favorite-seller",
131
+ path: require.resolve("./components/FavoriteSeller/index.js"),
132
+ authed: true,
133
+ },
134
+ {
135
+ exact: true,
136
+ name: "Quote List",
137
+ pattern: "/quotes",
138
+ path: require.resolve("./components/RFQPage/index.js"),
139
+ authed: true,
140
+ },
141
+ {
142
+ exact: true,
143
+ name: "Quote Detail",
144
+ pattern: "/quotes/:urlKey",
145
+ path: require.resolve("./components/RFQPage/quoteDetailPage.js"),
146
+ authed: true,
119
147
  }
120
148
  ];
121
149
 
@@ -101,7 +101,6 @@ const AuctionDetail = (props) => {
101
101
  </div>
102
102
 
103
103
  <BidList expanded />
104
-
105
104
  <Form
106
105
  data-cy="form_bid"
107
106
  className="flex flex-col gap-y-5"
@@ -35,6 +35,7 @@ import AuctionDetail from './components/auctionDetail';
35
35
  import CrossSeller from '@riosst100/pwa-marketplace/src/components/CrossSeller';
36
36
  import RelatedProduct from '@riosst100/pwa-marketplace/src/components/RelatedProduct';
37
37
  import ProductLabel from '@riosst100/pwa-marketplace/src/components/ProductLabel';
38
+ import RFQ from '@riosst100/pwa-marketplace/src/components/RFQ';
38
39
 
39
40
  // Correlate a GQL error message to a field. GQL could return a longer error
40
41
  // string but it may contain contextual info such as product id. We can use
@@ -576,6 +577,10 @@ const ProductFullDetail = props => {
576
577
  </div>
577
578
  </section>
578
579
  <Divider />
580
+ <section className={cn(classes.quantity, 'py-[30px] !border-none')}>
581
+ <RFQ />
582
+ </section>
583
+ <Divider />
579
584
  <section className='product_from-other-platform py-[30px]'>
580
585
  <div className='text-sm flex mb-5'>
581
586
  Also available in
@@ -0,0 +1 @@
1
+ export { default } from './textArea';