Compare commits

...

219 Commits

Author SHA1 Message Date
victorAnumudu 8f1d2b6584 market category toggle position changed 2023-06-21 10:02:47 +01:00
ameye 3a3503447a Merge branch 'market-list-toggle' of WrenchBoard/Users-Wrench into master 2023-06-20 22:34:26 +00:00
ameye e46d2bea8d Merge branch 'JobList-Categories' of WrenchBoard/Users-Wrench into master 2023-06-20 22:34:15 +00:00
victorAnumudu b05c519571 adjusted market toggle position 2023-06-20 22:48:55 +01:00
victorAnumudu 48ab2d80ad market list toggle added, thumbnail images added in add pay card page 2023-06-20 22:37:18 +01:00
Ebube 47876875cf done 2023-06-20 21:33:18 +01:00
ameye d78ad0b648 Merge branch 'JobList-Categories' of WrenchBoard/Users-Wrench into master 2023-06-20 19:52:15 +00:00
Ebube d63690a43c Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into JobList-Categories 2023-06-20 20:47:36 +01:00
Ebube 3ce97a4b76 . 2023-06-20 20:46:51 +01:00
ameye 6e9af99d46 Merge branch 'paycard-listing' of WrenchBoard/Users-Wrench into master 2023-06-20 19:44:35 +00:00
victorAnumudu 4ce8f813c4 added svg images 2023-06-20 20:22:08 +01:00
victorAnumudu 9163c42d77 API for paycard listing added 2023-06-20 20:15:05 +01:00
CHIEFSOFT\ameye 3b4ce9c99e Production to orion 2023-06-20 12:00:57 -04:00
ameye cfa6117a07 Merge branch 'history-new-layout' of WrenchBoard/Users-Wrench into master 2023-06-20 15:01:40 +00:00
victorAnumudu 6f26e2e88f history layout changed 2023-06-20 15:50:47 +01:00
ameye b7927a9d6a Merge branch 'JobList-Categories' of WrenchBoard/Users-Wrench into master 2023-06-19 22:43:57 +00:00
Ebube 2d366cd103 . 2023-06-19 22:32:18 +01:00
Ebube 6eed7bf1f3 Added Price Formatter to this files 2023-06-19 22:27:01 +01:00
Ebube 3c87a67581 Changed the status and moved the payload to the users-services 2023-06-19 21:47:40 +01:00
Ebube e31ee86299 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into JobList-Categories 2023-06-19 21:25:18 +01:00
Ebube 4d3fe6a799 Joblist cart 2023-06-19 21:24:57 +01:00
CHIEFSOFT\ameye 3e8c8e88ea Correct endpoint settings 2023-06-19 08:24:19 -04:00
ameye feca65eb80 Merge branch 'add-dollar-fund' of WrenchBoard/Users-Wrench into master 2023-06-19 11:45:43 +00:00
victorAnumudu 9ea846bc56 add dollar fund component added 2023-06-19 10:21:50 +01:00
CHIEFSOFT\ameye 8c31eb3145 banner description 2023-06-18 20:05:11 -04:00
ameye d049d1b2b0 Merge branch 'referral_page_payload_fix' of WrenchBoard/Users-Wrench into master 2023-06-18 22:17:02 +00:00
Ebube d34895c64c . 2023-06-18 23:09:18 +01:00
Ebube 9a3fa2a4a4 added fix 2023-06-18 23:06:16 +01:00
Ebube a9d982386c . 2023-06-18 22:46:42 +01:00
ameye 2341d2a17d Merge branch 'offer-interval-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-18 16:45:26 +00:00
ameye 076df9438d Merge branch 'Market-Categories' of WrenchBoard/Users-Wrench into master 2023-06-18 16:45:21 +00:00
Ebube bbf03b2b10 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into Market-Categories 2023-06-18 15:52:19 +01:00
Ebube afead464b0 Done! 2023-06-18 15:51:59 +01:00
victorAnumudu dcdf03e9c5 redirect interval cleared from memory once the page redirects 2023-06-18 13:41:43 +01:00
ameye 44e2402cb3 Merge branch 'offer-interest-process' of WrenchBoard/Users-Wrench into master 2023-06-18 11:58:58 +00:00
victorAnumudu 5c223ba641 margin added to offer interest table 2023-06-18 08:20:29 +01:00
victorAnumudu cc0e2c2c6b offer interest process API added 2023-06-18 08:14:22 +01:00
ameye 3df97c0760 Merge branch 'return-to-wallet-fixed' of WrenchBoard/Users-Wrench into master 2023-06-17 22:29:15 +00:00
ameye 6d742e92b5 Merge branch 'wallet-add-icon' of WrenchBoard/Users-Wrench into master 2023-06-17 22:29:08 +00:00
victorAnumudu 44090c94a1 return to wallet added and add fund style fixed 2023-06-17 23:06:46 +01:00
victorAnumudu 63f4658449 Icon padding fixed 2023-06-17 22:19:57 +01:00
CHIEFSOFT\ameye 552224c489 refer banner 2023-06-17 12:45:17 -04:00
CHIEFSOFT\ameye 134be6a1f0 Add fund page 2023-06-17 08:55:12 -04:00
CHIEFSOFT\ameye fcca050ff6 Add crerdikt style 2023-06-17 08:01:14 -04:00
ameye 197dc2e0bc Merge branch 'interest-page-reformat' of WrenchBoard/Users-Wrench into master 2023-06-17 09:45:35 +00:00
ameye e0f8e8df12 Merge branch 'Move-AddJob-to-Popup' of WrenchBoard/Users-Wrench into master 2023-06-17 09:45:24 +00:00
victorAnumudu b5625ab799 margin adjusted 2023-06-17 08:01:52 +01:00
victorAnumudu 9dc8acc584 manage offer interest reformat 2023-06-17 07:55:26 +01:00
Ebube 6d51fdfc19 popup closes 2023-06-17 06:33:08 +01:00
Ebube 800c62d76f Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into Move-AddJob-to-Popup 2023-06-17 06:21:49 +01:00
Ebube ae23195e0e Changed add job to modal 2023-06-17 06:20:09 +01:00
ameye 4ef9b2f20e Merge branch 'Family-page-Tasks-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-16 14:06:58 +00:00
ameye 709b8ea8f2 Merge branch 'coupon-page-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-16 14:06:51 +00:00
ameye 549af89a43 Merge branch 'faq-page' of WrenchBoard/Users-Wrench into master 2023-06-16 14:06:30 +00:00
Ebube 123ed2056a Family page Tasks 2023-06-16 14:23:54 +01:00
Ebube f04f4c713e . 2023-06-16 13:04:51 +01:00
victorAnumudu 6d16e7f63f faq content add from API 2023-06-16 12:15:08 +01:00
ameye 153bc7ab7d Merge branch 'refferal-style' of WrenchBoard/Users-Wrench into master 2023-06-15 20:37:21 +00:00
victorAnumudu 054688af8b referral layout and style fixed 2023-06-15 21:02:49 +01:00
CHIEFSOFT\ameye 9994ccc26a History page 2023-06-15 12:11:06 -04:00
ameye f5c24ffb0c Merge branch 'other-interest-amendment' of WrenchBoard/Users-Wrench into master 2023-06-15 15:43:20 +00:00
victorAnumudu d5ce5d758a Others interested offer table modified to show only list of persons interest in an offer 2023-06-15 16:31:28 +01:00
ameye 0b14c7675b Merge branch 'pagination-dark-mode' of WrenchBoard/Users-Wrench into master 2023-06-15 10:34:23 +00:00
victorAnumudu 6a3662d69e dark mode style changed for pagination and manage active job 2023-06-15 07:01:41 +01:00
CHIEFSOFT\ameye 8a6c8badbe home banner 2023-06-14 21:19:23 -04:00
ameye 99be0961a9 Merge branch 'interest-processing-page' of WrenchBoard/Users-Wrench into master 2023-06-14 20:00:06 +00:00
victorAnumudu 22bfcbf0c6 interest processing page added 2023-06-14 20:54:14 +01:00
ameye 7975bd3d11 Merge branch 'client-name' of WrenchBoard/Users-Wrench into master 2023-06-14 16:40:19 +00:00
victorAnumudu 5475719e7e client name added and job price formatted to 2 decimal places 2023-06-14 17:36:52 +01:00
ameye 36420a4b47 Merge branch 'offer-interest' of WrenchBoard/Users-Wrench into master 2023-06-14 14:47:11 +00:00
victorAnumudu 6df489a0c2 price and client name added 2023-06-14 15:36:16 +01:00
victorAnumudu 15adddb0ed offer interest list page added 2023-06-14 15:22:54 +01:00
ameye 83e6cef40a Merge branch 'coupon-page-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-14 11:53:42 +00:00
Ebube 4e275da916 Adding a price formatter 2023-06-14 12:44:52 +01:00
ameye 610768f4a5 Merge branch 'pastdue-extension' of WrenchBoard/Users-Wrench into master 2023-06-14 10:23:39 +00:00
victorAnumudu 39e1b05461 duration changed to extension in extend time function payload 2023-06-14 03:42:45 +01:00
CHIEFSOFT\ameye b89cf9a6bc finterest table 2023-06-13 21:17:58 -04:00
ameye 549d61d81b Merge branch 'owner-review-popout' of WrenchBoard/Users-Wrench into master 2023-06-13 23:35:40 +00:00
victorAnumudu 0ba8bbd2e7 owner job cancel action added to payload 2023-06-13 23:20:37 +01:00
victorAnumudu 9bdde5376c popout title renamed 2023-06-13 23:17:09 +01:00
victorAnumudu 8e35839ddf owner review job API added and API name changed 2023-06-13 23:09:55 +01:00
CHIEFSOFT\ameye 4abd8a911b Style fix 2023-06-13 16:24:20 -04:00
ameye a2a9fb2842 Merge branch 'coupon-page-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-13 20:02:53 +00:00
Ebube 9a2fd54bd5 added the redeem coupon api 2023-06-13 20:49:29 +01:00
Ebube d7dbacc69e Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into coupon-page-cleanup 2023-06-13 20:17:42 +01:00
ameye 464969530d Merge branch 'Missing-data-on-Active-Job-Page' of WrenchBoard/Users-Wrench into master 2023-06-13 18:51:24 +00:00
Ebube 7074347289 New Changes to ActiveJobs 2023-06-13 18:26:41 +01:00
Ebube 6a79d6369f Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into Missing-data-on-Active-Job-Page 2023-06-13 18:01:06 +01:00
Ebube 984cdeaa24 Data added 2023-06-13 18:00:40 +01:00
ameye 7946ab12a1 Merge branch 'owner-extend-timeline' of WrenchBoard/Users-Wrench into master 2023-06-13 15:55:46 +00:00
victorAnumudu 392e0394ed API for extend job by owner added 2023-06-13 16:36:28 +01:00
ameye a5d534f364 Merge branch 'worker-task-completed' of WrenchBoard/Users-Wrench into master 2023-06-13 14:30:56 +00:00
ameye 01416ff42c Merge branch 'pastdue-owner-component' of WrenchBoard/Users-Wrench into master 2023-06-13 14:30:44 +00:00
victorAnumudu 976b4afbbf API call for worker task completed added 2023-06-13 15:28:12 +01:00
victorAnumudu 3818e05d2f pastdue popout component added 2023-06-13 14:33:01 +01:00
ameye 5f0364df10 Merge branch 'no-task-background' of WrenchBoard/Users-Wrench into master 2023-06-13 10:46:50 +00:00
Ebube 5810345ca7 Added no task background 2023-06-13 10:31:45 +01:00
Ebube 9adc7eaf1a added redeem api 2023-06-13 09:01:02 +01:00
CHIEFSOFT\ameye 61d8c938e9 getCouponPending 2023-06-12 17:45:57 -04:00
CHIEFSOFT\ameye b96bb061d0 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench
# Conflicts:
#	src/components/MyCoupons/MyCoupons.jsx
2023-06-12 17:45:14 -04:00
CHIEFSOFT\ameye e0a728c5cf Coupon pening 2023-06-12 17:43:07 -04:00
ameye f63e52422d Merge branch 'coupon-page-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-12 21:42:05 +00:00
Ebube 12a56bdb05 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into coupon-page-cleanup 2023-06-12 22:21:08 +01:00
Ebube 7666d78c0b . 2023-06-12 22:20:41 +01:00
ameye 0a0cca7326 Merge branch 'unused-code-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-12 13:21:27 +00:00
ameye 3749fc89db Merge branch 'box-height-fixed' of WrenchBoard/Users-Wrench into master 2023-06-12 13:20:58 +00:00
ameye fcab0acdad Merge branch 'coupon-page-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-12 13:20:38 +00:00
victorAnumudu 497407112c unused code cleaned 2023-06-12 14:10:26 +01:00
Ebube bbbfe799a3 . 2023-06-12 14:01:25 +01:00
victorAnumudu 97bfcd68b5 default height added to box tables 2023-06-12 14:00:45 +01:00
Ebube 7125ce936e . 2023-06-12 13:58:06 +01:00
Ebube a235448897 Cleanup zero 2023-06-12 13:57:07 +01:00
Ebube 36479d1246 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into coupon-page-cleanup 2023-06-12 13:55:52 +01:00
Ebube 134f2fbe9f added slider image for bannerlist in zero state 2023-06-12 13:55:24 +01:00
ameye c1805376ae Merge branch 'coupon-page-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-12 11:12:17 +00:00
Ebube e60a2aaea2 fixed 2023-06-12 12:04:38 +01:00
Ebube 72118cefc4 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into coupon-page-cleanup 2023-06-12 11:52:39 +01:00
Ebube 30131e53c2 cleaned up better 2023-06-12 11:48:46 +01:00
ameye 79361f35f2 Merge branch 'coupon-page-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-12 10:44:40 +00:00
Ebube 8749bf9f55 . 2023-06-12 11:41:25 +01:00
Ebube 4204b94231 corrected bg size and position 2023-06-12 10:55:20 +01:00
Ebube 7b1f27a641 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into coupon-page-cleanup 2023-06-12 10:41:00 +01:00
Ebube e4569ca81f . 2023-06-12 10:40:04 +01:00
ameye 58d0fc3dee Merge branch 'banner-link-alignment' of WrenchBoard/Users-Wrench into master 2023-06-12 07:05:44 +00:00
ameye 2f2777cc05 Merge branch 'interest-count' of WrenchBoard/Users-Wrench into master 2023-06-12 07:05:34 +00:00
ameye e534c81606 Merge branch 'view-all-message' of WrenchBoard/Users-Wrench into master 2023-06-12 07:05:27 +00:00
victorAnumudu e76b589e4d popout top amended 2023-06-12 04:25:27 +01:00
victorAnumudu 1cc0c314a2 banner link aligned 2023-06-12 04:12:23 +01:00
victorAnumudu c01cfa104c Interest count data update 2023-06-12 03:52:30 +01:00
victorAnumudu f5c3922a02 view all message popup added 2023-06-12 03:31:58 +01:00
CHIEFSOFT\ameye 8255eedb00 offer interst starter 2023-06-11 21:25:17 -04:00
CHIEFSOFT\ameye b4ff0b5eca adjust colors 2023-06-11 18:39:05 -04:00
CHIEFSOFT\ameye 120f2c1866 formatingf actoion section 2023-06-11 17:59:04 -04:00
CHIEFSOFT\ameye 7389cf164c extra style 2023-06-11 14:51:24 -04:00
CHIEFSOFT\ameye 3700fe066f dynamic head style 2023-06-11 14:46:23 -04:00
CHIEFSOFT\ameye 5e85697c82 job action 2023-06-11 09:24:12 -04:00
CHIEFSOFT\ameye 5f87c5f36c wallet format 2023-06-11 09:19:45 -04:00
CHIEFSOFT\ameye 66b7d20e43 wallet buttons 2023-06-11 09:03:24 -04:00
CHIEFSOFT\ameye c389e06ae6 Wallet format 2023-06-11 08:49:48 -04:00
ameye 0b83682da7 Merge branch 'pastdue-common-banner' of WrenchBoard/Users-Wrench into master 2023-06-11 11:30:16 +00:00
victorAnumudu 78b14ec797 past due common head banner fixed 2023-06-11 05:35:50 +01:00
CHIEFSOFT\ameye 8b0954c28c fix text 2023-06-10 17:28:46 -04:00
CHIEFSOFT\ameye 15ef592252 Job actions 2023-06-10 17:25:34 -04:00
ameye 4d74946f0d Merge branch 'bug-link-mismatch' of WrenchBoard/Users-Wrench into master 2023-06-10 21:20:48 +00:00
victorAnumudu 78ee32efcc added slash to link href 2023-06-10 22:05:56 +01:00
ameye a2ef201cfd Merge branch 'common-home-banner' of WrenchBoard/Users-Wrench into master 2023-06-10 20:48:08 +00:00
victorAnumudu 746cd00ec4 common home banner head implemented 2023-06-10 21:32:37 +01:00
victorAnumudu 3461b828dd common home banner head implemented 2023-06-10 21:30:31 +01:00
CHIEFSOFT\ameye d0e1a7acd0 Coupon format 2023-06-10 12:33:22 -04:00
CHIEFSOFT\ameye c5d84655a9 Coupon page 2023-06-10 12:29:41 -04:00
CHIEFSOFT\ameye 796f220c1d coupon table 2023-06-10 11:49:43 -04:00
CHIEFSOFT\ameye 99ea92ae99 coupons 2023-06-10 11:14:31 -04:00
CHIEFSOFT\ameye d279e707dc Job actions 2023-06-10 10:38:22 -04:00
CHIEFSOFT\ameye ba8213d120 banner data 2023-06-10 09:07:20 -04:00
CHIEFSOFT\ameye 0933dc8925 fix space 2023-06-09 22:45:05 -04:00
CHIEFSOFT\ameye fe48c962b2 Job filters 2023-06-09 22:21:24 -04:00
CHIEFSOFT\ameye d2738f28d5 header iotem reformat 2023-06-09 22:12:03 -04:00
CHIEFSOFT\ameye 0f17783ab5 Home top slider 2023-06-09 21:55:13 -04:00
CHIEFSOFT\ameye 83f2339a17 top sliders 2023-06-09 21:09:57 -04:00
CHIEFSOFT\ameye 13c0571b92 Review accept 2023-06-08 16:21:01 -04:00
ameye a3e53afd99 Merge branch 'active-worker-job-action' of WrenchBoard/Users-Wrench into master 2023-06-08 20:07:58 +00:00
victorAnumudu 83f9d5a1f4 popup component for worker active job added 2023-06-08 20:57:19 +01:00
CHIEFSOFT\ameye a16d958fa2 Review itemss 2023-06-08 13:27:47 -04:00
ameye 2ffabb63f3 Merge branch 'sidemenu-gap-closed' of WrenchBoard/Users-Wrench into master 2023-06-08 17:09:38 +00:00
victorAnumudu 1d673487af sidemenu abnormal gap closed 2023-06-08 18:00:26 +01:00
CHIEFSOFT\ameye 313c47f430 action contents 2023-06-07 21:42:49 -04:00
ameye 67aaf62f7b Merge branch 'job-actions' of WrenchBoard/Users-Wrench into master 2023-06-07 21:14:55 +00:00
victorAnumudu 0526fdb572 renders job action based on owner status and status description 2023-06-07 22:08:26 +01:00
ameye 7352c30969 Merge branch 'job-actions-components' of WrenchBoard/Users-Wrench into master 2023-06-07 13:54:35 +00:00
victorAnumudu 7079ae963e added job action components 2023-06-07 14:30:25 +01:00
CHIEFSOFT\ameye 9bfe3ce642 Task actions 2023-06-07 08:17:07 -04:00
ameye ff862e72be Merge branch 'market-item-view-popup' of WrenchBoard/Users-Wrench into master 2023-06-07 01:09:25 +00:00
CHIEFSOFT\ameye a1dc63e958 blog item 2023-06-06 19:38:02 -04:00
Ebube 465e0745ec Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into market-item-view-popup 2023-06-07 00:35:58 +01:00
Ebube e8789e7be6 . 2023-06-07 00:35:35 +01:00
ameye e84d583958 Merge branch 'passdue-countdown-hidden' of WrenchBoard/Users-Wrench into master 2023-06-06 20:17:39 +00:00
victorAnumudu 06549bf9bb Displays countdown if task is yet to pass due, else displays due time 2023-06-06 20:52:15 +01:00
ameye 2cd7ce9392 Merge branch 'active-task-header-upgrade' of WrenchBoard/Users-Wrench into master 2023-06-06 18:14:47 +00:00
CHIEFSOFT\ameye 835b583056 past due pages 2023-06-06 13:33:43 -04:00
CHIEFSOFT\ameye b72d9ccc35 past due jobs 2023-06-06 12:34:18 -04:00
CHIEFSOFT\ameye 225166a8be Home banners background 2023-06-06 12:05:45 -04:00
CHIEFSOFT\ameye b54a6fbee2 past due jobs 2023-06-06 11:19:11 -04:00
victorAnumudu db03242886 active task header count down added 2023-06-06 15:51:36 +01:00
ameye 07c20fd927 Merge branch 'market-item-view-popup' of WrenchBoard/Users-Wrench into master 2023-06-06 10:39:39 +00:00
Ebube c706b5c143 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into market-item-view-popup 2023-06-06 11:07:31 +01:00
Ebube 294f6af6e4 Complete 2023-06-06 11:07:08 +01:00
ameye 76603294a3 Merge branch 'market-item-view-popup' of WrenchBoard/Users-Wrench into master 2023-06-06 01:37:41 +00:00
Ebube 5ff9876681 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into market-item-view-popup 2023-06-06 01:35:15 +01:00
Ebube aba23e82a1 . 2023-06-06 01:34:48 +01:00
ameye 7175c217b2 Merge branch 'home_current_task' of WrenchBoard/Users-Wrench into master 2023-06-05 20:58:26 +00:00
victorAnumudu 8a81e6da54 user currect task due time implementation 2023-06-05 19:24:54 +01:00
ameye 36ee1e8987 Merge branch 'market-item-view-popup' of WrenchBoard/Users-Wrench into master 2023-06-05 10:55:18 +00:00
Ebube b73a6afeac Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into market-item-view-popup 2023-06-05 11:45:08 +01:00
Ebube 721c5a588f . 2023-06-05 11:44:40 +01:00
ameye a2431ff825 Merge branch 'no-family-display' of WrenchBoard/Users-Wrench into master 2023-06-05 08:36:45 +00:00
victorAnumudu 692fe461c3 No family display design added 2023-06-05 03:12:46 +01:00
ameye 3f84eef132 Merge branch 'multi-upload' of WrenchBoard/Users-Wrench into master 2023-06-05 01:50:31 +00:00
victorAnumudu 119f48642d implemented multi file upload 2023-06-05 02:48:22 +01:00
ameye 1a0f97030f Merge branch 'market-item-view-popup' of WrenchBoard/Users-Wrench into master 2023-06-05 01:08:38 +00:00
CHIEFSOFT\ameye 71d1b61bbd Single file send 2023-06-04 17:43:38 -04:00
Ebube 17ffe957e8 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into market-item-view-popup 2023-06-04 20:40:18 +01:00
Ebube e23aa95685 . 2023-06-04 20:32:29 +01:00
ameye 1c1293989b Merge branch 'width-adjustment' of WrenchBoard/Users-Wrench into master 2023-06-04 18:27:25 +00:00
victorAnumudu 63448429b2 width adjusted 2023-06-04 19:14:08 +01:00
ameye 8d1eac9ff6 Merge branch 'familytasks' of WrenchBoard/Users-Wrench into master 2023-06-04 17:21:21 +00:00
Ebube 25e5c3f47a Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into familytasks 2023-06-04 15:01:03 +01:00
Ebube 9f9c36ec85 . 2023-06-04 14:59:54 +01:00
CHIEFSOFT\ameye 05eb1a020d Activities on home page 2023-06-04 08:40:38 -04:00
ameye 30d344833c Merge branch 'pending-jobs-pop-apis' of WrenchBoard/Users-Wrench into master 2023-06-04 12:14:58 +00:00
CHIEFSOFT\ameye acdf167a69 List page 2023-06-03 22:56:27 -04:00
Ebube fd00113aab Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into pending-jobs-pop-apis 2023-06-04 02:23:49 +01:00
Ebube 8765329256 . 2023-06-04 02:13:00 +01:00
Ebube 3b9c0987b8 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into pending-jobs-pop-apis 2023-06-04 00:40:05 +01:00
Ebube 0304eaa328 . 2023-06-04 00:39:17 +01:00
ameye 85ac8d183c Merge branch 'fileupload_implementation' of WrenchBoard/Users-Wrench into master 2023-06-03 16:26:04 +00:00
victorAnumudu 1aa0fc6016 file upload implementation 2023-06-03 17:20:04 +01:00
Ebube 18b85e0ec9 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into pending-jobs-pop-apis 2023-06-03 17:08:13 +01:00
Ebube 024c8bbed1 . 2023-06-03 17:07:34 +01:00
ameye 865c61f393 Merge branch 'upload-API' of WrenchBoard/Users-Wrench into master 2023-06-03 12:15:19 +00:00
110 changed files with 7055 additions and 3630 deletions
+5 -4
View File
@@ -9,15 +9,16 @@ REACT_APP_APPSITE="https://myfitapp.mermsemr.com"
# REACT_APP_AUX_ENDPOINT="http://10.20.30.32:9083/svs/user"
# REACT_APP_USERS_ENDPOINT="http://10.20.30.32:9083/svs/user"
REACT_APP_AUX_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/svs/user"
REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/svs/user"
#REACT_APP_AUX_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/svs/user"
#REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/svs/user"
#REACT_APP_AUX_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1"
#REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1"
REACT_APP_AUX_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1"
REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1"
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
REACT_APP_SESSION_EXPIRE_MINUTES=300000
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
REACT_APP_SESSION_EXPIRE_CHECKER=60000
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
+5 -4
View File
@@ -9,15 +9,16 @@ REACT_APP_APPSITE="https://myfitapp.mermsemr.com"
# REACT_APP_AUX_ENDPOINT="http://10.20.30.32:9083/svs/user"
# REACT_APP_USERS_ENDPOINT="http://10.20.30.32:9083/svs/user"
REACT_APP_AUX_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/svs/user"
REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/svs/user"
# REACT_APP_AUX_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/svs/user"
# REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/svs/user"
#REACT_APP_AUX_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1"
#REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1"
REACT_APP_AUX_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1"
REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1"
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
REACT_APP_SESSION_EXPIRE_MINUTES=300000
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
REACT_APP_SESSION_EXPIRE_CHECKER=60000
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
+6 -6
View File
@@ -9,15 +9,16 @@ REACT_APP_APPSITE="https://myfitapp.mermsemr.com"
# REACT_APP_AUX_ENDPOINT="http://10.20.30.32:9083/svs/user"
# REACT_APP_USERS_ENDPOINT="http://10.20.30.32:9083/svs/user"
REACT_APP_AUX_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/svs/user"
REACT_APP_USERS_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/svs/user"
#REACT_APP_AUX_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/svs/user"
#REACT_APP_USERS_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/svs/user"
#REACT_APP_AUX_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/en/wrench/api/v1"
#REACT_APP_USERS_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/en/wrench/api/v1"
REACT_APP_AUX_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/en/wrench/api/v1"
REACT_APP_USERS_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/en/wrench/api/v1"
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
REACT_APP_SESSION_EXPIRE_MINUTES=300000
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
REACT_APP_SESSION_EXPIRE_CHECKER=60000
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
@@ -42,5 +43,4 @@ REACT_APP_GOOGLE_REDIRECT_URL=https://users.wrenchboard.com/login/auth/
DISABLE_ESLINT_PLUGIN=true
REACT_APP_MAX_FILE_SIZE=1000000
REACT_APP_TOTAL_NUM_FILE=4
REACT_APP_TOTAL_NUM_FILE=4
+12
View File
@@ -40,6 +40,11 @@ import ManageActiveJobs from "./views/ManageActiveJobs";
import FamilyManagePage from "./views/FamilyManagePage";
import MyCouponPage from "./views/MyCouponPage";
import AuthRedirect from "./views/AuthRedirect";
import MyPastDueJobsPage from "./views/MyPastDueJobsPage";
import BlogPage from "./views/BlogPage";
import MyReviewDueJobsPage from "./views/MyReviewDueJobsPage";
import OffersInterestPage from "./views/OffersInterestPage";
import ManageInterestOfferPage from './views/ManageInterestOfferPage'
export default function Routers() {
return (
@@ -86,11 +91,18 @@ export default function Routers() {
<Route exact path="/myjobs" element={<MyJobsPage />} />
<Route exact path="/add-job" element={<AddJobPage />} />
<Route exact path="/my-active-jobs" element={<MyActiveJobsPage />} />
<Route exact path="/my-pastdue-jobs" element={<MyPastDueJobsPage />} />
<Route exact path="/my-pending-jobs" element={<MyPendingJobsPage />} />
<Route exact path="/my-review-jobs" element={<MyReviewDueJobsPage />} />
<Route exact path="/acc-family" element={<FamilyAccPage />} />
<Route exact path="/manage-family" element={<FamilyManagePage />} />
<Route exact path="/start-job" element={<StartJob />} />
<Route exact path="/manage-active-job" element={<ManageActiveJobs />} />
<Route exact path="/blog-page" element={<BlogPage />} />
<Route exact path="/offer-interest" element={<OffersInterestPage />} />
<Route exact path="/manage-offer" element={<ManageInterestOfferPage />} />
<Route
exact
path="/my-collection/collection-item"
Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

+9
View File
@@ -0,0 +1,9 @@
<svg width="905" height="575" viewBox="0 0 905 575" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect width="905" height="575" fill="url(#pattern0)"/>
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_201_3" transform="matrix(0.00849979 0 0 0.0131639 -0.0662984 -0.354783)"/>
</pattern>
<image id="image0_201_3" width="130" height="130" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAACCCAMAAAC93eDPAAAApVBMVEX///82OzgAAAAuMi81OjdVXVfqpQCzs7NCSUSwsbAaIBslKyjk5OQuNDAhJiLZ2tpJT0opNTkvNzloVy31rAC1hRtPV1HNzc34+PgaLztBQUHLkg9UVFTw8PDGxsaioqKampp/f39sbGyIiIgaGho9Qj5MTExeXl5fUi+9vb03Nzd2dnYjIyORkZFjZWMNFQ9CQTWYcyLAjBSsfx12XytSSjEQEBBeBsYmAAAEiklEQVR4nO3a7XaqOBQG4BjoQXRraKc1GUoSPgQaETszZ473f2kTqm0VsKLLYs80b3+UhQgPOwlBESETExMTExMTExMTExMTk/9HQDk9xHUdcgiwmk7HPWQ0Gj0HrQiaWvagh9iWztSiTQH3rD4AW4I19nmDUI77EWwJ1ihpENJeWuGdYE0afXHSN2EMdUI/fXGHMK0Piv6rcJhg39VyadpRwt3g6Y+9PNl3/RLsvx7va3kcXLYOxwh/Ptz/qOX+79t+CY91wY8fD4ZgCIbwvQn/NAT3P/sl3P3bENz/uuwkcXSaun162M/PX5ctQofJ+u62lgtPlL/HLYshGIIhfDGC3chZ65ur7c6EYSN2+/r0wPYvn4/ttH19B4Lt3TRSGexZc316YP3LgZrrZ9sqTK5PsK7fEMcJn90d7eOEz84XIEyuT7CuTrCvT5hcn2BdnWBfnbAj+CaEtyvizrXROpfQOu0fAwyGnucN9X89XeiltPrebnIuwU5nO+n2dbmdbqfH1B6+Le02w4mEvYnX60J4PW61/fukb51PGO4SulWheRehMecTTu8LbTc+NzMvPZ9wctrupW505+yR0NYOelR41yVUgq5VaLnjOvmy0GyIStC5L6RH0okwbBN4g06ExpubFe00JPbKMNsIOl4XWofT6YTB4HU/3mDWLjjpc8RevE4APSF4VSFmQ31VTl8AqdWZcInuuEFUHWczLdgDuw7o637BnjSP/AHh8o9KPwR8fhXslsrXCfUHxpd8bH7k9LdpPDZHyajL+y6XUdQggD/uUzAeNNoBIWpN+xNMJy0/JNF1mD2Pespz0FKDDcJxe4k6BDAxMTExMTH5kunjZ8cfB+Gr53sTluE7YQ0gBSGrBEgEROIcCA0oVnEEkFfbCp44ZUYDAhLjiGAKCiugmASlXAGMa/teEBCLHCCSYZmEofBlqUIcACQ44r4PoJbVZnOk3ghzFPlMujyEbIViH8es4C6LSAKuAP16gaqlAlwomY9DVrCElSjhCVfSAYe6NYLPSq6oCFmohFIhl64kLqYkZEuFogzlqMSZEPo2nr4TijVLQk1YBihYa0IGigMNeZRF+vUcFTiGkiqxTpa45BIWUjIfQs4dh8KiXmGfBZQSqc9EACExsBcCuDHyKXd8hLmu9GY8wvKVADHnKJZIBIis8AoByTnoc4k2Z6hPeYlUKIRUfkXgcxxpQskBqTlhywYh3xB8DkRvByysCE6McghptiGwjYG+EgLMSigkwQHS5xTzAGdQIk2QVUP4q5BlnOVC5PqVqgq+cF+qkCCV64odICCMqEBLvadwW4UYCcj3quC/E1BElS5wjlaLqiFwwHUPAf2ho1jhGCUso2jh8IgFVV9ACSpRxBO2Ig4oShuEgju6ZJrgKraEgEmilrovaHKk/wKUbPsCmb+OCJphEReioDTRG+JAl9tXa7mKiZLSxWtJEpyo+ZwKx8eFwEoPG71XLLKo9Cmtd4aFomrp616gB1Xhrp0sSiQlmSBx4uLqKHK+GRHibUR8mCQ4tsW5mUrcjfD5+QKE/wC0yMO17JCUyAAAAABJRU5ErkJggg=="/>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" ?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg fill="#000000" width="800px" height="800px" viewBox="0 0 52 52" data-name="Layer 1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"><path d="M14,16H2a2,2,0,0,1-2-2V2A2,2,0,0,1,2,0H14a2,2,0,0,1,2,2V14A2,2,0,0,1,14,16ZM4,12h8V4H4Z"/><path d="M14,34H2a2,2,0,0,1-2-2V20a2,2,0,0,1,2-2H14a2,2,0,0,1,2,2V32A2,2,0,0,1,14,34ZM4,30h8V22H4Z"/><path d="M14,52H2a2,2,0,0,1-2-2V38a2,2,0,0,1,2-2H14a2,2,0,0,1,2,2V50A2,2,0,0,1,14,52ZM4,48h8V40H4Z"/><path d="M32,16H20a2,2,0,0,1-2-2V2a2,2,0,0,1,2-2H32a2,2,0,0,1,2,2V14A2,2,0,0,1,32,16ZM22,12h8V4H22Z"/><path d="M32,34H20a2,2,0,0,1-2-2V20a2,2,0,0,1,2-2H32a2,2,0,0,1,2,2V32A2,2,0,0,1,32,34ZM22,30h8V22H22Z"/><path d="M32,52H20a2,2,0,0,1-2-2V38a2,2,0,0,1,2-2H32a2,2,0,0,1,2,2V50A2,2,0,0,1,32,52ZM22,48h8V40H22Z"/><path d="M50,16H38a2,2,0,0,1-2-2V2a2,2,0,0,1,2-2H50a2,2,0,0,1,2,2V14A2,2,0,0,1,50,16ZM40,12h8V4H40Z"/><path d="M50,34H38a2,2,0,0,1-2-2V20a2,2,0,0,1,2-2H50a2,2,0,0,1,2,2V32A2,2,0,0,1,50,34ZM40,30h8V22H40Z"/><path d="M50,52H38a2,2,0,0,1-2-2V38a2,2,0,0,1,2-2H50a2,2,0,0,1,2,2V50A2,2,0,0,1,50,52ZM40,48h8V40H40Z"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.6 KiB

+76 -92
View File
@@ -1,13 +1,10 @@
import React, { useState, useEffect } from "react";
import { Link, useNavigate } from "react-router-dom";
import { Link } from "react-router-dom";
import InputCom from "../Helpers/Inputs/InputCom";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import usersService from "../../services/UsersService";
import { useSelector, useDispatch } from "react-redux";
import { tableReload } from '../../store/TableReloads'
import { tableReload } from "../../store/TableReloads";
import { Field, Form, Formik } from "formik";
import * as Yup from "yup";
@@ -36,18 +33,15 @@ const validationSchema = Yup.object().shape({
.typeError("you must specify a number")
.min(1, "Price must be greater than 0")
.required("Timeline is required"),
category: Yup.array().min(1, "Select at least one checkbox"),
});
function AddJob() {
function AddJob({ popUpHandler, categories }) {
const ApiCall = new usersService();
const navigate = useNavigate();
let dispatch = useDispatch()
let dispatch = useDispatch();
let { userDetails } = useSelector((state) => state.userDetails);
let [pageLoading, setPageLoading] = useState(true); // State used for knowing when the page is mounting
let [country, setCountry] = useState({
loading: true,
status: false,
@@ -62,6 +56,7 @@ function AddJob() {
description: "",
job_detail: "",
timeline_days: "",
category: [],
};
let [requestStatus, setRequestStatus] = useState({
@@ -92,6 +87,7 @@ function AddJob() {
// FUNCTION TO HANDLE ADD JOB FORM
const handleAddJob = (values, helpers) => {
values.category = values.category?.join("@");
setRequestStatus({ loading: true, status: false, message: "" });
ApiCall.jobManagerCreateJob(values)
.then((res) => {
@@ -109,8 +105,8 @@ function AddJob() {
message: "Job Added Successfully",
});
setTimeout(() => {
dispatch(tableReload({type:'JOBTABLE'}))
navigate("/myjobs", { replace: true });
dispatch(tableReload({ type: "JOBTABLE" }));
popUpHandler();
}, 1000);
})
.catch((err) => {
@@ -129,16 +125,10 @@ function AddJob() {
useEffect(() => {
getUserCountry();
setPageLoading(false);
}, []);
return pageLoading.loading ? (
<div className="personal-info-tab w-full flex flex-col justify-between">
<div className="p-3">
<LoadingSpinner size="32" color="sky-blue" />
</div>
</div>
) : (
return (
<div className="add-job p-5 w-full bg-white rounded-md flex flex-col justify-between">
<Formik
initialValues={initialValues}
@@ -148,27 +138,12 @@ function AddJob() {
{(props) => {
return (
<Form>
<h1 className="py-2 my-4 text-lg md:text-xl font-bold tracking-wide">
Create New Job
</h1>
<div className="flex flex-col-reverse sm:flex-row">
<div className="fields w-full">
{/* inputs starts here */}
{/* country */}
<div className="xl:flex xl:space-x-7 mb-6">
<div className="xl:flex xl:space-x-7 mb-[5px]">
<div className="field w-full mb-6 xl:mb-0">
{/* <InputCom
fieldClass="px-6 cursor-not-allowed"
label="Country"
labelClass='tracking-wide'
inputBg = 'bg-slate-100'
type="text"
name="country"
disable={true}
value={country.loading ? 'loading' : country.data ? country.data : 'no country found!'}
inputHandler={(e)=> setCountry((prev) => ({...prev, data:e.target.value}))}
/> */}
<label
htmlFor="country"
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
@@ -213,11 +188,6 @@ function AddJob() {
</option>
)}
</select>
{props.errors.country && props.touched.country && (
<p className="text-sm text-red-500">
{props.errors.country}
</p>
)}
</div>
{/* Price */}
@@ -233,18 +203,14 @@ function AddJob() {
value={props.values.price}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
errorBorder={props.errors.price && props.touched.price}
/>
{props.errors.price && props.touched.price && (
<p className="text-sm text-red-500">
{props.errors.price}
</p>
)}
</div>
</div>
{/* Title */}
<div className="field w-full mb-6">
<div className="field w-full mb-[5px]">
<InputCom
fieldClass="px-6"
label="Title"
@@ -252,20 +218,15 @@ function AddJob() {
inputBg="bg-slate-100"
type="text"
name="title"
// placeholder="Enter Job Title"
value={props.values.title}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
errorBorder={props.errors.title && props.touched.title}
/>
{props.errors.title && props.touched.title && (
<p className="text-sm text-red-500">
{props.errors.title}
</p>
)}
</div>
{/* Description */}
<div className="field w-full mb-6">
<div className="field w-full mb-[5px]">
<InputCom
fieldClass="px-6"
label="Description"
@@ -273,44 +234,70 @@ function AddJob() {
inputBg="bg-slate-100"
type="text"
name="description"
// placeholder="Enter a description"
value={props.values.description}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
errorBorder={props.errors.description && props.touched.description}
/>
{props.errors.description && props.touched.description && (
<p className="text-sm text-red-500">
{props.errors.description}
</p>
)}
</div>
{/* Details */}
<div className="field w-full mb-6">
<label
htmlFor="Job Delivery Details"
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"'
>
Job Delivery Details
</label>
<textarea
id="Job Delivery Details"
rows="7"
className={`input-field p-6 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-full bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
style={{ resize: "none" }}
name="job_detail"
value={props.values.job_detail}
onChange={props.handleChange}
onBlur={props.handleBlur}
/>
{props.errors.job_detail && props.touched.job_detail && (
<p className="text-sm text-red-500">
{props.errors.job_detail}
</p>
)}
<div className="field flex flex-col sm:flex-row w-full mb-[5px] gap-2">
<div className="sm:w-[60%] w-full">
<label
htmlFor="Job Delivery Details"
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"'
>
Job Delivery Details
</label>
<textarea
id="Job Delivery Details"
rows="5"
className={`input-field px-6 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] border border-[#dce4e9] rounded-[10px]`}
style={{ resize: "none" }}
name="job_detail"
value={props.values.job_detail}
onChange={props.handleChange}
onBlur={props.handleBlur}
/>
</div>
<div className="sm:w-[35%] w-full">
<div
htmlFor="Job Categories"
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"'
id="checked-group"
>
Categories
</div>
<div
className="sm:flex-col flex flex-wrap px-3 mt-3"
role="group"
aria-labelledby="checked-group"
>
{Object.entries(categories).map(([key, value]) => (
<label key={key} className="flex gap-1 w-full items-center">
<Field
type="checkbox"
name="category"
value={key}
/>
<span className="text-[13.975px]">{value}</span>
</label>
))}
</div>
</div>
{/* <div className={`${!props.errors && "invisible"} h-5`}>
{props.errors.job_detail && props.touched.job_detail && (
<p className="text-sm text-red-500">
{props.errors.job_detail}
</p>
)}
</div> */}
</div>
<div className="field w-full mb-6">
<div className="field w-full mb-[5px]">
<div className={`flex items-center justify-between mb-2.5`}>
<label
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
@@ -339,12 +326,6 @@ function AddJob() {
</option>
))}
</Field>
{props.errors.timeline_days &&
props.touched.timeline_days && (
<p className="text-sm text-red-500">
{props.errors.timeline_days}
</p>
)}
</div>
{/* inputs ends here */}
</div>
@@ -371,13 +352,16 @@ function AddJob() {
))}
{/* End of error or success display */}
<div className="w-full h-[120px] border-t border-light-purple dark:border-[#5356fb29] flex justify-end items-center">
<div className="w-full h-[70px] border-t border-light-purple dark:border-[#5356fb29] flex justify-end items-center">
<div className="flex items-center space-x-4 mr-9">
<Link
to="/myjobs"
className="text-18 text-light-red tracking-wide "
>
<span className="border-b dark:border-[#5356fb29] border-light-red">
<span
className="border-b dark:border-[#5356fb29] border-light-red"
onClick={popUpHandler}
>
{" "}
Cancel
</span>
+1 -1
View File
@@ -131,7 +131,7 @@ export default function Login() {
ux_mode:'redirect',
redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
onSuccess: async (codeResponse) => {
console.log(codeResponse);
console.log("GOOGLE LOGIN GOOD --- ",codeResponse);
},
onError: (errorResponse) => console.log(errorResponse),
});
+40
View File
@@ -0,0 +1,40 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import Layout from "../Partials/Layout";
import CommonHead from "../UserHeader/CommonHead";
export default function BlogItem(props) {
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
};
return (
<Layout>
<CommonHead
commonHeadData={props.commonHeadData}
/>
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Title of this Blog Items
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
</div>
</div>
<div>
Blog Items Details
</div>
</div>
</div>
</Layout>
);
}
+215 -98
View File
@@ -1,118 +1,235 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import { toast } from "react-toastify";
import localImgLoad from "../../lib/localImgLoad";
import Icons from "../Helpers/Icons";
import { useCallback, useEffect, useMemo, useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import MarketPopUp from "../MarketPlace/PopUp/MarketPopUp";
import usersService from "../../services/UsersService";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import dataImage2 from "../../assets/images/data-table-user-2.png";
export default function AvailableJobsCard({
className,
datas,
hidden = false,
contentDisplay
}) {
//debugger;
const [addFavorite, setValue] = useState(datas.whishlisted);
const [options, setOption] = useState(false);
const favoriteHandler = () => {
if (!addFavorite) {
setValue(true);
toast.success("Added to Favorite List");
} else {
setValue(false);
toast.warn("Remove to Favorite List");
const [marketPopUp, setMarketPopUp] = useState({ show: false, data: {} });
const [manageInt, setManageInt] = useState(null);
const [imageUrl, setImageUrl] = useState("");
const navigate = useNavigate();
const apiCall = useMemo(() => new usersService(), []);
const marketInterestData = useCallback(async () => {
let { offer_code } = datas;
let reqData = { offer_code };
try {
const manageInt = await apiCall.MarketInterest(reqData);
const manageIntRes = await manageInt?.data;
setManageInt(manageIntRes);
} catch (error) {
throw new Error(error);
}
};
}, [apiCall, datas]);
let thePrice = PriceFormatter(
datas?.price * 0.01,
datas?.currency_code,
datas?.currency
);
useEffect(() => {
if (!datas) {
navigate("/market", { replace: true });
}
marketInterestData();
}, []);
useEffect(() => {
const imagePath = require(`../../assets/images/${datas.thumbnil}`); // Replace with your directory path for local images
setImageUrl(imagePath);
}, []);
return (
<div
className={`card-style-two w-full h-[426px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
className || ""
}`}
>
<div className="flex flex-col justify-between w-full h-full">
<Link to="/shop-details" className="mb-2.5">
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{datas.title}
</h1>
</Link>
<>
{contentDisplay == 'grid' ?
<div
className={`card-style-two w-full h-[426px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
className || ""
}`}
>
<div className="flex flex-col justify-between w-full h-full">
<Link to="/shop-details" className="mb-2.5">
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{datas.title}
</h1>
</Link>
<div className="card-two-info flex justify-between items-center">
<div className="owned-by flex space-x-2 items-center">
<div>
<p className="text-thin-light-gray text-sm leading-3">Added</p>
<p className="text-base text-dark-gray dark:text-white">
{datas.offer_added}
</p>
</div>
</div>
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
<div className="created-by flex space-x-2 items-center flex-row-reverse">
<div>
<p className="text-thin-light-gray text-sm leading-3 text-right">
Expires
</p>
<p className="text-base text-dark-gray dark:text-white text-right">
{datas.expire}
</p>
</div>
</div>
</div>
<div className="thumbnail-area w-full">
<div
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
style={{
background: `url(${localImgLoad(
`images/${datas.thumbnil}`
)}) 0% 0% / cover no-repeat`,
}}
>
<div className="flex justify-center">{datas.description}</div>
</div>
</div>
<div className="details-area">
<div className="product-two-options flex justify-between mb-5 relative">
{/* <div className="status">*/}
{/* {datas.isActive && (*/}
{/* <span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">*/}
{/* Active*/}
{/*</span>*/}
{/* )}*/}
{/* </div>*/}
{/*<div className=" review flex space-x-2">*/}
{/* <button*/}
{/* onClick={favoriteHandler}*/}
{/* type="button"*/}
{/* className={`w-7 h-7 bg-white rounded-full flex justify-center items-center ${*/}
{/* addFavorite ? "text-red-500" : "text-thin-light-gray"*/}
{/* }`}*/}
{/* >*/}
{/* <Icons name="star" />*/}
{/* </button>*/}
{/*</div>*/}
</div>
<div className="flex justify-between">
<div className="flex items-center space-x-2">
<div className="card-two-info flex justify-between items-center">
<div className="owned-by flex space-x-2 items-center">
<div>
<p className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white">
{datas.price * 0.01}
{datas.currency} | {datas.timeline_days} day(s)
</p>
<p className="text-sm text-lighter-gray">
( {datas.offer_code})
<p className="text-thin-light-gray text-sm leading-3">Added</p>
<p className="text-base text-dark-gray dark:text-white">
{datas.offer_added}
</p>
</div>
</div>
<div>
<button
type="button"
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
>
View
</button>
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
<div className="created-by flex space-x-2 items-center flex-row-reverse">
<div>
<p className="text-thin-light-gray text-sm leading-3 text-right">
Expires
</p>
<p className="text-base text-dark-gray dark:text-white text-right">
{datas.expire}
</p>
</div>
</div>
</div>
<div className="thumbnail-area w-full">
<div
className="w-full h-[236px] p-6 rounded-xl overflow-hidden bg-center bg-cover bg-no-repeat"
style={{
backgroundImage: `url('${imageUrl}')`,
}}
>
<div className="flex justify-center">{datas.description}</div>
</div>
</div>
<div className="details-area">
<div className="product-two-options flex justify-between mb-5 relative">
{/* <div className="status">*/}
{/* {datas.isActive && (*/}
{/* <span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">*/}
{/* Active*/}
{/*</span>*/}
{/* )}*/}
{/* </div>*/}
{/*<div className=" review flex space-x-2">*/}
{/* <button*/}
{/* onClick={favoriteHandler}*/}
{/* type="button"*/}
{/* className={`w-7 h-7 bg-white rounded-full flex justify-center items-center ${*/}
{/* addFavorite ? "text-red-500" : "text-thin-light-gray"*/}
{/* }`}*/}
{/* >*/}
{/* <Icons name="star" />*/}
{/* </button>*/}
{/*</div>*/}
</div>
<div className="flex justify-between">
<div className="flex items-center space-x-2">
<div>
<p className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white">
{/* {thePrice} | {datas.timeline_days} day(s) */}
{thePrice}
</p>
<p className="text-sm text-lighter-gray">
( {datas.offer_code}) |
<span className="italic ml-1">
{datas.timeline_days} day(s)
</span>
</p>
</div>
</div>
<div>
<button
type="button"
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
onClick={() => {
setMarketPopUp({ show: true, data: datas });
}}
>
View
</button>
</div>
</div>
</div>
</div>
</div>
</div>
:
<div className="card-style-two w-full p-8 my-2 flex items-center gap-4 bg-white dark:bg-dark-white rounded-2xl section-shadow">
<div className="flex gap-5 items-center w-full">
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] min-w-[60px] max-w-[60px]">
<img src={dataImage2} alt="data" className="w-full h-full" />
</div>
<div className="flex flex-col flex-[0.9]">
<Link to="/shop-details" className="">
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{datas?.title}
</h1>
</Link>
<div className="my-2">
<p className="text-dark-gray dark:text-white">{datas?.description}</p>
</div>
{/* <div className="card-two-info flex gap-2 items-center">
<div className="owned-by flex space-x-2 items-center">
<div>
<p className="text-thin-light-gray text-sm leading-3">Added</p>
<p className="text-base text-dark-gray dark:text-white">
{datas.offer_added}
</p>
</div>
</div>
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
<div className="created-by flex space-x-2 items-center flex-row-reverse">
<div>
<p className="text-thin-light-gray text-sm leading-3 text-right">
Expires
</p>
<p className="text-base text-dark-gray dark:text-white text-right">
{datas.expire}
</p>
</div>
</div>
</div> */}
<div className="block sm:flex flex-wrap gap-4">
<p className="text-sm text-thin-light-gray">
Price: <span className="text-purple">{thePrice}</span>
</p>
<p className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple italic">
{" "}
{datas?.timeline_days} day(s)
</span>
</p>
<p className="text-sm text-thin-light-gray">
Code:{" "}
<span className="text-purple">
{" "}
{datas?.offer_code}
</span>
</p>
</div>
</div>
</div>
<div className="">
<button
type="button"
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
onClick={() => {
setMarketPopUp({ show: true, data: datas });
}}
>
View
</button>
</div>
</div>
}
{marketPopUp.show && (
<MarketPopUp
details={datas}
onClose={() => {
setMarketPopUp({ show: false, data: {} });
}}
situation={marketPopUp.show}
marketInt={manageInt}
/>
)}
</>
);
}
+38 -36
View File
@@ -1,42 +1,44 @@
import React from "react";
import React, { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import localImgLoad from "../../lib/localImgLoad";
export default function HomeBannerOffersCard(props) {
console.log("HomeBannerOffersCard-> ##->",props)
const link_result = "/" + props.itemData.link_path;
var imgUrl = props.itemData.banner; // ? this.state.nextImgSrc : this.state.song.imgSrc;
console.log("IMAGE FOR BANNER->",imgUrl);
var divStyle = {
backgroundImage: 'url(' + imgUrl + ')'
}
var linkDivStyle = "item w-full block group banner-630-340 " + divStyle;
const [imageUrl, setImageUrl] = useState("");
const link_result = "/" + props.itemData.link_path;
useEffect(() => {
let { banner, banner_location } = props?.itemData;
if (banner_location === "LOCAL") {
const imagePath = require(`../../assets/images/${banner}`); // Replace with your directory path for local images
setImageUrl(imagePath);
} else if (banner_location === "URL") setImageUrl(banner);
else return null;
}, []);
return (
<Link
to={link_result}
className={linkDivStyle}
>
<div className="flex flex-col justify-between h-full">
<div className="content flex justify-between items-center mb-5">
<div className="siderCardHeader">
<h1 className="text-2xl font-bold text-dark-gray dark:text-white tracking-wide">
<>{props.itemData.title}</>
</h1>
</div>
{/*<SelectBox datas={filterDatas} action={dataSetHandler} />*/}
</div>
<div className="h-[233px]">
<div className="siderCardDescription">
{props.itemData.description}
</div>
<div className="siderCardButton">
[BUTTON HERE]
</div>
</div>
</div>
</Link>
);
return (
<Link
to={link_result}
className="item w-full block group banner-630-340 bg-cover bg-center"
style={{
backgroundImage: `url('${imageUrl}')`,
}}
>
<div className="flex flex-col justify-between h-full">
<div className="content flex justify-between items-center mb-5">
<div className="siderCardHeader">
<h1 className="text-2xl font-bold text-dark-gray dark:text-white tracking-wide">
<span className="heroSilderTitle">{props.itemData.title}</span>
</h1>
</div>
</div>
<div className="h-[233px]">
<div className="siderCardDescription">
{props.itemData.description}
</div>
<div className="siderCardButton">
[ {props.itemData.button_text} ]
</div>
</div>
</div>
</Link>
);
}
+40 -25
View File
@@ -1,44 +1,59 @@
import React, { useState } from "react";
import React, { useState, useEffect } from "react";
import Layout from "../Partials/Layout";
import FamilyManageTabs from "./FamilyManageTabs";
import { useLocation } from "react-router-dom";
import FamilyManageTabs from "./Tabs/FamilyManageTabs";
import { useLocation, useNavigate } from "react-router-dom";
import LoadingSpinner from "../Spinners/LoadingSpinner";
export default function FamilyManage() {
const [selectTab, setValue] = useState("today");
let [pageLoading, setPageLoading] = useState(true);
let location = useLocation();
let accountDetails = location?.state
let navigate = useNavigate();
let accountDetails = location?.state;
// tab handler
const filterHandler = (value) => {
setValue(value);
};
useEffect(() => {
if (!accountDetails) {
navigate("/acc-family", { replace: true });
} else {
setPageLoading(false);
}
}, []);
return (
<Layout>
{/*<CommonHead />*/}
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Manage Family
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
{pageLoading ? (
<LoadingSpinner size={8} color="sky-blue" />
) : (
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Manage Family
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
</div>
</div>
<FamilyManageTabs accountDetails={accountDetails} />
</div>
<FamilyManageTabs accountDetails={accountDetails} />
</div>
</div>
)}
</Layout>
);
}
}
+32 -19
View File
@@ -5,7 +5,9 @@ import { useNavigate, useLocation, Link } from "react-router-dom";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
export default function FamilyTable({ className, familyList, loader }) {
import familyImage from '../../assets/images/no-family-side.png'
export default function FamilyTable({ className, familyList, loader, popUpHandler }) {
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
const navigate = useNavigate();
@@ -23,7 +25,7 @@ export default function FamilyTable({ className, familyList, loader }) {
return (
<div
className={`update-table w-full h-full p-8 bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow ${
className={`update-table w-full h-full p-8 bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow min-h-[520px] ${
className || ""
}`}
>
@@ -32,9 +34,11 @@ export default function FamilyTable({ className, familyList, loader }) {
<div className="h-full min-h-[500px] w-full overflow-hidden flex justify-center items-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
) : (
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
<>
)
:
familyList?.length > 0 ?
(
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
<thead className="sticky top-0">
<tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-bottom ">
<th className="py-4">Name</th>
@@ -44,9 +48,7 @@ export default function FamilyTable({ className, familyList, loader }) {
</tr>
</thead>
<tbody className="h-full">
<>
{familyList?.length > 0 ? (
currentFamilyList?.map((props, idx) => {
{currentFamilyList?.map((props, idx) => {
let {
firstname,
lastname,
@@ -115,18 +117,29 @@ export default function FamilyTable({ className, familyList, loader }) {
</tr>
);
})
) : (
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<td className="p-2" colSpan="4">
No Family Accounts Found!
</td>
</tr>
)}
</>
}
</tbody>
</>
</table>
)}
</table>
)
:
(
<div className="font-bold text-center text-xl md:text-2xl lg:text-4xl text-dark-gray md:flex items-center justify-between">
<div className="p-2 w-full md:w-1/2">
<p className="mb-4 p-3 md:p-16">Add your family, assign tasks, and get the whole team engaged.</p>
<button
onClick={popUpHandler}
type="button"
className="text-white btn-gradient text-lg tracking-wide px-5 py-2 rounded-full"
>
Add Family
</button>
</div>
<div className="p-2 w-full md:w-1/2">
<img className='w-full' src={familyImage} alt="Add Family" />
</div>
</div>
)
}
</div>
{/* PAGINATION BUTTON */}
<PaginatedList
-127
View File
@@ -1,127 +0,0 @@
import React, { useState } from "react";
import dataImage1 from "../../assets/images/data-table-user-1.png";
import dataImage2 from "../../assets/images/data-table-user-2.png";
import dataImage3 from "../../assets/images/data-table-user-3.png";
import dataImage4 from "../../assets/images/data-table-user-4.png";
import SelectBox from "../Helpers/SelectBox";
import PaginatedList from "../Pagination/PaginatedList";
import { handlePagingFunc } from "../Pagination/HandlePagination";
export default function FamilyTasks({ className }) {
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
let data = ['1', '2', '3', '4', '5', '6'] // to be replaced later by result from API CALL
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentTask = data.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e,setCurrentPage)
}
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
className || ""
}`}
>
{data.length &&
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between h-full">
<table className="table-auto w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody>
<tr className="text-base text-thin-light-gray border-b default-border-b dark:border-[#5356fb29] ottom ">
<td className="py-4">All Product</td>
<td className="py-4 text-center">Value</td>
<td className="py-4 text-center">USD</td>
<td className="py-4 text-right">Status</td>
</tr>
{
currentTask.map((item,index)=>(
<tr key={index} className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
<td className=" py-4">
<div className="flex space-x-2 items-center">
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
<img
src={dataImage3}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
Mullican Computer Joy
</h1>
<span className="text-sm text-thin-light-gray">
Owned by <span className="text-purple">Xoeyam</span>
</span>
</div>
</div>
</td>
<td className="text-center py-4 px-2">
<div className="flex space-x-1 items-center justify-center">
<span className="text-base text-dark-gray dark:text-white font-medium">
7473 ETH
</span>
</div>
</td>
<td className="text-center py-4 px-2">
<div className="flex space-x-1 items-center justify-center">
<span>
<svg
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.55225 0C7.8457 0 8.13914 0 8.43205 0C8.44829 0.026534 8.47537 0.0151623 8.49756 0.0162453C9.28966 0.0649812 10.0606 0.220936 10.8013 0.505229C12.7699 1.26172 14.2323 2.58354 15.183 4.46638C15.5999 5.29218 15.8506 6.16997 15.9561 7.08891C15.9691 7.201 15.9621 7.3158 16 7.42465C16 7.80858 16 8.19251 16 8.57698C15.9778 8.5916 15.9854 8.61543 15.9838 8.63546C15.9475 9.10387 15.8744 9.56686 15.7515 10.0206C15.1787 12.1342 13.9524 13.7603 12.0818 14.8942C11.1516 15.4579 10.1397 15.8002 9.06064 15.941C8.89497 15.9626 8.72875 15.98 8.56308 15.9995C8.17217 15.9995 7.78127 15.9995 7.39036 16C7.3752 15.9789 7.35138 15.9865 7.33135 15.9848C6.96752 15.9545 6.60639 15.9009 6.25068 15.8197C4.77639 15.4829 3.48998 14.793 2.4131 13.7311C0.998917 12.3372 0.204656 10.6461 0.0270709 8.66687C0.0205739 8.59431 0.033568 8.51904 0 8.44972C0 8.15081 0 7.85244 0 7.55352C0.0265295 7.53403 0.0151597 7.50479 0.016784 7.47988C0.0730915 6.64162 0.251218 5.83044 0.564158 5.05066C1.10179 3.71043 1.93774 2.59058 3.07634 1.70142C4.33839 0.715876 5.77098 0.159745 7.36762 0.0270755C7.4288 0.0216604 7.49432 0.0341151 7.55225 0ZM7.24635 9.86252C7.24635 10.2383 7.24526 10.6147 7.24743 10.9905C7.24797 11.0457 7.23389 11.0679 7.17596 11.0593C7.09691 11.0479 7.01678 11.0446 6.93774 11.0338C6.26746 10.9461 5.63563 10.7371 5.03952 10.4192C5.00379 10.4002 4.97834 10.3802 4.9621 10.4425C4.81375 11.0176 4.66324 11.5926 4.51164 12.1666C4.50027 12.2094 4.51272 12.2278 4.54954 12.2473C4.66486 12.3096 4.78235 12.3665 4.90309 12.4152C5.5961 12.6968 6.31998 12.8408 7.06497 12.8842C7.14131 12.8885 7.16134 12.9112 7.1608 12.9865C7.15701 13.4159 7.16026 13.8453 7.15809 14.2747C7.15755 14.3397 7.17488 14.3619 7.2431 14.3614C7.69085 14.3581 8.13914 14.3576 8.5869 14.3614C8.66432 14.3619 8.67731 14.3359 8.67731 14.2666C8.67461 13.8026 8.67677 13.3385 8.67461 12.8744C8.67407 12.8089 8.68544 12.7786 8.76015 12.765C9.09962 12.7049 9.4288 12.6058 9.74228 12.4607C10.3498 12.1802 10.8408 11.7703 11.1603 11.1724C11.4288 10.6699 11.51 10.1327 11.4618 9.56957C11.4158 9.03239 11.2366 8.55207 10.8787 8.14431C10.5506 7.77121 10.1402 7.51129 9.69843 7.29522C9.39145 7.14523 9.07363 7.02284 8.75041 6.91129C8.7098 6.89721 8.67407 6.88693 8.67407 6.82736C8.67623 6.14993 8.67569 5.4725 8.67461 4.79507C8.67461 4.75121 8.68489 4.73117 8.73308 4.73767C8.87547 4.75717 9.01895 4.77016 9.16134 4.79236C9.634 4.86493 10.0796 5.02467 10.5116 5.22395C10.5717 5.25157 10.5945 5.24886 10.6123 5.17684C10.7434 4.6467 10.8771 4.1171 11.0162 3.58913C11.0379 3.5079 11.0244 3.47541 10.948 3.44076C10.2799 3.13751 9.57282 3.01025 8.8457 2.97614C8.78018 2.97289 8.76123 2.95556 8.76178 2.88896C8.76503 2.50232 8.76232 2.11568 8.76448 1.72904C8.76503 1.66785 8.75041 1.64727 8.68489 1.64727C8.23173 1.64998 7.77802 1.64998 7.32485 1.64727C7.26151 1.64673 7.24418 1.66406 7.24418 1.72742C7.24689 2.1433 7.24256 2.55972 7.24797 2.9756C7.24905 3.06116 7.2209 3.08661 7.14239 3.10285C6.73579 3.18679 6.34651 3.32271 5.98646 3.53281C5.20628 3.98822 4.72117 4.64724 4.61938 5.5586C4.51597 6.48837 4.83812 7.2427 5.57661 7.81778C6.05739 8.19251 6.60639 8.43781 7.1738 8.64683C7.2274 8.66633 7.24743 8.68907 7.24689 8.7481C7.24472 9.12066 7.24635 9.49159 7.24635 9.86252Z"
fill="#59BE59"
/>
<path
d="M7.2452 9.86252C7.2452 9.49158 7.24358 9.12119 7.24683 8.75026C7.24737 8.69123 7.22734 8.66903 7.17374 8.64899C6.60687 8.43997 6.05787 8.19467 5.57655 7.81994C4.8386 7.24486 4.51591 6.49053 4.61933 5.56076C4.72057 4.6494 5.20568 3.99092 5.98641 3.53497C6.34645 3.32486 6.73519 3.18894 7.14233 3.10501C7.22084 3.08876 7.24899 3.06277 7.24791 2.97775C7.2425 2.56187 7.24683 2.14545 7.24412 1.72957C7.24358 1.66621 7.2609 1.64888 7.32479 1.64943C7.77796 1.65213 8.23167 1.65213 8.68483 1.64943C8.7498 1.64888 8.76442 1.66946 8.76442 1.73119C8.76171 2.11783 8.76496 2.50447 8.76171 2.89111C8.76117 2.95717 8.78012 2.97504 8.84563 2.97829C9.57276 3.01295 10.2793 3.13966 10.948 3.44291C11.0243 3.47757 11.0373 3.51006 11.0162 3.59128C10.877 4.11926 10.7433 4.64885 10.6123 5.17899C10.5944 5.25156 10.5717 5.25372 10.5116 5.2261C10.079 5.02683 9.63394 4.86708 9.16128 4.79452C9.01889 4.77286 8.87595 4.75932 8.73302 4.73983C8.68483 4.73333 8.67455 4.75337 8.67455 4.79723C8.67563 5.47466 8.67617 6.15209 8.674 6.82952C8.674 6.88908 8.70974 6.89937 8.75034 6.91345C9.07303 7.02446 9.39138 7.14684 9.69837 7.29738C10.1396 7.51344 10.5506 7.77283 10.8787 8.14647C11.2365 8.55369 11.4157 9.03455 11.4618 9.57173C11.51 10.1349 11.4287 10.6726 11.1602 11.1746C10.8408 11.7724 10.3497 12.1818 9.74222 12.4629C9.42874 12.608 9.09956 12.7071 8.76009 12.7672C8.68483 12.7802 8.674 12.811 8.67455 12.8766C8.67671 13.3406 8.67455 13.8047 8.67725 14.2688C8.67779 14.3381 8.66426 14.3646 8.58684 14.3636C8.13908 14.3598 7.69079 14.3608 7.24304 14.3636C7.17536 14.3641 7.15803 14.3424 7.15803 14.2769C7.1602 13.8475 7.15695 13.4181 7.16074 12.9887C7.16128 12.9128 7.14179 12.8906 7.06491 12.8863C6.31992 12.843 5.59658 12.699 4.90303 12.4174C4.78229 12.3681 4.66426 12.3112 4.54948 12.2495C4.51321 12.23 4.50075 12.2116 4.51158 12.1688C4.66318 11.5943 4.81369 11.0197 4.96204 10.4446C4.97829 10.3824 5.00373 10.4024 5.03947 10.4214C5.63557 10.7387 6.2674 10.9477 6.93768 11.036C7.01672 11.0463 7.09685 11.0501 7.1759 11.0614C7.23383 11.0695 7.24737 11.0479 7.24737 10.9927C7.24412 10.6147 7.2452 10.2383 7.2452 9.86252ZM8.68537 9.36325C8.67942 9.37245 8.67455 9.37678 8.67455 9.38112C8.674 9.83978 8.67401 10.2984 8.67292 10.7571C8.67292 10.8177 8.70216 10.7928 8.72598 10.7755C8.82452 10.7046 8.90736 10.619 8.96691 10.5123C9.17698 10.1333 9.05679 9.63725 8.68537 9.36325ZM7.23871 6.11147C7.23871 5.75354 7.23871 5.40589 7.23871 5.05174C6.92522 5.33982 6.92522 5.77249 7.23871 6.11147Z"
fill="#FEFEFE"
/>
<path
d="M8.68433 9.36328C9.05574 9.63729 9.17539 10.1333 8.96586 10.5118C8.90631 10.619 8.82347 10.7046 8.72493 10.775C8.70111 10.7918 8.67188 10.8172 8.67188 10.7566C8.67242 10.2979 8.67296 9.83927 8.6735 9.38061C8.67404 9.37682 8.67891 9.37249 8.68433 9.36328Z"
fill="#59BE59"
/>
<path
d="M7.23882 6.11149C6.92533 5.77305 6.92587 5.33984 7.23882 5.05176C7.23882 5.40591 7.23882 5.75355 7.23882 6.11149Z"
fill="#59BE59"
/>
</svg>
</span>
<span className="text-base text-dark-gray dark:text-white font-medium">
6392.99$
</span>
</div>
</td>
<td className="text-right py-4 px-2">
<button
type="button"
className="text-sm text-white bg-purple px-2.5 py-1.5 rounded-full"
>
Active
</button>
</td>
</tr>
))
}
</tbody>
</table>
{/* PAGINATION BUTTON */}
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= data.length ? true : false} data={data} start={indexOfFirstItem} stop={indexOfLastItem} />
{/* END OF PAGINATION BUTTON */}
</div>
}
</div>
);
}
@@ -1,18 +1,18 @@
import React, {
Suspense,
forwardRef,
useCallback,
useEffect,
useMemo,
useRef,
useState,
forwardRef,
Suspense,
} from "react";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import profile from "../../assets/images/profile-info-profile.png";
import usersService from "../../services/UsersService";
import FamilyTasks from "./FamilyTasks";
import QRCode from "react-qr-code";
import { useReactToPrint } from "react-to-print";
import usersService from "../../../services/UsersService";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import profile from "../../../assets/images/profile-info-profile.png";
import FamilyTasks from "./FamilyTasks";
export default function FamilyManageTabs({
className,
@@ -20,7 +20,16 @@ export default function FamilyManageTabs({
listReload,
loader,
}) {
const [familyDetails, setFamilyDetails] = useState(null);
const [details, setDetails] = useState({
familyDetails: {
loading: false,
data: null,
},
familyTasks: {
loading: false,
data: null,
},
});
const [errMsg, setErrMsg] = useState("");
// List of tabs
const tabs = [
@@ -57,26 +66,48 @@ export default function FamilyManageTabs({
imgReader.readAsDataURL(e.target.files[0]);
}
};
// Api call
const apiCall = useMemo(() => new usersService(), []);
// function for manage family
const familyManageHandler = useCallback(async () => {
const manageFamily = useCallback(async () => {
try {
setDetails({
familyDetails: { loading: true },
familyTasks: { loading: true },
});
let { family_uid } = accountDetails;
let reqData = { family_uid };
let res = await apiCall.ManageFamily(reqData);
let { data } = await res;
if (data?.internal_return < 0) return;
setFamilyDetails(data);
// the family response
const familyRes = await apiCall.ManageFamily(reqData);
const familyData = familyRes.data;
// the tasks response
const tasksRes = await apiCall.ManageTasks(reqData);
const tasksData = tasksRes.data;
// checking the internal return
if (familyData?.internal_return < 0 || tasksData?.internal_return < 0)
return;
setDetails({
familyDetails: { loading: false, data: familyData },
familyTasks: { loading: false, data: tasksData },
});
} catch (error) {
setDetails({
familyDetails: { loading: false },
familyTasks: { loading: false },
});
setErrMsg("An error occurred");
throw new Error(error);
}
}, [apiCall, accountDetails]);
useEffect(() => {
familyManageHandler();
}, [tab]);
manageFamily();
}, [tab, manageFamily]);
const accountRef = useRef();
// to handle printing
@@ -86,7 +117,7 @@ export default function FamilyManageTabs({
return (
<div
className={`update-table w-full bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow min-h-[520px] max-h-[600px] ${
className={`w-full bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow min-h-[520px] max-h-[600px] ${
className || ""
}`}
>
@@ -132,16 +163,21 @@ export default function FamilyManageTabs({
<div
className={`${
tab === name ? "block" : "hidden"
} h-full p-4 border border-[#dbd9d9]`}
} h-full p-4 border border-[#dbd9d9] relative overflow-y-auto`}
key={id}
>
{name === "Tasks" && (
<FamilyTasks className={className} loader={loader} />
<FamilyTasks
className={className}
loader={details.familyTasks.loading}
familyData={details.familyTasks.data}
/>
)}
{name === "Account" && (
<Account
familyDetails={familyDetails}
familyData={details.familyDetails.data}
myRef={accountRef}
loader={details.familyDetails.loading}
handlePrint={useHandlePrint}
/>
)}
@@ -166,7 +202,6 @@ function ProfileInfo({
browseProfileImg,
accountDetails,
}) {
let { firstname, lastname, age } = accountDetails;
return (
<div className="flex flex-col items-center gap-6">
<div className="flex justify-center">
@@ -207,20 +242,20 @@ function ProfileInfo({
</div>
<div className="flex flex-col justify-center gap-3 items-center">
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{firstname}
{accountDetails?.firstname}
</h1>
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{lastname}
{accountDetails?.lastname}
</h1>
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{age}
{accountDetails?.age}
</h1>
</div>
</div>
);
}
const Account = forwardRef(({ familyDetails, myRef, handlePrint }) => {
const Account = forwardRef(({ familyData, myRef, handlePrint }, ref) => {
return (
<div
className="w-full lg:min-h-[500px] h-full flex flex-col items-center justify-center"
@@ -232,15 +267,13 @@ const Account = forwardRef(({ familyDetails, myRef, handlePrint }) => {
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
Username:{" "}
<span className="ml-2 normal-case">
{familyDetails?.username
? familyDetails?.username
: "please wait..."}
{familyData?.username ? familyData?.username : "please wait..."}
</span>
</h2>
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
Pin:{" "}
<span className="ml-2 normal-case">
{familyDetails?.pin ? familyDetails?.pin : "please wait..."}
{familyData?.pin ? familyData?.pin : "please wait..."}
</span>
</h2>
</div>
@@ -0,0 +1,146 @@
import React, { useState } from "react";
import dataImage2 from "../../../assets/images/data-table-user-2.png";
import { useNavigate, useLocation } from "react-router-dom";
import { handlePagingFunc } from "../../Pagination/HandlePagination";
import PaginatedList from "../../Pagination/PaginatedList";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import Icons from "../../Helpers/Icons";
import { PriceFormatter } from "../../Helpers/PriceFormatter";
export default function FamilyTasks({ familyData, className, loader }) {
let navigate = useNavigate();
let { pathname } = useLocation();
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentTask = familyData?.result_list.slice(
indexOfFirstItem,
indexOfLastItem
);
const handlePagination = (e) => handlePagingFunc(e, setCurrentPage);
return (
<div
className={`update-table w-full bg-white dark:bg-dark-white h-full lg:min-h-[450px] overflow-hidden rounded-2xl section-shadow ${
className || ""
}`}
>
{loader ? (
<div className="w-full h-full flex justify-center items-center lg:min-h-[470px]">
<LoadingSpinner size={16} color="sky-blue" />
</div>
) : (
<>
{" "}
{familyData && familyData?.result_list && (
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between h-full">
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody>
{
<>
{familyData &&
familyData?.result_list &&
familyData.result_list.length > 0 &&
currentTask.map((value, index) => {
// find due date
const dueDate = value?.delivery_date.split(" ")[0];
// the price
let thePrice = PriceFormatter(
value?.price * 0.01,
value?.currency_code,
value?.currency
);
return (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className=" py-4">
<div className="flex space-x-2 items-center w-full">
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] max-w-[60px] min-w-[60px]">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div className="flex gap-4 items-center">
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{thePrice}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
<span className="text-sm text-thin-light-gray">
Due Date:{" "}
<span className="text-purple">
{" "}
{dueDate}
</span>
</span>
</div>
</div>
</div>
</td>
<td className="text-right py-4 px-2">
<button
type="button"
onClick={() => {
navigate("/manage-active-job", {
state: {
...value,
pathname,
dueDate,
thePrice,
},
});
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<Icons name="right-arrow" />
</button>
</td>
</tr>
);
})}
</>
}
</tbody>
</table>
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
familyData?.result_list.length
? true
: false
}
data={familyData?.result_list}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
)}
</>
)}
</div>
);
}
+1 -1
View File
@@ -158,7 +158,7 @@ export default function FamilyAcc() {
></div>
</div>
</div>
<FamilyTable familyList={familyList} loader={loader} />
<FamilyTable familyList={familyList} loader={loader} popUpHandler={popUpHandler} />
</div>
</div>
{popUp && (
+2 -2
View File
@@ -10,7 +10,7 @@ export default function Accordion({ datas }) {
<>
<div className="accordion-item overflow-hidden relative z-[1]">
<div
className="accordion-title-bar flex items-center space-x-3 py-5 border-b border-light-purple dark:border-[#5356fb29] "
className="accordion-title-bar flex items-center space-x-3 py-5 border-b border-light-purple dark:border-[#5356fb29] cursor-pointer"
onClick={accordionHandler}
>
<div className="accordion-title-icon relative">
@@ -36,7 +36,7 @@ export default function Accordion({ datas }) {
<div className="w-[3px] h-auto bg-purple rounded-[28px]"></div>
<div className="flex-1">
<p className="text-base text-thin-light-gray tracking-wide">
{datas.content}
{datas.msg}
</p>
</div>
</div>
+25
View File
@@ -1,5 +1,9 @@
import React from "react";
import ATMCard from '../../assets/images/card.svg'
import VisaCard from '../../assets/images/visa.svg'
import MasterCard from '../../assets/images/master.svg'
export default function Icons({ name }) {
return (
<>
@@ -468,6 +472,27 @@ export default function Icons({ name }) {
>
<rect y="0.823242" width="20" height="2.35294" rx="1.17647" />
</svg>
) : name === "right-arrow" ? (
<svg
width="24"
height="24"
xmlns="http://www.w3.org/2000/svg"
// enableBackground="new 0 0 24 24"
viewBox="0 0 24 24"
className="fill-black dark:fill-white"
id="right-arrow"
>
<path
d="M15.5,11.3L9.9,5.6c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l4.9,4.9l-4.9,4.9c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.6,0.4,1,1,1
c0.3,0,0.5-0.1,0.7-0.3l5.7-5.7c0,0,0,0,0,0C15.9,12.3,15.9,11.7,15.5,11.3z"
></path>
</svg>
) : name === "atm-card" ? (
<img className="w-[20px]" src={ATMCard} alt="card" />
) : name === "visa-card" ? (
<img className="w-[20px]" src={VisaCard} alt="card" />
) : name === "master-card" ? (
<img className="w-[20px]" src={MasterCard} alt="card" />
) : (
""
)}
@@ -21,7 +21,8 @@ export default function InputCom({
blurHandler,
spanTag,
inputBg,
direction
direction,
errorBorder
}) {
const inputRef = useRef(null);
// Entry Validation
@@ -51,11 +52,16 @@ export default function InputCom({
htmlFor={name}
>
{label}
{spanTag && (
{spanTag &&
spanTag == '*' ?
<span className="text-red-700 text-sm tracking-wide">
{' '}{spanTag}
</span>
:
<span className="text-green-700 text-sm tracking-wide">
{spanTag}
</span>
)}
}
</label>
)}
{forgotPassword && (
@@ -68,13 +74,13 @@ export default function InputCom({
)}
</div>
<div
className={`input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-full rounded-[0.475rem] h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base ${inputClass}`}
className={`input-wrapper border ${errorBorder ? "border-red-500 border-[0.5px] animate-shake" : "border border-[#f5f8fa] dark:border-[#5e6278]"} w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base ${inputClass}`}
>
<input
placeholder={placeholder}
value={value}
onChange={inputHandler}
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${
className={`input-field placeholder:text-base text-dark-gray w-full h-full tracking-wide ${
inputBg ? inputBg : "bg-[#FAFAFA]"
} dark:bg-[#11131F] focus:ring-0 focus:outline-none ${fieldClass}`}
type={type}
@@ -89,8 +95,12 @@ export default function InputCom({
dir={direction}
/>
{iconName && (
<div className="absolute right-6 bottom-[10px] z-10">
<Icons name={iconName} />
<div className="absolute right-6 bottom-[10px] z-10 flex gap-2">
{
iconName.split(' ').map((item, index)=>(
<Icons key={index} name={item} />
))
}
</div>
)}
{passIcon && (
+16
View File
@@ -0,0 +1,16 @@
export const PriceFormatter = (price, currency, currencyName) => {
const supportedCurrencies = ["USD", "EUR", "GBP"];
const symbolFormatter = supportedCurrencies.includes(currency)
? currency
: undefined;
const formatter = new Intl.NumberFormat("en", {
style: symbolFormatter,
currencyDisplay: "symbol",
minimumFractionDigits: 2,
});
const displayCurrencyName = symbolFormatter ? "" : currencyName;
return `${formatter.format(price)} ${displayCurrencyName}`;
};
+2 -2
View File
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import useToggle from "../../../hooks/useToggle";
function SelectBox({ datas = [], className, action, contentBodyClasses }) {
function SelectBox({ datas = [], className, action, contentBodyClasses, position }) {
const [item, setItem] = useState(datas[0]);
// custom hook
const [toggle, setToggle] = useToggle(false);
@@ -49,7 +49,7 @@ function SelectBox({ datas = [], className, action, contentBodyClasses }) {
<div
style={{ boxShadow: "0px 4px 87px 0px #0000002B" }}
className={`drop-down-content w-[120px] bg-white dark:bg-dark-white rounded-[4px] p-3 absolute right-0 top-[100%] z-20 ${
className={`drop-down-content w-[120px] bg-white dark:bg-dark-white rounded-[4px] p-3 absolute ${position =='left' ? 'left-0' : 'right-0'} top-[100%] z-20 ${
toggle ? "active" : ""
} ${contentBodyClasses || ""}`}
>
+53 -27
View File
@@ -13,7 +13,9 @@ import LoadingSpinner from "../Spinners/LoadingSpinner";
export default function History() {
const apiCall = new usersService()
const apiCall = new usersService()
let [tab, setTab] = useState("purchases"); //STATE FOR SWITCHING BETWEEN TABS
let [paymentHistory, setPaymentHistory] = useState({ // FOR PAYMENT HISTORY
loading: true,
@@ -63,7 +65,7 @@ export default function History() {
<>
<Layout>
<div className="history-wrapper w-full mb-10">
<div className="main-wrapper w-full">
<div className="w-full">
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
@@ -213,35 +215,59 @@ export default function History() {
{/*</div>*/}
{/*<MarketHistorySection />*/}
{/* <TopHxBox className="mb-11" /> */}
<div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'>
{/* PURCHASE SECTION */}
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full max-h-[700px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">Purchases</h1>
{purchaseHistory.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<PurchasesTable purchase={purchaseHistory} />
}
</div>
<div className='w-full p-4 md:p-8 bg-white dark:bg-dark-white rounded-2xl shadow bottomMargin'>
{/* switch button */}
<div className="my-1 flex items-center border-b border-slate-300">
<button
name="purchases"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "purchases" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
Purchases
</button>
<button
name="recent"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "recent" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
Recent Activity
</button>
</div>
{/* END OF PURCHASE SECTION */}
{/* RECENT ACTIVITY SECTION */}
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full max-h-[700px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">Recent Activity</h1>
{/* <p className='text-base text-slate-500 dark:text-white'>Activity Report</p> */}
{paymentHistory.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<RecentActivityTable payment={paymentHistory} />
{/* END OF switch button */}
<div className="history-tables w-full">
{/* PURCHASE SECTION */}
{tab == 'purchases' &&
<div className="wallet w-full border-t">
<h1 className="p-2 text-xl font-bold text-dark-gray dark:text-white tracking-wide">Purchases</h1>
{purchaseHistory.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<PurchasesTable purchase={purchaseHistory} />
}
</div>
}
</div>
{/* END OF PURCHASE SECTION */}
{/* RECENT ACTIVITY SECTION */}
{tab == 'recent' &&
<div className="wallet w-full border-t">
<h1 className="p-2 text-xl font-bold text-dark-gray dark:text-white tracking-wide">Recent Activity</h1>
{/* <p className='text-base text-slate-500 dark:text-white'>Activity Report</p> */}
{paymentHistory.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<RecentActivityTable payment={paymentHistory} />
}
</div>
}
{/* END OF RECENT ACTIVITY SECTION */}
</div>
{/* END OF RECENT ACTIVITY SECTION */}
</div>
<HistoryTable />
{/*<HistoryTable />*/}
</div>
</div>
</Layout>
+30 -30
View File
@@ -10,37 +10,37 @@ import { useSelector } from "react-redux";
import HomeActivities from "./HomeActivities";
export default function FullAccountDash(props) {
console.log("PROPS IN HOME->", props);
console.log("PROPS IN HOME->",props);
const trending = datas.datas;
const jobData = datas.datas; // api calls or cache
const trending = datas.datas;
const jobData = datas.datas; // api calls or cache
//getHomeDate
const userApi = new usersService();
const homeData = userApi.getHomeDate();
const userApi = new usersService();
const {userDetails} = useSelector((state) => state?.userDetails)
const { userDetails } = useSelector((state) => state?.userDetails);
return (
<div>
<div className="home-page-wrapper">
<Hero className="mb-10"
data={userDetails}
bannerList={props.bannerList}
/>
<HomeActivities className="mb-10"/>
{/*<UpdateTable className="mb-10"/>*/}
{/*<SellHistoryMarketVisitorAnalytic className="mb-10"/>*/}
{/*<TopSellerTopBuyerSliderSection className="mb-10" />*/}
return (
<div>
<div className="home-page-wrapper">
<Hero
className="mb-10"
data={userDetails}
bannerList={props.bannerList}
nextDueTask={props.nextDueTask}
/>
<HomeActivities className="mb-10" />
{/*<UpdateTable className="mb-10"/>*/}
{/*<SellHistoryMarketVisitorAnalytic className="mb-10"/>*/}
{/*<TopSellerTopBuyerSliderSection className="mb-10" />*/}
{/*<HomeTaskDisplay*/}
{/* jobData={jobData}*/}
{/* className="mb-10"*/}
{/* bannerList={props.bannerList}*/}
{/*/>*/}
</div>
</div>
);
{/*<HomeTaskDisplay*/}
{/* jobData={jobData}*/}
{/* className="mb-10"*/}
{/* bannerList={props.bannerList}*/}
{/*/>*/}
</div>
</div>
);
}
// /*
// <Layout>
@@ -53,10 +53,10 @@ export default function FullAccountDash(props) {
// className="mb-10"
// bannerList={props.bannerList}
// />
{/* <SellHistoryMarketVisitorAnalytic className="mb-10"/>
{
/* <SellHistoryMarketVisitorAnalytic className="mb-10"/>
<TopSellerTopBuyerSliderSection className="mb-10" />
<UpdateTable className="mb-10"/>*/}
<UpdateTable className="mb-10"/>*/
}
// </div>
// </Layout>
+36 -49
View File
@@ -3,15 +3,11 @@ import { Link } from "react-router-dom";
import { toast } from "react-toastify";
import heroBg from "../../assets/images/hero-bg.svg";
import heroUser from "../../assets/images/hero-user.png";
import slider1 from "../../assets/images/slider-1.jpg";
import slider2 from "../../assets/images/slider-2.jpg";
import slider3 from "../../assets/images/slider-3.jpg";
import CountDown from "../Helpers/CountDown";
import SliderCom from "../Helpers/SliderCom";
import HomeSliders from "./HomeSliders";
import { useSelector } from "react-redux";
export default function Hero({ className,bannerList }) {
export default function Hero({ className, bannerList, nextDueTask }) {
const settings = {
autoplay: true,
dots: true,
@@ -19,23 +15,12 @@ export default function Hero({ className,bannerList }) {
infinite: true,
swipe: true,
};
const sildeData =null;
const [addFavorite, setValue] = useState(false);
const sildeData = null;
const { userDetails } = useSelector((state) => state?.userDetails);
const {userDetails} = useSelector((state) => state?.userDetails)
const favoriteHandler = () => {
if (!addFavorite) {
setValue(true);
toast.success("Added to Favorite List");
} else {
setValue(false);
toast.warn("Remove to Favorite List");
}
};
let loginDate = userDetails?.last_login.split(' ')[0]
let {firstname, lastname, email, profile_pic} = userDetails
let userEmail = email.split('@')[0]
let loginDate = userDetails?.last_login.split(" ")[0];
let { firstname, lastname, email, profile_pic } = userDetails;
let userEmail = email.split("@")[0];
return (
<div
@@ -55,13 +40,13 @@ export default function Hero({ className,bannerList }) {
Welcome
</h1>
<span className="text-[18px] font-thin tracking-wide text-white">
Last Login : {loginDate}
Last Login : {loginDate}
</span>
</div>
{/* user */}
<div className="flex items-center space-x-3">
<div className="w-14 h-14 flex justify-center items-center rounded-full overflow-hidden">
<img src={profile_pic != '' ? profile_pic : heroUser} alt="" />
<img src={profile_pic != "" ? profile_pic : heroUser} alt="" />
</div>
<div>
<p className="text-xl tracking-wide font-bold antise text-white">
@@ -71,33 +56,35 @@ export default function Hero({ className,bannerList }) {
</div>
</div>
{/* countdown */}
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border border-white-opacity">
<div className="flex flex-col justify-between">
<p className="text-base text-white tracking-wide">Current Task</p>
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
ABCDEFGH01
</p>
<p className="text-base text-white tracking-wide">773.69 USD</p>
</div>
<div className="w-[1px] h-full bg-white-opacity"></div>
<div className="flex flex-col justify-between">
<p className="text-base text-white tracking-wide">Next due in</p>
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
<CountDown lastDate="2023-04-26 4:00:00" />
</p>
<div className="text-base text-white tracking-wide flex gap-[23px]">
<span>Hrs</span>
<span>Min</span>
<span>Sec</span>
{nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length && (
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border border-white-opacity">
<div className="flex flex-col justify-between">
<p className="text-base text-white tracking-wide">Current Task</p>
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
{nextDueTask.next_due.item_code}
</p>
<p className="text-base text-white tracking-wide">
{nextDueTask.next_due.price} Naira
</p>
</div>
<div className="w-[1px] h-full bg-white-opacity"></div>
<div className="flex flex-col justify-between">
<p className="text-base text-white tracking-wide">Next due in</p>
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
{/* <CountDown lastDate="2023-04-26 4:00:00" /> */}
<CountDown lastDate={nextDueTask.next_due.due_date} />
</p>
<div className="text-base text-white tracking-wide flex gap-[23px]">
<span>Hrs</span>
<span>Min</span>
<span>Sec</span>
</div>
</div>
</div>
</div>
)}
{/* action */}
<div className="flex lg:space-x-3 space-x-1 items-center">
<Link
to="/mytask"
className="text-white text-base sm:block hidden"
>
<Link to="/mytask" className="text-white text-base sm:block hidden">
<span className=" border-b dark:border-[#5356fb29] border-white">
{" "}
View All Task(s)
@@ -106,9 +93,9 @@ export default function Hero({ className,bannerList }) {
</div>
</div>
<HomeSliders
settings={settings}
sideData={sildeData}
bannerList={bannerList}
settings={settings}
sideData={sildeData}
bannerList={bannerList}
/>
</div>
);
File diff suppressed because it is too large Load Diff
+25 -30
View File
@@ -1,37 +1,32 @@
import SliderCom from "../Helpers/SliderCom";
import slider1 from "../../assets/images/slider-1.jpg";
import slider2 from "../../assets/images/slider-2.jpg";
import slider3 from "../../assets/images/slider-3.jpg";
import HomeBannerOffersCard from "../Cards/HomeBannerOffersCard";
export default function HomeSliders(props) {
console.log("BANNER LIST IN HomeSliders->",props.bannerList);
// debugger;
return (
<>
<div className="hero-slider relative 2xl:w-[600px] xl:w-[500px] lg:w-[420px] w-full mb-2 lg:mb-0 ">
<div className="w-full">
<SliderCom settings={props.settings}>
{/*<div className="item w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden">*/}
{/* <img src={slider1} alt="slider" className="w-full h-full" />*/}
{/*</div>*/}
<div className="item w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden">
<img src={slider2} alt="slider" className="w-full h-full" />
</div>
{/*<div className="item w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden">*/}
{/* <img src={slider3} alt="slider" className="w-full h-full" />*/}
{/*</div>*/}
{props.bannerList.map((item, index) => (
<div className="item w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden">
<HomeBannerOffersCard
itemData={item}
/>
</div>
))}
</SliderCom>
// console.log("BANNER LIST IN HomeSliders->", props.bannerList);
// debugger;
return (
<>
<div className="hero-slider relative 2xl:w-[600px] xl:w-[500px] lg:w-[420px] w-full mb-2 lg:mb-0 ">
<div className="w-full">
<SliderCom settings={props.settings}>
{props.bannerList?.length <= 0 && (
<div className="item w-full h-full bg-white dark:bg-dark-white max-h-80 rounded-2xl overflow-hidden">
<img src={slider2} alt="slider" className="w-full h-full" />
</div>
)}
{props.bannerList?.length > 0 &&
props.bannerList.map((item, index) => (
<div
key={index}
className="item w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden"
>
<HomeBannerOffersCard itemData={item} />
</div>
</div>
</>
);
))}
</SliderCom>
</div>
</div>
</>
);
}
+44 -28
View File
@@ -1,4 +1,4 @@
import React from "react";
import React, { useState, useEffect } from "react";
import datas from "../../data/product_data.json";
import Layout from "../Partials/Layout";
import usersService from "../../services/UsersService";
@@ -6,35 +6,51 @@ import { useSelector } from "react-redux";
import FamilyDash from "./FamilyDash";
import FullAccountDash from "./FullAccountDash";
export default function Home(props) {
console.log("PROPS IN HOME->", props);
console.log("PROPS IN HOME->",props);
let [nextDueTask, setNextDueTask] = useState({});
// const trending = datas.datas;
// const jobData = datas.datas; // api calls or cache
const userApi = new usersService();
// const homeData = userApi.getHomeDate();
const {userDetails} = useSelector((state) => state?.userDetails)
const userApi = new usersService();
const commonHeadData =()=>{
console.log("COMMON HEAD DATA INDEX ----------------=====---------------------");
return 0;
}
const { userDetails } = useSelector((state) => state?.userDetails);
return (
<Layout>
<div className="home-page-wrapper">
{userDetails && userDetails?.account_type == "FAMILY" && (
<FamilyDash commonHeadData={commonHeadData} />
)}
{userDetails && userDetails?.account_type == "FULL" && (
<FullAccountDash bannerList={props.bannerList} />
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
)}
</div>
</Layout>
);
// FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
const getHomeDate = () => {
userApi
.getHomeDate()
.then((res) => {
if (res.status != 200 || res.internal_return < 0) {
return;
}
setNextDueTask(res.data);
})
.catch((error) => {
console.log(error);
});
};
useEffect(() => {
getHomeDate();
}, []);
return (
<Layout>
<div className="home-page-wrapper">
{userDetails && userDetails?.account_type == "FAMILY" && (
<FamilyDash commonHeadData={props.bannerList} />
)}
{userDetails && userDetails?.account_type == "FULL" && (
<FullAccountDash
nextDueTask={nextDueTask}
bannerList={props.bannerList}
/>
)}
</div>
</Layout>
);
}
// /*
// <Layout>
@@ -47,10 +63,10 @@ export default function Home(props) {
// className="mb-10"
// bannerList={props.bannerList}
// />
{/* <SellHistoryMarketVisitorAnalytic className="mb-10"/>
{
/* <SellHistoryMarketVisitorAnalytic className="mb-10"/>
<TopSellerTopBuyerSliderSection className="mb-10" />
<UpdateTable className="mb-10"/>*/}
<UpdateTable className="mb-10"/>*/
}
// </div>
// </Layout>
+81 -78
View File
@@ -1,102 +1,105 @@
import React, { useEffect, useState } from "react";
import React, { useEffect, useMemo, useState } from "react";
import DataIteration from "../Helpers/DataIteration";
import AvailableJobsCard from "../Cards/AvailableJobsCard";
import ListView from '../../assets/images/list-view.png'
import GridView from '../../assets/images/grid-view.svg'
import SelectBox from "../Helpers/SelectBox";
export default function MainSection({ className, marketPlaceProduct }) {
const [tab, setTab] = useState("explore");
const [products, setProducts] = useState(marketPlaceProduct);
export default function MainSection({
className,
marketPlaceProduct,
categories,
}) {
// Creating All cart..
let marketCategories = useMemo(
() => ({ All: "All Categories", ...categories }),
[categories]
);
const [tab, setTab] = useState(Object.keys(marketCategories)[0]);
let [contentDisplay, setContentDisplay] = useState('grid') // STATE TO HOLD LIST VIEW STYLE
// Convert to array in order to map
const mappedArray = Object.entries(marketCategories).map(([key, value]) => {
return { key, value };
});
const [products, setProducts] = useState([]);
const tabHandler = (value) => {
setTab(value);
};
useEffect(() => {
if (tab === "artist") {
setProducts(marketPlaceProduct?.slice(0, 3));
} else if (tab === "market") {
setProducts(marketPlaceProduct?.slice(0, 6));
} else if (tab === "shop") {
setProducts(marketPlaceProduct?.slice(6, 9));
} else if (tab === "assets") {
setProducts(marketPlaceProduct?.slice(3, 6));
} else {
setProducts(marketPlaceProduct);
// Handles the category selection on mobile view
const handleSetCategory = (value) => {
for (let i in marketCategories) {
if (marketCategories[i] == value) {
setTab(i);
}
}
}, [tab, marketPlaceProduct]);
};
useEffect(() => {
if (tab === "All") {
setProducts(marketPlaceProduct);
} else {
const filteredProducts = marketPlaceProduct.filter((product) =>
product.category.includes(tab)
);
setProducts(filteredProducts);
}
}, [tab, marketPlaceProduct, categories, marketCategories]);
return (
<div className={`market-place-section w-full ${className || ""}`}>
<div className="market-place-wrapper w-full">
<div className="filter-navigate-area lg:flex justify-between mb-8 items-center">
<div className="tab-item lg:mb-0 mb-5">
<div className="md:flex md:space-x-8 space-x-2">
<span
onClick={() => tabHandler("explore")}
className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${
tab === "explore"
? "text-pink border-pink"
: " border-transparent"
}`}
>
Explore
</span>
<span
onClick={() => tabHandler("artist")}
className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${
tab === "artist"
? "text-pink border-pink"
: " border-transparent"
}`}
>
Featured Artist
</span>
<span
onClick={() => tabHandler("market")}
className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${
tab === "market"
? "text-pink border-pink"
: " border-transparent"
}`}
>
Open Market
</span>
<span
onClick={() => tabHandler("shop")}
className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${
tab === "shop"
? "text-pink border-pink"
: " border-transparent"
}`}
>
Partner Shops
</span>
<span
onClick={() => tabHandler("assets")}
className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${
tab === "assets"
? "text-pink border-pink"
: " border-transparent"
}`}
>
Game Assets
</span>
<div className="filter-navigate-area flex justify-between items-center mb-8">
<div className="tab-item w-full flex items-center">
<div className="hidden lg:flex md:space-x-8 space-x-2">
{mappedArray.map(({ key, value }) => (
<span
key={key}
onClick={() => tabHandler(key)}
className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${
tab === key
? "text-pink border-pink"
: " border-transparent"
}`}
>
{value}
</span>
))}
</div>
{/* market categories on screen smaller than large screen */}
<div className="w-[80%] lg:hidden">
<SelectBox
action={handleSetCategory}
datas={Object.values(marketCategories)}
className="Update-table-dropdown"
contentBodyClasses="w-auto min-w-max"
position='left'
/>
</div>
</div>
{/*<div className="search-item flex lg:flex-none justify-end">*/}
{/* <SearchCom*/}
{/* className="lg:bg-transparent"*/}
{/* inputClasses="lg:bg-transparent"*/}
{/* />*/}
{/*</div>*/}
{/* contentDisplay toggler */}
<div className="p-2 w-[35px] h-[35px] bg-white dark:bg-slate-200 rounded-lg">
<img
title={contentDisplay=='grid'? 'list view' : 'grid view'}
onClick={()=>setContentDisplay((prev)=>prev=='grid'? 'list' : 'grid')}
src={contentDisplay=='grid'? ListView : GridView}
className="w-full h-full cursor-pointer" alt="view"
/>
</div>
{/* end of contentDisplay toggler */}
</div>
<div className="filter-navigate-content w-full min-h-screen">
<div className="grid lg:grid-cols-3 sm:grid-cols-2 gap-[30px]">
<div className={contentDisplay == 'grid' ? 'grid lg:grid-cols-3 sm:grid-cols-2 gap-[30px]' : 'w-full'}>
<DataIteration
datas={products}
startLength={process.env.REACT_APP_ZERO_STATE}
endLength={products?.length}
>
{({ datas }) => (
<AvailableJobsCard key={datas.id} datas={datas} />
<AvailableJobsCard contentDisplay={contentDisplay} key={datas.id} datas={datas} />
)}
</DataIteration>
</div>
@@ -0,0 +1,290 @@
import React, { useCallback, useMemo, useState } from "react";
import ModalCom from "../../Helpers/ModalCom";
import { toast } from "react-toastify";
import { Form, Formik } from "formik";
import usersService from "../../../services/UsersService";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
const [marketMsg, setMarketMsg] = useState({
loading: false,
data: {},
state: undefined,
});
const [manageInt, setManageInt] = useState({
loading: false,
data: {},
state: undefined,
msg: "",
});
const [textValue, setTextValue] = useState("");
const handleInputChange = ({ target: { value } }) => {
setTextValue(value);
};
const apiCall = useMemo(() => new usersService(), []);
const marketCalls = useCallback(
async (e) => {
try {
const nameOfCall = e?.target?.name;
const { offer_code } = details;
const reqData = { offer_code };
if (nameOfCall === "market-message") {
setMarketMsg({ loading: true });
if (!textValue) return;
reqData.yourmessage = textValue;
const marketMessage = await apiCall.MarketMessage(reqData);
const marketMessageRes = marketMessage?.data;
if (marketMessageRes?.internal_return < 0) {
toast.warn("Something wrong happened", {
autoClose: 2000,
hideProgressBar: true,
});
onClose();
return;
}
toast.success("Message sent", {
autoClose: 2500,
hideProgressBar: true,
});
setMarketMsg({ data: marketMessageRes, state: true });
setTimeout(() => onClose(), 2000);
} else {
setManageInt({ loading: true });
const manageInt = await apiCall.MarketInterest(reqData);
const manageIntRes = manageInt?.data;
if (manageIntRes?.internal_return < 0) {
setManageInt({
loading: false,
msg: `Error - ${manageIntRes?.status}`,
data: manageIntRes,
state: false,
});
} else {
setManageInt({
loading: false,
msg: manageIntRes?.status,
data: manageIntRes,
state: true,
});
}
setTimeout(() => setManageInt({ msg: "" }), 3000);
return;
}
} catch (error) {
throw new Error(error);
} finally {
setTimeout(() => {
setTextValue("");
setMarketMsg({ loading: false });
}, 2000);
}
},
[apiCall, details, onClose, textValue]
);
console.log('Checking my mangeInt',manageInt)
// let addedIntDate = marketInt?.added?.split(" ")[0];
let expireIntDate = marketInt?.expire?.split(" ")[0];
return (
<ModalCom action={onClose} situation={situation} className="edit-popup">
<div className="logout-modal-wrapper md:w-[750px] md:h-[700px] h-full bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px]">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
{details.offer_code}
</h1>
<CloseIcon onClose={onClose} />
</div>
<div className="md:flex bg-white rounded-lg">
<div className="p-4 w-full md:w-3/4 md:border-r-1">
<div className="min-h-[290px]">
<h2 className="font-semibold text-slate-900 dark:text-black tracking-wide">
{details?.title}
</h2>
{/* INPUT SECTION */}
{[
{
name: "Description",
content: details.description,
},
{
name: "",
content: {
text: `Timeline: ${details.timeline_days} day(s) -- `,
bold: `Budget: ${details.price} naira`,
},
},
{
name: "Delivery Detail",
content: details.job_description,
danger: true,
},
].map(({ name, content, danger }, idx) => (
<div className={`my-3 md:flex items-center`} key={idx}>
<label className="w-full md:w-1/4 text-slate-900 tracking-wide font-semibold">
{name}
</label>
<div
className={`w-full md:w-3/4 text-slate-900 market-pop ${
name !== "Delivery Detail"
? " h-full max-h-28 flex items-center"
: " overflow-y-auto max-h-[100px]"
}`}
>
{danger ? (
<p
className={``}
dangerouslySetInnerHTML={{
__html: danger && content?.replace(/"/g, ""),
}}
/>
) : (
<p className={`w-full md:w-3/4 text-slate-900`}>
{name !== "Delivery Detail" ? (
<>
{typeof content !== "object" ? content : null}
{typeof content === "object" && (
<span className="flex items-center gap-2">
{content?.text}
<strong>{content?.bold}</strong>
</span>
)}
</>
) : (
""
)}
</p>
)}
</div>
</div>
))}
</div>
<hr />
<div className="my-3 w-full flex flex-col gap-3">
<div className="w-full">
<label className="w-full text-slate-900 tracking-wide">
If you have any questions about this task:
</label>
<textarea
className={`p-1 w-full text-sm text-slate-900 outline-none border border-slate-300 rounded-md`}
rows="5"
style={{ resize: "none" }}
placeholder="Enter message here ..."
value={textValue}
onChange={handleInputChange}
/>
</div>
<button
className="self-end w-[150px] h-[52px] rounded-md text-base bg-yellow-500 text-white"
name="market-message"
onClick={marketCalls}
>
{marketMsg.loading ? (
<LoadingSpinner size={5} color="white" />
) : !marketMsg.state ? (
"Send Message"
) : (
"Message Sent"
)}
</button>
</div>
</div>
<div className="w-full md:w-1/4 h-full ">
<div className="w-[90%] mx-auto bg-[#f1f8ff] p-4 rounded-md md:min-h-[550px] flex flex-col justify-between">
<div className="w-full flex flex-col justify-center py-4 gap-2">
<p className="w-full text-slate-900 tracking-wide my-1">
Interested in the task?
</p>
<hr />
<button
className="bg-[#57cd89] text-center text-lg font-semibold text-white py-2 px-4 rounded-md inline-flex flex-col items-center justify-center"
name="market-interest"
onClick={marketCalls}
>
{" "}
<span>Send</span>
<span>Interest</span>
<span>Request</span>
</button>
<>
{manageInt.loading ? (
<p className="text-sm italic">please wait...</p>
) : (
<>
{manageInt?.msg !== "" && (
<p
className={`text-sm italic ${
manageInt?.state ? "text-green-500" : "text-red-500"
}`}
>
{manageInt?.msg}
</p>
)}
</>
)}
</>
</div>
<div className="">
<p className="flex items-center tracking-wide">
Interest: <b className="ml-1">{details.interest_count}</b>
</p>
<hr />
<p className="my-1">Expire: {expireIntDate}</p>
</div>
</div>
</div>
{/* END OF ACTION SECTION */}
</div>
</div>
</ModalCom>
);
};
export default MarketPopUp;
const CloseIcon = ({ onClose }) => (
<button
type="button"
className="text-[#374557] dark:text-red-500"
onClick={onClose}
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
</button>
);
+9 -8
View File
@@ -1,22 +1,23 @@
import React from "react";
// import products from "../../data/marketplace_data.json";
//import CreateNft from "../Home/CreateNft";
import Layout from "../Partials/Layout";
import MainSection from "./MainSection";
import CommonHead from "../UserHeader/CommonHead";
import { useSelector } from "react-redux";
export default function MarketPlace({commonHeadData}) {
export default function MarketPlace({ commonHeadData }) {
let { jobLists } = useSelector((state) => state.jobLists);
const marketData = jobLists?.result_list;
const categories = jobLists?.categories;
// const marketProduct = products.data;
return (
<>
<Layout>
<CommonHead commonHeadData={commonHeadData} />
<MainSection marketPlaceProduct={marketData} className="mb-10" />
<CommonHead commonHeadData={commonHeadData} />
<MainSection
marketPlaceProduct={marketData}
categories={categories}
className="mb-10"
/>
</Layout>
</>
);
}
}
@@ -31,7 +31,13 @@ export default function ActiveJobMessage({ activeJobMesList }) {
<tbody>
{currentActiveJobMesList.map((item, index) => (
<tr key={index} className='text-slate-500'>
<td className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></td>
<td>
<div className="msg_box">
<div className="msg_header">{item.msg_date} {item.msg_firstname}</div>
<span className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></span>
</div>
</td>
</tr>
))}
</tbody>
+623 -314
View File
@@ -1,369 +1,678 @@
import React, { useEffect, useState } from "react";
import React, { useEffect, useState, useRef } from "react";
import { useSelector } from "react-redux";
import Layout from "../Partials/Layout";
import { useNavigate } from "react-router-dom";
import ActiveJobMessage from "./ActiveJobMessage";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import CountDown from "../Helpers/CountDown";
import IndexJobActions from "./JobActions/IndexJobActions";
import ModalCom from "../Helpers/ModalCom";
import { useReactToPrint } from "react-to-print";
import usersService from "../../services/UsersService";
function ActiveJobs(props) {
const ApiCall = new usersService()
const ApiCall = new usersService();
let navigate = useNavigate();
let { userDetails } = useSelector((state) => state.userDetails);
let navigate = useNavigate()
let [messageToSend, setMessageToSend] = useState('') // State to hold the value of message to be sent
let [passDue, setPassDue] = useState(
new Date() > new Date(props.details?.delivery_date)
); // STATE TO KNOW IF TASK IS PASSED DUE TIME
let [filesToSend, setFilesToSend] = useState([]) // State to hold the value of files to be sent
let [messageToSend, setMessageToSend] = useState(""); // State to hold the value of message to be sent
let [tab, setTab] = useState('message')
let [filesToSend, setFilesToSend] = useState([]); // State to hold the value of files to be sent
let [requestStatus, setRequestStatus] = useState({loading: false, status: false, message: ''})
let [tab, setTab] = useState("message");
let [requestStatus, setRequestStatus] = useState({
loading: false,
status: false,
message: "",
});
let [popUp, setPopUp] = useState(false); // STATE FOR POPOUT MODAL
const printRef = useRef();
// to handle printing
const handlePrint = useReactToPrint({
content: () => printRef.current,
});
const popUpHandler = () => {
// FUNCTION TO HANDLE POPOUT
setPopUp((prev) => !prev);
};
// FUNCTION TO HANDLE MESSAGE CHANGE
const handleMessageChange = ({target:{value}}) => {
setMessageToSend(value)
}
const handleMessageChange = ({ target: { value } }) => {
setMessageToSend(value);
};
// FUNCTION TO HANDLE FILE UPlOAD CHANGE
const handleFileChange = ({target:{files}}) => {
setRequestStatus({loading: false, status: false, message: ''}) // State to determine error state
if(!files[0]) { // IF NO FILE SELECTED RETURN
return
const handleFileChange = ({ target: { files } }) => {
setRequestStatus({ loading: false, status: false, message: "" }); // State to determine error state
if (!files[0]) {
// IF NO FILE SELECTED RETURN
return;
}
if(files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)){
setRequestStatus({loading: false, status: false, message: 'File must be <= 1mb'})
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
return
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) {
setRequestStatus({
loading: false,
status: false,
message: "File must be <= 1mb",
});
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
return;
}
if(filesToSend.length >= Number(process.env.REACT_APP_TOTAL_NUM_FILE)){
setRequestStatus({loading: false, status: false, message: `Total number of attachment is ${Number(process.env.REACT_APP_TOTAL_NUM_FILE)}`})
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
return
if (filesToSend.length >= Number(process.env.REACT_APP_TOTAL_NUM_FILE)) {
setRequestStatus({
loading: false,
status: false,
message: `Total number of attachment is ${Number(
process.env.REACT_APP_TOTAL_NUM_FILE
)}`,
});
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
return;
}
// INCLUDE FILE IF NO ERROR
setFilesToSend(prev => ([...prev, files[0]]))
}
setFilesToSend((prev) => [...prev, files[0]]);
};
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
const handleClearAll = ({target:{name}}) => {
if(tab == 'message'){
setMessageToSend('')
}else if(tab=='files'){
setFilesToSend([])
}else{
return
}
}
const handleClearAll = ({ target: { name } }) => {
if (tab == "message") {
setMessageToSend("");
} else if (tab == "files") {
setFilesToSend([]);
} else {
return;
}
};
// FUNCTION TO REMOVE AND IMAGE
const handleRemoveImage = (imageToDelete) => {
setFilesToSend(prev => prev.filter(item => item.name != imageToDelete.name))
}
setFilesToSend((prev) =>
prev.filter((item) => item.name != imageToDelete.name)
);
};
// FUNCTION TO SEND TASK MESSAGE
const sendTaskMessage = () => {
let reqData={message: messageToSend, msg_type: 'TEXT', contract:props.details.contract}
if(!reqData.message){
setRequestStatus({loading: false, status: false, message: 'Message is empty'})
return setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
let reqData = {
message: messageToSend,
msg_type: "TEXT",
contract: props.details.contract,
};
if (!reqData.message) {
setRequestStatus({
loading: false,
status: false,
message: "Message is empty",
});
return setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
}
setRequestStatus({loading: true, status: false, message: ''})
ApiCall.sendTaskMessage(reqData).then((res)=>{
if(res.status != 200 || res.data.internal_return < 0){
setRequestStatus({loading: false, status: false, message: 'Message could not be sent, try again later'})
return
}
setRequestStatus({loading: false, status: true, message: 'Message Sent Successfully'})
props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
setMessageToSend('') // SENDS MESSAGE TO SEND BACK TO EMPTY STRINGS
}).catch(error => {
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
}).finally(()=>{
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
})
}
setRequestStatus({ loading: true, status: false, message: "" });
ApiCall.sendTaskMessage(reqData)
.then((res) => {
if (res.status != 200 || res.data.internal_return < 0) {
setRequestStatus({
loading: false,
status: false,
message: "Message could not be sent, try again later",
});
return;
}
setRequestStatus({
loading: false,
status: true,
message: "Message Sent Successfully",
});
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
setMessageToSend(""); // SENDS MESSAGE TO SEND BACK TO EMPTY STRINGS
})
.catch((error) => {
setRequestStatus({
loading: false,
status: false,
message: "Opps! something went wrong",
});
})
.finally(() => {
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
});
};
// FUNCTION TO SEND FILES
const sendFile = () => {
setRequestStatus({loading: true, status: false, message: ''})
// FUNCTION TO SEND FILES
const sendFile = async () => {
setRequestStatus({ loading: true, status: false, message: "" });
if(!filesToSend.length){ // checks if file to send is empty
setRequestStatus({loading: false, status: false, message: 'No File(s) selected'})
return setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
if (!filesToSend.length) {
// checks if file to send is empty
setRequestStatus({
loading: false,
status: false,
message: "No File(s) selected",
});
return setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
}
// let reqData = new FormData()
// for(let files of filesToSend){
// reqData.append(files.name, files)
// }
let reqData={file_size: filesToSend[0].size, file_type: 'image/png', file_data: filesToSend[0], msg_type: 'FILE', contract:props.details.contract}
// for(let files of filesToSend){
// reqData[files.name] = files
// }
ApiCall.sendFiles(reqData).then((res)=>{
if(res.status != 200 || res.data.internal_return < 0){
setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'})
return
}
setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
}).catch(error => {
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
}).finally(()=>{
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
})
}
for (let i = 0; i <= filesToSend.length - 1; i++) {
// Loops through files to send array and trigger upload API call
const fileToBase64 = async () => {
// Converts file data to base64 string
try {
const base64String = await convertFileToBase64(filesToSend[i]);
return base64String;
} catch (error) {
return false;
}
};
// if(await !fileToBase64()){
// return
// }
let reqData = {
file_name: filesToSend[i].name,
file_size: filesToSend[i].size,
file_type: "image/png",
file_data: await fileToBase64(),
msg_type: "FILE",
contract: props.details.contract,
};
ApiCall.sendFiles(reqData)
.then((res) => {
// if(res.status != 200 || res.data.internal_return < 0){
// setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'})
// return
// }
// setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
})
.catch((error) => {
// setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
})
.finally(() => {
if (i == filesToSend.length - 1) {
setRequestStatus({
loading: false,
status: true,
message: "File(s) Uploaded Successfully",
});
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
}
});
}
};
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
let isPassedDue = () => {
// console.log('TESTING',new Date() > new Date(props.details?.delivery_date) )
if (new Date() > new Date(props.details?.delivery_date)) {
setPassDue(true);
} else {
setPassDue(false);
}
};
useEffect(() => {
if (!passDue) {
let passDueInterval = setInterval(() => {
isPassedDue();
}, 1000);
return () => {
clearInterval(passDueInterval);
};
}
}, [passDue]);
return (
<Layout>
<div className="py-[20px] bg-white dark:bg-black dark:text-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-16">
{/* job title */}
<div className="w-full md:w-8/12">
<div className="w-full flex justify-start space-x-3 items-start">
<button
type="button"
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
onClick={() =>
navigate(props.details.pathname, { replace: true })
}
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="35"
height="35"
viewBox="0 0 24 24"
fill="skyblue"
>
<path d="M19 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H19v-2z" />
</svg>
</button>
<h1 className="text-xl lg:text-2xl font-bold text-dark-gray dark:text-white tracking-wide">
{props.details?.title && props.details.title}
</h1>
</div>
<div className="py-[20px] bg-white px-4 rounded-2xl shadow-md lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
{/* job title */}
<div className="w-full lg:w-1/2">
<div className="w-full flex justify-start space-x-3 items-start">
<div className="w-full my-2">
<p className="w-full text-base text-right text-sky-blue">
{props.details.job_to && props.details.job_to}
</p>
<div className="text-base text-slate-700 dark:text-white tracking-wide">
<p className="font-semibold text-black dark:text-white">Description: </p>
<p className="p-2 border border-sky-blue">
{props.details?.description && props.details.description}
</p>
</div>
</div>
</div>
{/* end of job title */}
{/* job details */}
<div className="w-full md:w-4/12">
<p className="text-base text-sky-blue">Delivery Detail</p>
{passDue ? (
<div className="my-1">
<p className="text-base text-slate-700">
<span className="font-semibold">Due: </span>
{props.details?.delivery_date &&
props.details.delivery_date.split(" ")[0]}
</p>
<p className="py-2 text-base text-slate-700">
{props.details?.delivery_date &&
props.details.delivery_date.split(" ")[1]}
</p>
</div>
) : (
<div className="my-1 flex items-start gap-3">
<p className="font-semibold">Due: </p>
<div className="flex flex-col justify-between">
<p className="text-base text-slate-700 tracking-wide">
<CountDown lastDate={props.details.delivery_date} />
</p>
<div className="text-base text-slate-700 tracking-wide flex gap-[5px]">
<span>Hrs</span>
<span>Min</span>
<span>Sec</span>
</div>
</div>
</div>
)}
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
<span className="font-semibold text-black dark:text-white">Duration: </span>
<span className="">
{props.details?.timeline_days && props.details.timeline_days}{" "}
day(s)
</span>
</div>
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
<span className="font-semibold text-black dark:text-white">No: </span>
<span className="">
{props.details?.contract && props.details.contract}
</span>
</div>
</div>
{/* end of job details */}
</div>
<div className="my-4 py-[20px] bg-white dark:bg-black px-4 rounded-2xl shadow-md lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
<div className="w-full lg:w-1/2">
<div className="">
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
Actions
</h1>
{/* <p className="my-3 py-1 text-base">
Waiting for the completion message from the client before you can approve.
</p> */}
<IndexJobActions details={props.details} />
</div>
{/* TEXTAREA SECTION */}
<div className="mt-5">
<div className="">
{/* <p className="relative py-2 my-2 text-lg font-bold text-slate-600 dark:text-black border-b-2 border-slate-300 tracking-wide after:absolute after:-bottom-0.5 after:content-[''] after:w-[100px] after:h-[2px] after:bg-sky-blue after:left-0">Message(s)</p> */}
<div className="my-2 flex items-center border-b border-slate-300">
<button
name="message"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "message" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
Send Message
</button>
<button
name="files"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "files" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
Send Files
</button>
</div>
{tab == "message" ? (
<textarea
className="p-4 w-full h-[300px] text-base text-slate-600 dark:text-white bg-white dark:bg-black border border-slate-300 outline-none"
// rows="10"
style={{ resize: "none" }}
name="message"
onChange={handleMessageChange}
value={messageToSend}
/>
) : (
<div className="p-4 w-full h-[300px] text-base text-slate-600 border border-slate-300">
<div className="files">
<label
htmlFor="file"
className="h-20 btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
>
Select Files to Upload
</label>
<input
type="file"
id="file"
accept="image/*"
style={{ display: "none" }}
onChange={handleFileChange}
/>
</div>
<div className="selected_file my-2">
{filesToSend.length > 0 &&
filesToSend.map((item, index) => (
<p key={index} className="flex items-center space-x-2">
<span>{item.name}</span>
<button
name="remove"
onClick={() => handleRemoveImage(item)}
className="px-2 flex justify-center items-center rounded-full border border-red-500 text-red-500"
>
x
</button>
</p>
))}
</div>
</div>
)}
</div>
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
<div className="w-full">
{/* error or success display */}
{requestStatus.message != "" &&
(!requestStatus.status ? (
<div
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{requestStatus.message}
</div>
) : (
requestStatus.status && (
<div
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{requestStatus.message}
</div>
)
))}
</div>
{/* End of error or success display */}
{/* Buttons Sections */}
<div className="py-2 sm:flex sm:justify-end sm:items-center">
<div className="w-full sm:w-2/4 flex justify-between items-center space-x-2">
<button
type="button"
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
onClick={() => navigate(props.details.pathname, {replace: true})}
onClick={handleClearAll}
className="border-gradient text-base tracking-wide px-4 py-3 rounded-full"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="35"
height="35"
viewBox="0 0 24 24"
fill="skyblue"
>
<path d="M19 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H19v-2z" />
</svg>
<span className="text-gradient">Clear</span>
</button>
<h1 className="text-xl lg:text-2xl font-bold text-dark-gray dark:text-white tracking-wide">
{props.details?.title && props.details.title}
</h1>
</div>
<div className="w-full my-4">
<div className="pb-2 w-full flex items-center">
<p className="w-full lg:w-2/3 text-base text-slate-700 dark:text-black">
{props.details?.contract && props.details.contract}
</p>
<p className="w-full lg:w-1/3 text-base text-sky-blue">
{userDetails.firstname && userDetails.firstname}
</p>
</div>
<p className="text-base text-slate-700 dark:text-black">
<span className="font-semibold">Description: </span>
{props.details?.description && props.details.description}
</p>
</div>
</div>
{/* end of job title */}
{/* job details */}
<div className="w-full lg:w-1/2">
<p className="text-base text-sky-blue">Delivery Detail</p>
<div className="mt-2">
<p className="text-base text-slate-700 dark:text-black">
<span className="font-semibold">Due: </span>
{props.details?.delivery_date &&
props.details.delivery_date.split(" ")[0]}
</p>
<p className="py-2 text-base text-slate-700 dark:text-black">
{props.details?.delivery_date &&
props.details.delivery_date.split(" ")[1]}
</p>
<p className="text-base text-slate-700 dark:text-black">
{props.details?.timeline_days && props.details.timeline_days} day(s)
</p>
</div>
</div>
{/* end of job details */}
</div>
<div className="my-4 py-[20px] bg-white px-4 rounded-2xl shadow-md lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
<div className="w-full lg:w-1/2">
<div className="">
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Actions</h1>
<p className="my-3 py-1 text-base">
Waiting for the completion message from the client before you can approve.
</p>
</div>
{/* TEXTAREA SECTION */}
<div className="mt-5">
<div className="">
{/* <p className="relative py-2 my-2 text-lg font-bold text-slate-600 dark:text-black border-b-2 border-slate-300 tracking-wide after:absolute after:-bottom-0.5 after:content-[''] after:w-[100px] after:h-[2px] after:bg-sky-blue after:left-0">Message(s)</p> */}
<div className="my-2 flex items-center border-b border-slate-300">
<button
name='message'
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-black border ${tab == 'message'? 'border-sky-blue':'border-slate-300'} tracking-wide transition duration-200`}>
Send Message
</button>
<button
name='files'
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-black border ${tab == 'files'? 'border-sky-blue':'border-slate-300'} tracking-wide transition duration-200`}>
Send Files
</button>
</div>
{tab == 'message' ?
(
<textarea
className="p-4 w-full h-[300px] text-base text-slate-600 border border-slate-300 outline-none"
// rows="10"
style={{ resize: "none" }}
name='message'
onChange={handleMessageChange}
value={messageToSend}
/>
)
:
<div className="p-4 w-full h-[300px] text-base text-slate-600 border border-slate-300">
<div className="files">
<label htmlFor="file" className="h-20 btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer">Select Files to Upload</label>
<input type="file" id='file' accept="image/*" style={{display: 'none'}} onChange={handleFileChange}/>
</div>
<div className="selected_file my-2">
{filesToSend.length > 0 &&
filesToSend.map((item, index)=> (
<p key={index} className="flex items-center space-x-2">
<span>{item.name}</span>
<button name='remove' onClick={()=>handleRemoveImage(item)} className="px-2 flex justify-center items-center rounded-full border border-red-500 text-red-500">x</button>
</p>
))
}
</div>
</div>
}
</div>
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
<div className="w-full">
{/* error or success display */}
{requestStatus.message != "" &&
(!requestStatus.status ? (
<div
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{requestStatus.message}
</div>
{tab == "files" ? (
<button
onClick={sendFile}
type="button"
className="btn-gradient text-base tracking-wide px-4 py-3 rounded-full flex justify-center items-center"
>
{requestStatus.loading ? (
<LoadingSpinner size="6" color="sky-blue" />
) : (
requestStatus.status && (
<div
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
<>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="24"
height="24"
fill="white"
>
{requestStatus.message}
</div>
)
))}
</div>
{/* End of error or success display */}
<path d="M12 2L2 12h3v8h14v-8h3L12 2zm0 16v-6h-2v6H7l5-5 5 5h-3z" />
</svg>
{/* Buttons Sections */}
<div className="py-2 sm:flex sm:justify-end sm:items-center">
{/* <div className="w-full mb-3 sm:mb-0 sm:w-2/4">
{tab == 'files' &&
(
<button
onClick={()=>{console.log('working')}}
type="button"
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-md flex justify-center items-center"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill='white'>
<path d="M12 2L2 12h3v8h14v-8h3L12 2zm0 16v-6h-2v6H7l5-5 5 5h-3z"/>
</svg>
<span className="text-white">Upload Files</span>
</button>
)
}
</div> */}
<div className="w-full sm:w-2/4 flex justify-between items-center space-x-2">
<button
type="button"
onClick={handleClearAll}
className="border-gradient text-base tracking-wide px-4 py-3 rounded-full"
>
<span className="text-gradient">Clear</span>
</button>
{tab == 'files' ?
(
<button
onClick={sendFile}
type="button"
className="btn-gradient text-base tracking-wide px-4 py-3 rounded-full flex justify-center items-center"
>
{requestStatus.loading ?
<LoadingSpinner size='6' color='sky-blue' />
:
<>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill='white'>
<path d="M12 2L2 12h3v8h14v-8h3L12 2zm0 16v-6h-2v6H7l5-5 5 5h-3z"/>
</svg>
<span className="text-white">Upload Files</span>
</>
}
</button>
)
:
(
<button
onClick={sendTaskMessage}
type="button"
className="btn-gradient text-base text-white tracking-wide px-4 py-3 rounded-full"
>
{requestStatus.loading ?
<LoadingSpinner size='6' color='sky-blue' />
:
<span className="text-white">Send</span>
}
</button>
)
}
</div>
</div>
{/* end of Buttons Sections */}
<span className="text-white">Upload Files</span>
</>
)}
</button>
) : (
<button
onClick={sendTaskMessage}
type="button"
className="btn-gradient text-base text-white tracking-wide px-4 py-3 rounded-full"
>
{requestStatus.loading ? (
<LoadingSpinner size="6" color="sky-blue" />
) : (
<span className="text-white">Send</span>
)}
</button>
)}
</div>
{/* END OF TEXTAREA */}
</div>
{/* MESSAGE SECTION */}
<div className="w-full lg:w-1/2">
<p className="text-lg font-bold text-dark-gray dark:text-black tracking-wide">Message</p>
{props.activeJobMesList.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<ActiveJobMessage activeJobMesList={props.activeJobMesList} />
}
</div>
{/* END OF MESSAGE */}
{/* end of Buttons Sections */}
</div>
{/* END OF TEXTAREA */}
</div>
{/* MESSAGE SECTION */}
<div className="w-full lg:w-1/2">
<div className="flex justify-between items-center gap-5">
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
Message
</p>
<button
type="button"
onClick={popUpHandler}
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
view all
</button>
</div>
{props.activeJobMesList.loading ? (
<LoadingSpinner size="16" color="sky-blue" />
) : (
<ActiveJobMessage activeJobMesList={props.activeJobMesList} />
)}
</div>
{/* END OF MESSAGE */}
</div>
{/* POPOUT SECTION */}
{popUp && (
<PopModal
popUpHandler={popUpHandler}
popUp={popUp}
details={props.details}
activeJobMesList={props.activeJobMesList}
handlePrint={handlePrint}
myRef={printRef}
/>
)}
{/* END OF POPOUT SECTION */}
</Layout>
);
}
export default ActiveJobs;
function convertFileToBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => {
const base64String = reader.result.split(",")[1];
resolve(base64String);
};
reader.onerror = (error) => {
reject(error);
};
reader.readAsDataURL(file);
});
}
//POPOUT COMPONENT FUNCTION
const PopModal = ({
popUpHandler,
popUp,
details,
activeJobMesList,
handlePrint,
myRef,
}) => {
return (
<ModalCom action={popUpHandler} situation={popUp} className="edit-popup">
<div
ref={myRef}
className="message-modal-wrapper min-w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl"
>
<div className="message-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
{details?.contract}
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
onClick={popUpHandler}
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
<div className="w-full flex flex-col items-center">
{activeJobMesList.loading ? (
<LoadingSpinner size="16" color="sky-blue" />
) : (
<div className="message-table h-[500px] overflow-y-auto">
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className="border-b-2">
<tr className="text-slate-600">
<th className="p-2"></th>
</tr>
</thead>
{activeJobMesList?.data?.length ? (
<tbody>
{activeJobMesList?.data?.map((item, index) => (
<tr key={index} className="text-slate-500">
<td>
<div className="msg_box">
<div className="msg_header">
{item.msg_date} {item.msg_firstname}
</div>
<span
className="p-2"
dangerouslySetInnerHTML={{
__html: item.message,
}}
></span>
</div>
</td>
</tr>
))}
</tbody>
) : activeJobMesList.error ? (
<tbody>
<tr className="text-slate-500">
<td className="p-2" colSpan={4}>
Opps! an error occurred. Please try again!
</td>
</tr>
</tbody>
) : (
<tbody>
<tr className="text-slate-500">
<td className="p-2" colSpan={4}>
No Message Found!
</td>
</tr>
</tbody>
)}
</table>
</div>
)}
</div>
{/* btn */}
<div className="flex justify-end items-center">
<div className="py-3 w-full lg:w-1/2 flex justify-between items-center">
<button
onClick={handlePrint}
type="button"
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Print</span>
</button>
<button
onClick={popUpHandler}
type="button"
className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white"
>
<span className="text-gradient">Cancel</span>
</button>
</div>
</div>
</div>
</div>
</ModalCom>
);
};
@@ -0,0 +1,33 @@
import React from 'react'
function CurrentJobAction() {
return (
<div className='job-action bg-white dark:bg-black'>
<p className="my-3 py-1 text-base active-owner">
<table className="w-full text-sm text-left text-gray-500">
<tbody>
<tr>
<td>
<div className="flex space-x-2 items-center w-full">
<h1 className="text-xl text-dark-gray dark:text-white">
Waiting for the completion message from the client before you can approve.
</h1>
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
</div>
</td>
<td className="text-right py-4 px-2">
<div className="flex justify-center items-center">
.
</div>
</td>
</tr>
</tbody>
</table>
</p>
</div>
)
}
export default CurrentJobAction
@@ -0,0 +1,182 @@
import React, { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import ModalCom from '../../Helpers/ModalCom'
import LoadingSpinner from '../../Spinners/LoadingSpinner'
import usersService from '../../../services/UsersService'
function CurrentTaskAction({jobDetails}) {
const apiCall = new usersService()
const navigate = useNavigate()
const [checked, setChecked] = useState(false)
const [reqStatus, setReqStatus] = useState({loading:false, status: false, message: ''})
let [popUp, setPopUp] = useState(false)
const popUpHandler = () => {
if(popUp){
setChecked(false)
}
setPopUp(prev => !prev)
}
// FUNCTION TO HANDLE WHEN USER CLICKS ON SEND FOR REVIEW AND ACCEPTANCE
const taskCompletedSubmit = () => {
setReqStatus({loading:true, status: false, message: ''}) // Sets loading spinner active
let reqData = {
contract: jobDetails.contract,
contract_uid: jobDetails.contract_uid,
job_action: 'NOTIFY_COMPLETE',
}
if(!checked){ // checks that checkbox is selected
setReqStatus({loading:false, status: false, message: 'Please check the box above'})
return setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
}
// API CALL TO MARK TASK AS COMPLETED BY WORKER
apiCall.workerJobAction(reqData).then((res)=>{
if(res.status != 200 || res.data.internal_return < 0){
setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
return
}
setReqStatus({loading:false, status: true, message: 'Task marked completed successfully'})
setTimeout(()=>{ // Sets popout to false and navigates user to /mytask after 3 seconds
popUpHandler()
navigate('/mytask', {replace: true})
}, 3000)
}).catch(err => {
setReqStatus({loading:false, status: false, message: 'Opps! Network error. Try again'})
}).finally(()=>{
setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
})
}
return (
<div className='job-action bg-white dark:bg-black'>
<table className="w-full text-sm text-left text-gray-500 active-worker">
<tbody>
<tr>
<td>
<div className="flex space-x-2 items-center w-full">
<h1 className="text-xl text-dark-gray dark:text-white">
I completed this task and ready for review and acceptance.
</h1>
{/*<div className="flex flex-col flex-[0.9]">*/}
{/*</div>*/}
</div>
</td>
</tr>
<tr>
<td>
<div className="flex justify-center items-center">
<button onClick={popUpHandler} type="button" className="w-120 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
Send of Review
</button>
</div>
</td>
</tr>
</tbody>
</table>
{popUp && (
<ModalCom action={popUpHandler} situation={popUp}>
<div className="logout-modal-wrapper lg:w-[460px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Confirm Completion
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
onClick={popUpHandler}
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
<div className="w-full flex flex-col items-center">
<div className="mb-10 flex justify-center items-center gap-2">
<input
type='checkbox'
checked={checked}
onChange={()=>{setChecked(prev => !prev)}}
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
/>
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>If you have completed this task</p>
</div>
<div className="mb-10 flex justify-center items-center">
{reqStatus.loading ?
<LoadingSpinner color='sky-blue' size='10' />
:
<button type="button" onClick={taskCompletedSubmit} className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
Send for Review & Acceptance
</button>
}
</div>
{/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
<div className="w-full">
{reqStatus.message != "" &&
(!reqStatus.status ? (
<div
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{reqStatus.message}
</div>
) : (
reqStatus.status && (
<div
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{reqStatus.message}
</div>
)
))}
</div>
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
</div>
{/* cancel btn */}
<div className='flex justify-end items-center'>
<button onClick={popUpHandler} type="button" className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white">
<span className='text-gradient'>Cancel</span>
</button>
</div>
</div>
</div>
</ModalCom>
)}
</div>
)
}
export default CurrentTaskAction
@@ -0,0 +1,45 @@
import React from 'react'
import CurrentJobAction from './CurrentJobAction'
import CurrentTaskAction from './CurrentTaskAction'
import PastDueJobAction from './PastDueJobAction'
import PastDueTaskAction from './PastDueTaskAction'
import ReviewJobAction from './ReviewJobAction'
import ReviewTaskAction from './ReviewTaskAction'
function IndexJobActions({details}) { // FUNCTION TO RENDER SPECIFIC JOB ACTION DEPENDING ON OWNER STATUS & STATUS DESCRIPTION
let owner = details.owner_status
let description = details.status_description
switch(owner) {
case 'OWNER':
return (()=>{
if(description == 'ACTIVE'){
return <CurrentJobAction jobDetails={details} />
}else if(description == 'PASTDUE'){
return <PastDueJobAction jobDetails={details} />
}else if(description == 'REVIEW'){
return <ReviewJobAction jobDetails={details} />
} else {
return null
}
})()
case 'WORKER':
return (()=>{
if(description == 'ACTIVE'){
return <CurrentTaskAction jobDetails={details} />
}else if(description == 'PASTDUE'){
return <PastDueTaskAction jobDetails={details} />
}else if(description == 'REVIEW'){
return <ReviewTaskAction jobDetails={details} />
} else {
return null
}
})()
default:
return null
}
}
export default IndexJobActions
@@ -0,0 +1,246 @@
import React,{useState} from 'react'
import ModalCom from '../../Helpers/ModalCom'
import LoadingSpinner from '../../Spinners/LoadingSpinner'
import { useNavigate } from 'react-router-dom'
import usersService from '../../../services/UsersService'
function PastDueJobAction({jobDetails}) {
const apiCall = new usersService()
const navigate = useNavigate()
const [checked, setChecked] = useState(false)
const [extendedTime, setExtendedTime] = useState('') // VALUE OF NEW EXTENDED TIME
const [action, setAction] = useState('') // VALUE OF NEW EXTENDED TIME
const [reqStatus, setReqStatus] = useState({loading:false, status: false, message: ''})
let [popUp, setPopUp] = useState(false)
const popUpHandler = () => {
if(popUp){
setChecked(false)
}
setPopUp(prev => !prev)
}
// FUNCTION TO HANDLE WHEN OWNER CANCELS JOB
const cancelTask = () => {
setAction('cancel')
setReqStatus({loading:true, status: false, message: ''})
let reqData = { // API PAYLOADS
contract: jobDetails.contract,
contract_uid: jobDetails.contract_uid,
job_action: 'REQUEST_CANCEL',
}
if(!checked){ // CHECKS IF CHECKBOX IS SELECTED
setReqStatus({loading:false, status: false, message: 'Please check the box above'})
return setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
}
// API CALL TO ACCEPT COMPLETION BY OWNER
apiCall.ownerJobAction(reqData).then((res)=>{
if(res.status != 200 || res.data.internal_return < 0){
setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
return
}
setReqStatus({loading:false, status: true, message: 'job cancelled successfully'})
setTimeout(()=>{ // Sets popout to false and navigates user to /my-pastdue-jobs after 3 seconds
popUpHandler()
navigate('/my-pastdue-jobs', {replace: true})
}, 3000)
}).catch(err => {
setReqStatus({loading:false, status: false, message: 'Opps! Network error. Try again'})
}).finally(()=>{
setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
})
}
// FUNCTION TO HANDLE WHEN USER/OWNER CLICKS ON EXTEND TIMELINE FOR A JOB
const extendTime = () => {
setAction('extend')
setReqStatus({loading:true, status: false, message: ''}) // Sets loading spinner active
let reqData = {
contract: jobDetails.contract,
contract_uid: jobDetails.contract_uid,
job_action: 'EXTEND_TIMELINE',
extension: Number(extendedTime)
}
if(!extendedTime){ // checks that timeline duration is selected
setReqStatus({loading:false, status: false, message: 'Please select timeline duration'})
return setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
}
// API CALL EXTEND TIMELINE BY OWNER
apiCall.ownerJobAction(reqData).then((res)=>{
if(res.status != 200 || res.data.internal_return < 0){
setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
return
}
setReqStatus({loading:false, status: true, message: 'Timeline extended successfully'})
setTimeout(()=>{ // Sets popout to false and navigates user to /my-pastdue-jobs after 3 seconds
popUpHandler()
navigate('/my-pastdue-jobs', {replace: true})
}, 3000)
}).catch(err => {
setReqStatus({loading:false, status: false, message: 'Opps! Network error. Try again'})
}).finally(()=>{
setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
})
}
return (
<div className='job-action bg-white dark:bg-black'>
<table className="w-full text-sm text-left text-gray-500 owner-pastdue">
<tbody>
<tr>
<td>
<div className="flex space-x-2 items-center w-full">
<h1 className="text-xl text-dark-gray dark:text-white">
Time allocated has passed
</h1>
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
</div>
</td>
</tr>
<tr>
<td>
<div className="flex justify-center items-center">
<button type="button" onClick={popUpHandler} className="w-120 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
Cancel or Extend Timeline
</button>
</div>
</td>
</tr>
</tbody>
</table>
{popUp && (
<ModalCom action={popUpHandler} situation={popUp}>
<div className="logout-modal-wrapper lg:w-[460px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Past Due Task
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
onClick={popUpHandler}
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
<div className="w-full flex flex-col items-center">
<div className="mb-5 flex justify-center items-center gap-2">
<input
type='checkbox'
checked={checked}
onChange={()=>{setChecked(prev => !prev)}}
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
/>
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>I am ready to cancel this task</p>
</div>
<div className="mb-5 flex justify-center items-center">
{reqStatus.loading && action=='cancel'?
<LoadingSpinner color='sky-blue' size='10' />
:
<button disabled={reqStatus.loading} onClick={cancelTask} type="button" className="px-2 py-1 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white">
<span className='text-gradient'>Cancel this task</span>
</button>
}
</div>
{/* EXTEND TIMELINE SECTION */}
<div className='w-full my-3 py-3 border-y flex flex-col items-center'>
<div className='mb-5 flex items-center gap-2'>
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>Extend the timeline by:</p>
<select
onChange={({target})=>{setExtendedTime(target.value)}}
className='text-base p-2 text-dark-gray dark:text-white rounded-md border border-slate-300 outline-0'
>
<option className='text-slate-500 text-lg' value=''>select</option>
<option className='text-slate-500 text-lg' value='2'>1 days</option>
<option className='text-slate-500 text-lg' value='3'>3 days</option>
<option className='text-slate-500 text-lg' value='5'>5 days</option>
<option className='text-slate-500 text-lg' value='7'>1 week</option>
</select>
</div>
{reqStatus.loading && action=='extend' ?
<LoadingSpinner color='sky-blue' size='10' />
:
<button disabled={reqStatus.loading} type="button" onClick={extendTime} className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
Extend Timeline
</button>
}
</div>
{/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
<div className="w-full">
{reqStatus.message != "" &&
(!reqStatus.status ? (
<div
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{reqStatus.message}
</div>
) : (
reqStatus.status && (
<div
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{reqStatus.message}
</div>
)
))}
</div>
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
</div>
{/* cancel btn */}
<div className='flex justify-end items-center'>
<button onClick={popUpHandler} type="button" className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white">
<span className='text-gradient'>Cancel</span>
</button>
</div>
</div>
</div>
</ModalCom>
)}
</div>
)
}
export default PastDueJobAction
@@ -0,0 +1,35 @@
import React from 'react'
function PastDueTaskAction() {
return (
<div className='job-action bg-white dark:bg-black'>
<table className="w-full text-sm text-left text-gray-500 worker-pastdue">
<tbody>
<tr>
<td>
<div className="flex space-x-2 items-center w-full">
<h1 className="text-xl text-dark-gray dark:text-white">
You have missed the allocated time
</h1>
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
</div>
</td>
</tr>
<tr>
<td>
<div className="flex justify-center items-center">
<button type="button" className="w-120 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
Request Extension
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
)
}
export default PastDueTaskAction
@@ -0,0 +1,226 @@
import React,{useState} from 'react'
import ModalCom from '../../Helpers/ModalCom'
import LoadingSpinner from '../../Spinners/LoadingSpinner'
import { useNavigate } from 'react-router-dom'
import usersService from '../../../services/UsersService'
function ReviewJobAction({jobDetails}) {
const apiCall = new usersService()
const navigate = useNavigate()
const [checked, setChecked] = useState(false)
const [action, setAction] = useState('') // VALUE OF NEW EXTENDED TIME
const [reqStatus, setReqStatus] = useState({loading:false, status: false, message: ''})
let [popUp, setPopUp] = useState(false)
const popUpHandler = () => {
if(popUp){
setChecked(false)
}
setPopUp(prev => !prev)
}
// FUNCTION TO HANDLE WHEN OWNER ACCEPTS COMPLETION OF JOB
const acceptCompletion = () => {
setAction('accept')
setReqStatus({loading:true, status: false, message: ''})
let reqData = { // API PAYLOADS
contract: jobDetails.contract,
contract_uid: jobDetails.contract_uid,
job_action: 'ACCEPT_COMPLETE',
}
if(!checked){ // CHECKS IF CHECKBOX IS SELECTED
setReqStatus({loading:false, status: false, message: 'Please check the box above'})
return setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
}
// API CALL TO ACCEPT COMPLETION BY OWNER
apiCall.ownerJobAction(reqData).then((res)=>{
if(res.status != 200 || res.data.internal_return < 0){
setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
return
}
setReqStatus({loading:false, status: true, message: 'job completion accepted successfully'})
setTimeout(()=>{ // Sets popout to false and navigates user to /my-review-jobs after 3 seconds
popUpHandler()
navigate('/my-review-jobs', {replace: true})
}, 3000)
}).catch(err => {
setReqStatus({loading:false, status: false, message: 'Opps! Network error. Try again'})
}).finally(()=>{
setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
})
}
// FUNCTION TO HANDLE WHEN USER/OWNER CLICKS ON REJECT COMPLETION OF JOB
const rejectCompletion = () => {
setAction('reject')
setReqStatus({loading:true, status: false, message: ''}) // Sets loading spinner active
let reqData = { // API PAYLOADS
contract: jobDetails.contract,
contract_uid: jobDetails.contract_uid,
job_action: 'REJECT_COMPLETE',
}
// API CALL TO REJECT COMPLETION BY OWNER
apiCall.ownerJobAction(reqData).then((res)=>{
if(res.status != 200 || res.data.internal_return < 0){
setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
return
}
setReqStatus({loading:false, status: true, message: 'job completion rejected successfully'})
setTimeout(()=>{ // Sets popout to false and navigates user to /my-review-jobs after 3 seconds
popUpHandler()
navigate('/my-review-jobs', {replace: true})
}, 3000)
}).catch(err => {
setReqStatus({loading:false, status: false, message: 'Opps! Network error. Try again'})
}).finally(()=>{
setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
})
}
return (
<div className='job-action bg-white dark:bg-black'>
<div className="my-3 py-1 text-base">
<table className="w-full text-sm text-left text-gray-500 review-owner">
<tbody>
<tr>
<td>
<div className="flex space-x-2 items-center w-full">
<h1 className="text-xl text-dark-gray dark:text-white">
This Job is Ready for your review
</h1>
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
</div>
</td>
</tr>
<tr>
<td>
<div className="flex justify-center items-center">
<button type="button" onClick={popUpHandler} className="w-120 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
Reject or Accept
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
{popUp && (
<ModalCom action={popUpHandler} situation={popUp}>
<div className="logout-modal-wrapper lg:w-[460px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Completion
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
onClick={popUpHandler}
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
<div className="w-full flex flex-col items-center">
<div className="mb-5 flex justify-center items-center gap-2">
<input
type='checkbox'
checked={checked}
onChange={()=>{setChecked(prev => !prev)}}
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
/>
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>I am ready to accept completion</p>
</div>
<div className="mb-5 flex justify-center items-center">
{reqStatus.loading && action=='accept'?
<LoadingSpinner color='sky-blue' size='10' />
:
<button disabled={reqStatus.loading} onClick={acceptCompletion} type="button" className="px-2 py-1 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white">
<span className='text-gradient'>Accept Completion</span>
</button>
}
</div>
{/* EXTEND TIMELINE SECTION */}
<div className='w-full my-3 py-3 border-y flex flex-col items-center'>
<div className='mb-5 flex items-center gap-2'>
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>I am not ready to accept completion of task</p>
</div>
{reqStatus.loading && action=='reject' ?
<LoadingSpinner color='sky-blue' size='10' />
:
<button disabled={reqStatus.loading} type="button" onClick={rejectCompletion} className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
Reject Completion
</button>
}
</div>
{/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
<div className="w-full">
{reqStatus.message != "" &&
(!reqStatus.status ? (
<div
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{reqStatus.message}
</div>
) : (
reqStatus.status && (
<div
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{reqStatus.message}
</div>
)
))}
</div>
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
</div>
{/* cancel btn */}
<div className='flex justify-end items-center'>
<button onClick={popUpHandler} type="button" className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white">
<span className='text-gradient'>Cancel</span>
</button>
</div>
</div>
</div>
</ModalCom>
)}
</div>
)
}
export default ReviewJobAction
@@ -0,0 +1,13 @@
import React from 'react'
function ReviewTaskAction() {
return (
<div className='job-action bg-white dark:bg-black'>
<p className="my-3 py-1 text-base text-dark-gray dark:text-white">
Waiting for the completion message from the client before you can approve. Worker True & Review Job
</p>
</div>
)
}
export default ReviewTaskAction
@@ -1,17 +1,13 @@
import React, { useState } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import dataImage2 from "../../assets/images/data-table-user-2.png";
import { useNavigate, useLocation } from "react-router-dom";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
import { PriceFormatter } from "../Helpers/PriceFormatter";
export default function MyActiveJobTable({ MyJobList, className }) {
const navigate = useNavigate();
let {pathname} = useLocation()
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
let { pathname } = useLocation();
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
@@ -28,7 +24,7 @@ export default function MyActiveJobTable({ MyJobList, className }) {
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${
className || ""
}`}
>
@@ -44,75 +40,92 @@ export default function MyActiveJobTable({ MyJobList, className }) {
{
<>
{MyJobList &&
MyJobList?.result_list &&
MyJobList.result_list.length > 0 &&
currentActiveJobList.map((value, index) => (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className=" py-4">
<div className="flex space-x-2 items-center w-full">
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] max-w-[60px]">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
MyJobList?.result_list &&
MyJobList.result_list.length > 0 ? (
currentActiveJobList.map((value, index) => {
let deliveryDate = value?.delivery_date?.split(" ")[0];
let thePrice = PriceFormatter(
value?.price * 0.01,
value?.currency_code,
value?.currency
);
return (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className=" py-4">
<div className="flex space-x-2 items-center w-full">
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] max-w-[60px]">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{thePrice}
</span>
</span>
<div className="flex gap-4 items-center">
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
<span className="text-sm text-thin-light-gray">
Due:{" "}
<span className="text-purple">
{" "}
{deliveryDate}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Sent to:{" "}
<span className="text-purple">
{" "}
{value.job_to === null
? "public"
: value.job_to}
</span>
</span>
</div>
</div>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{value.price * 0.01}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
<span className="text-sm text-thin-light-gray">
Expire:{" "}
<span className="text-purple">
{" "}
{value.expire}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Send to:{" "}
<span className="text-purple">
{" "}
{value.job_to}
</span>
</span>
</div>
</div>
</td>
</td>
<td className="text-right py-4 px-2">
<div className="flex justify-center items-center">
<button
type="button"
onClick={() => {
navigate("/manage-active-job", {
state: {...value, pathname},
});
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</div>
</td>
</tr>
))}
<td className="text-right py-4 px-2">
<div className="flex justify-center items-center">
<button
type="button"
onClick={() => {
navigate("/manage-active-job", {
state: { ...value, pathname },
});
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</div>
</td>
</tr>
);
})
) : (
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<td className="p-2">No Active Task!</td>
</tr>
)}
</>
}
</tbody>
@@ -0,0 +1,40 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import Layout from "../Partials/Layout";
import CommonHead from "../UserHeader/CommonHead";
import MyActiveJobTable from "./MyActiveJobTable";
export default function MyPastDueJobs(props) {
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
};
return (
<Layout>
<CommonHead commonHeadData={props.commonHeadData} />
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Pass Due Job(s)
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
</div>
</div>
<MyActiveJobTable MyJobList={props.MyJobList} />
</div>
</div>
</Layout>
);
}
@@ -0,0 +1,42 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import Layout from "../Partials/Layout";
import CommonHead from "../UserHeader/CommonHead";
import MyActiveJobTable from "./MyActiveJobTable";
export default function MyReviewDueJobs(props) {
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
};
return (
<Layout>
<CommonHead
commonHeadData={props.commonHeadData}
/>
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Review Due Job(s)
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
</div>
</div>
<MyActiveJobTable MyJobList={props.MyJobList} />
</div>
</div>
</Layout>
);
}
+1 -3
View File
@@ -12,9 +12,7 @@ export default function MyActiveJobs(props) {
console.log("AMEYE LOC1", props.MyJobList);
return (
<Layout>
<CommonHead
commonHeadData={props.commonHeadData}
/>
<CommonHead commonHeadData={props.commonHeadData} />
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
+155
View File
@@ -0,0 +1,155 @@
import { useMemo, useState } from "react";
import usersService from "../../services/UsersService";
import { useDispatch } from "react-redux";
import { tableReload } from "../../store/TableReloads";
const CouponPopup = ({ popUpHandler, data }) => {
const [loader, setLoader] = useState(false);
const apiCall = useMemo(() => new usersService(), []);
const [statusMsg, setStatusMsg] = useState({
success: "",
error: "",
});
const dispatch = useDispatch();
const redeemCouponHandler = async () => {
setLoader(true);
try {
const { code, coupon_id } = data;
const reqData = { code_id: Number(coupon_id), code };
const res = await apiCall.getCouponRedeem(reqData);
if (res.data?.internal_return < 0)
setStatusMsg({ error: "An error occurred" });
else setStatusMsg({ success: res.data?.status_text });
dispatch(tableReload({ type: "COUPONTABLE" }));
setTimeout(() => {
popUpHandler();
setLoader(false);
}, 10000);
} catch (error) {
setLoader(false);
if (error?.status !== 200)
setStatusMsg({
error: {
status: true,
msg:
error?.statusText !== ""
? error?.statusText
: "An error occurred",
},
});
throw new Error(error);
} finally {
setStatusMsg({
success: "",
error: "",
});
}
};
return (
<div className="logout-modal-wrapper lg:w-[460px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Redeem Coupon
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
onClick={popUpHandler}
>
<CloseIcon />
</button>
</div>
<form className="logout-modal-body w-full flex flex-col items-center px-10 py-8 gap-4 border-b dark:border-[#5356fb29] border-light-purple">
<div className="input-com mb-7 flex gap-1 items-center w-full">
{/* Coupon */}
<div className="flex items-center justify-between flex-[0.3]">
<label
className="input-label text-[#181c32] dark:text-white text-[15px] font-semibold"
htmlFor="coupon-token"
>
Coupon:
</label>
</div>
<div className=" flex-[0.7] max-w-[150px]">{data?.code}</div>
</div>
<div className="input-com mb-7 flex gap-1 items-center w-full">
{/* Amount */}
<div className="flex items-center justify-between flex-[0.3]">
<label
className="input-label text-[#181c32] dark:text-white text-[15px] font-semibold"
htmlFor="amount"
>
Amount:
</label>
</div>
<div className=" flex-[0.7] max-w-[150px]">{data?.thePrice}</div>
</div>
<div className="signin-area w-full">
<div className="flex justify-end">
<button
type="button"
onClick={redeemCouponHandler}
className="text-white lg:w-[167px] btn-gradient flex justify-center items-center text-lg tracking-wide px-6 py-2 rounded-full"
>
{loader ? (
<div className="signup btn-loader"></div>
) : (
<span className="font-semibold tracking-wider">
Redeem Now!
</span>
)}
</button>
</div>
{statusMsg.success && (
<p className="text-sm text-green-500 italic">{statusMsg.success}</p>
)}
{statusMsg.error && (
<p className="text-sm text-red-500 italic">{statusMsg.error}</p>
)}
</div>
</form>
<div className="signin-area w-full px-5 py-4">
<div className="flex justify-end">
<button
onClick={popUpHandler}
className="border-gradient text-lg tracking-wide px-6 py-2 rounded-full"
>
<span>Cancel</span>
</button>
</div>
</div>
</div>
);
};
export default CouponPopup;
const CloseIcon = () => (
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
);
+117
View File
@@ -0,0 +1,117 @@
import React, { useEffect, useState } from "react";
import PaginatedList from "../Pagination/PaginatedList";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import ModalCom from "../Helpers/ModalCom";
import CouponPopup from "./CouponPopup";
import { useNavigate } from "react-router-dom";
import { PriceFormatter } from "../Helpers/PriceFormatter";
function CouponTable({ coupon }) {
const [currentPage, setCurrentPage] = useState(0);
const [couponPopup, setCouponPopup] = useState({ state: false, data: null });
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentCoupon = coupon?.data?.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
const navigate = useNavigate();
const handleCouponPopUp = () =>
setCouponPopup((prev) => ({ state: !prev.state }));
useEffect(() => {
if (!coupon) navigate("/my-coupon", { replace: true });
}, []);
return (
<div className="flex flex-col justify-between h-full">
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className="border-b-2">
<tr className="text-slate-600">
<th className="p-2">Coupon</th>
<th className="p-2 text-center">Amount</th>
<th className="p-2"></th>
</tr>
</thead>
{coupon.data.length ? (
<tbody>
{currentCoupon.map((item, index) => {
let thePrice = PriceFormatter(
item?.amount * 0.01,
item?.currency_code,
item?.currency
);
return(
<tr key={index} className="text-slate-500">
<td className="p-2 cursor-default">
{item.added} <br /> {item.code}
</td>
<td className="p-2 text-center cursor-default">{thePrice}</td>
<td className="p-2 h-20 flex items-center justify-end">
<button
type="button"
className="btn-gradient w-[116px] h-[46px] text-white rounded-full text-base bg-pink flex justify-center items-center"
onClick={() => {
setCouponPopup((prev) => ({
state: !prev.state,
data: {...item, thePrice},
}));
}}
>
Redeem
</button>
</td>
</tr>
)})}
</tbody>
) : coupon.error ? (
<tbody>
<tr className="text-slate-500">
<td className="p-2" colSpan={4}>
Opps! an error occurred. Please try again!
</td>
</tr>
</tbody>
) : (
<tbody>
<tr className="text-slate-500">
<td className="p-2" colSpan={4}>
No Purchase History Found!
</td>
</tr>
</tbody>
)}
</table>
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage === 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
coupon?.data?.length
? true
: false
}
data={coupon?.data}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
{couponPopup.state && (
<ModalCom action={handleCouponPopUp} situation={couponPopup.state}>
<CouponPopup
data={couponPopup.data}
popUpHandler={handleCouponPopUp}
/>
</ModalCom>
)}
</div>
);
}
export default CouponTable;
+74
View File
@@ -0,0 +1,74 @@
import React, { useCallback, useEffect, useMemo, useState } from "react";
import Layout from "../Partials/Layout";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import CouponTable from "./CouponTable";
import usersService from "../../services/UsersService";
import { useSelector } from "react-redux";
export default function MyCoupons() {
const apiCall = useMemo(() => new usersService(), []);
const {couponTable} = useSelector(state => state.tableReload)
let [couponHistory, setCouponHistory] = useState({
// FOR COUPON HISTORY
loading: true,
data: [],
error: false,
});
//FUNCTION TO GET COUPON HISTORY
const getCouponHistory = useCallback(() => {
apiCall
.getCouponPending()
.then((res) => {
if (res.data.internal_return < 0) {
// success but no data
setCouponHistory((prev) => ({ ...prev, loading: false }));
return;
}
setCouponHistory((prev) => ({
...prev,
loading: false,
data: res.data.result_list,
}));
})
.catch((error) => {
setCouponHistory((prev) => ({ ...prev, loading: false, error: true }));
});
}, [apiCall]);
useEffect(() => {
getCouponHistory();
}, [couponTable]);
return (
<>
<Layout>
<div className="my-wallet-wrapper w-full mb-10">
{/* heading */}
<div className="sm:flex justify-start items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
Coupons
</h1>
</div>
</div>
<div className="w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
{/* COUPON SECTION */}
<div className="lg:w-4/4 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full max-h-[500px] min-h-[500px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow coupon">
{couponHistory.loading ? (
<div className="w-full h-full flex justify-center items-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
) : (
<CouponTable coupon={couponHistory} />
)}
</div>
</div>
{/* END OF COUPON SECTION */}
</div>
</div>
</Layout>
</>
);
}
+151 -115
View File
@@ -1,18 +1,34 @@
import React, { useCallback, useEffect, useMemo, useState } from "react";
import { useCallback, useEffect, useMemo, useState } from "react";
import dataImage2 from "../../assets/images/data-table-user-2.png";
import SelectBox from "../Helpers/SelectBox";
import DeleteJobPopout from "../jobPopout/DeleteJobPopout";
import JobListPopout from "../jobPopout/JobListPopout";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import { useSelector } from "react-redux";
import usersService from "../../services/UsersService";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
import EditJobPopOut from "../jobPopout/EditJobPopout";
import { PriceFormatter } from "../Helpers/PriceFormatter";
export default function MyJobTable({ MyJobList, reloadJobList, className }) {
// Getting the categories
const currentJobCart = MyJobList?.data?.categories;
// DropDown Box
const filterCategories = { All: "All Categories", ...currentJobCart };
const [selectedCategory, setCategory] = useState(
Object.keys(filterCategories)[0]
);
let [jobPopout, setJobPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
let [deleteJobPopout, setDeleteJobPopout] = useState({
show: false,
data: {},
}); // STATE TO HOLD THE VALUE OF THE ITEM DETAILS TO DELETE AND DETERMINE WHEN TO SHOW
const [editJob, setEditJob] = useState({ show: false, data: {} });
const [myCountry, setCountries] = useState("");
const {
userDetails: { country },
@@ -44,22 +60,25 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
getCountryList();
}, [getCountryList]);
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
let [jobPopout, setJobPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
let [deleteJobPopout, setDeleteJobPopout] = useState({
show: false,
data: {},
}); // STATE TO HOLD THE VALUE OF THE ITEM DETAILS TO DELETE AND DETERMINE WHEN TO SHOW
const [editJob, setEditJob] = useState({ show: false, data: {} });
// Handle Pagination
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentJobList = MyJobList?.data?.result_list?.slice(
// Handle Filter Job List
const filterJobList = () => {
if (selectedCategory === "All") return MyJobList?.data?.result_list;
else
return MyJobList?.data?.result_list?.filter((item) =>
item.category.includes(selectedCategory)
);
};
const currentJobList = filterJobList();
// Handling Filter Pagination
const filteredCurrentJobList = currentJobList?.slice(
indexOfFirstItem,
indexOfLastItem
);
@@ -68,9 +87,99 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
handlePagingFunc(e, setCurrentPage);
};
// Handles the category selection
const handleSetCategory = (value) => {
setCurrentPage(0);
for (let i in filterCategories) {
if (filterCategories[i] == value) {
setCategory(i);
}
}
};
const JobListItem = ({ value, index }) => {
let thePrice = PriceFormatter(
value?.price * 0.01,
value?.currency_code,
value?.currency
);
return (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className="py-9">
<div className="sm:flex sm:space-x-2 sm:justify-between sm:items-center job-items">
<div className="flex space-x-2 items-center job-items w-full">
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] min-w-[60px] max-w-[60px]">
<img src={dataImage2} alt="data" className="w-full h-full" />
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray">
Price: <span className="text-purple">{thePrice}</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
</div>
</div>
<div className="min-w-[110px] max-w-[110px] bg-yellow-300 mx-2 rounded-md flex flex-nowrap space-x-2 justify-center items-center self-end">
<button
type="button"
className="p-2 w-[60px] h-11"
onClick={() => {
setDeleteJobPopout({
show: true,
data: { thePrice, ...value },
});
}}
>
[Delete]
</button>
<span>|</span>
<button
type="button"
className="p-2 w-[40px] h-11"
onClick={() => {
setEditJob({
show: true,
data: { thePrice, ...value },
});
}}
>
Edit
</button>
</div>
</div>
</td>
<td className="text-right py-9 px-2">
<button
type="button"
onClick={() => {
setJobPopout({ show: true, data: { thePrice, ...value } });
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Manage
</button>
</td>
</tr>
);
};
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${
className || ""
}`}
>
@@ -81,8 +190,8 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
</h1>
</div>
<SelectBox
action={setCategory}
datas={filterCategories}
action={handleSetCategory}
datas={Object.values(filterCategories)}
className="Update-table-dropdown"
contentBodyClasses="w-auto min-w-max"
/>
@@ -93,101 +202,27 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between h-full">
<table className="table-auto min-w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody>
<tr className="text-base text-thin-light-gray border-b default-border-b dark:border-[#5356fb29] ottom ">
<td className="py-1">.</td>
<td className="py-1 text-right">.</td>
</tr>
{selectedCategory === "All Categories" ? (
<>
{MyJobList &&
MyJobList?.data?.result_list &&
MyJobList.data?.result_list.length > 0 &&
currentJobList.map((value, index) => (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className="py-9">
<div className="sm:flex sm:space-x-2 sm:justify-between sm:items-center job-items">
<div className="flex space-x-2 items-center job-items w-full">
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] min-w-[60px] max-w-[60px]">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{value.price * 0.01}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
</div>
</div>
<div className="min-w-[110px] max-w-[110px] bg-yellow-300 mx-2 rounded-md flex flex-nowrap space-x-2 justify-center items-center self-end">
<button
type="button"
className="p-2 w-[60px] h-11"
onClick={() => {
setDeleteJobPopout({
show: true,
data: value,
});
}}
>
[Delete]
</button>
<span>|</span>
<button
type="button"
className="p-2 w-[40px] h-11"
onClick={() => {
setEditJob({
show: true,
data: value,
});
}}
>
Edit
</button>
</div>
</div>
</td>
<td className="text-right py-9 px-2">
<button
type="button"
onClick={() => {
setJobPopout({ show: true, data: value });
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Manage
</button>
</td>
</tr>
))}
</>
) : selectedCategory === "Explore" ? (
<></>
) : (
<></>
)}
<>
{MyJobList &&
MyJobList?.data?.result_list &&
MyJobList.data?.result_list.length > 0 ? (
filteredCurrentJobList?.length ? (
filteredCurrentJobList.map((value, index) => (
<JobListItem index={index} key={index} value={value} />
))
) : (
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<td className="p-2">
No Jobs Available In This Category!
</td>
</tr>
)
) : (
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<td className="p-2">No Jobs Avaliable!</td>
</tr>
)}
</>
</tbody>
</table>
@@ -197,11 +232,11 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
MyJobList?.data?.result_list?.length
currentJobList?.length
? true
: false
}
data={MyJobList?.data?.result_list}
data={currentJobList}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
@@ -245,6 +280,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
}}
situation={editJob.show}
country={myCountry}
categories={currentJobCart}
/>
)}
</div>
+24 -26
View File
@@ -1,52 +1,50 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import Layout from "../Partials/Layout";
import MyJobTable from "./MyJobTable";
import CommonHead from "../UserHeader/CommonHead";
import AddJobPage from "../../views/AddJobPage";
export default function MyJobs(props) {
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
const [popUp, setPopUp] = useState(false);
const popUpHandler = () => {
setPopUp((prev) => !prev);
};
const categoryOptions = props.MyJobList?.data?.categories;
return (
<Layout>
<CommonHead
commonHeadData={props.commonHeadData}
/>
<CommonHead commonHeadData={props.commonHeadData} />
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="sm:flex items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold flex items-center space-x-1 text-dark-gray dark:text-white gap-2">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
My Jobs
</span>
<span>My Jobs</span>
<Link
to="/add-job"
<button
className="text-white btn-gradient text-lg tracking-wide px-5 py-2 rounded-full"
onClick={popUpHandler}
>
Add Job
</Link>
</button>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
</div>
</div>
<MyJobTable
MyJobList={props.MyJobList}
/>
<MyJobTable MyJobList={props.MyJobList} />
</div>
</div>
{/* Add Job List Popout */}
{popUp && (
<AddJobPage
action={popUpHandler}
situation={popUp}
categories={categoryOptions}
/>
)}
{/* End of Add Job List Popout */}
</Layout>
);
}
@@ -1,13 +1,11 @@
import React, { useState } from "react";
import dataImage2 from "../../assets/images/data-table-user-2.png";
import PendingJobsPopout from "../jobPopout/PendingJobsPopout";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
import PendingJobsPopout from "../jobPopout/PendingJobsPopout";
import { PriceFormatter } from "../Helpers/PriceFormatter";
export default function MyPendingJobTable({ MyJobList, className }) {
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
let [jobPopout, setJobPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
const [currentPage, setCurrentPage] = useState(0);
@@ -25,7 +23,7 @@ export default function MyPendingJobTable({ MyJobList, className }) {
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${
className || ""
}`}
>
@@ -41,71 +39,86 @@ export default function MyPendingJobTable({ MyJobList, className }) {
{
<>
{MyJobList &&
MyJobList?.result_list &&
MyJobList.result_list.length > 0 &&
currentActiveJobList.map((value, index) => (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className=" py-4">
<div className="flex space-x-2 items-center w-full">
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] max-w-[60px]">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
MyJobList?.result_list &&
MyJobList.result_list.length > 0 ? (
currentActiveJobList.map((value, index) => {
let deliveryDate = value?.expire?.split(" ")[0];
let thePrice = PriceFormatter(
value?.price * 0.01,
value?.currency_code,
value?.currency
);
return (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className=" py-4">
<div className="flex space-x-2 items-center w-full">
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] max-w-[60px]">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{thePrice}
</span>
</span>
<div className="flex items-center gap-4">
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
<span className="text-sm text-thin-light-gray">
Expire:{" "}
<span className="text-purple">
{" "}
{deliveryDate}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Sent to:{" "}
<span className="text-purple">
{" "}
{value.job_to}
</span>
</span>
</div>
</div>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{value.price * 0.01}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
<span className="text-sm text-thin-light-gray">
Expire:{" "}
<span className="text-purple">
{" "}
{value.expire}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Send to:{" "}
<span className="text-purple">
{" "}
{value.job_to}
</span>
</span>
</div>
</div>
</td>
</td>
<td className="text-right py-4 px-2">
<button
type="button"
onClick={() => {
setJobPopout({ show: true, data: value });
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</td>
</tr>
))}
<td className="text-right py-4 px-2">
<button
type="button"
onClick={() => {
setJobPopout({ show: true, data: value });
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</td>
</tr>
);
})
) : (
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<td className="p-2">No Pending Task!</td>
</tr>
)}
</>
}
</tbody>
+107 -99
View File
@@ -1,67 +1,71 @@
import React, { useCallback, useEffect, useMemo, useState } from "react";
import { useState } from "react";
import dataImage1 from "../../assets/images/data-table-user-1.png";
import PaginatedList from "../Pagination/PaginatedList";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import usersService from "../../services/UsersService";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import { useNavigate, useLocation } from "react-router-dom";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import {useNavigate, useLocation} from 'react-router-dom'
const noTasksBg = require("../../assets/images/no-task-background.jpg");
export default function MyJobTable({ className, ActiveJobList }) {
let navigate = useNavigate()
let {pathname} = useLocation()
// const [tasksData, setTasksData] = useState(null);
// const [loader, setLoader] = useState(false);
// let apiCall = useMemo(() => new usersService(), []);
// const displayTasks = useCallback(async () => {
// try {
// const res = await apiCall.getMyActiveTaskList();
// let {
// data: { result_list },
// internal_return,
// statusText,
// } = await res;
// if (internal_return < 0 || statusText !== "OK") return;
// setTasksData(result_list);
// setLoader(false);
// } catch (error) {
// throw new Error(error);
// }
// }, [apiCall]);
// useEffect(() => {
// displayTasks();
// }, []);
let navigate = useNavigate();
let { pathname } = useLocation();
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentTask = ActiveJobList?.data?.slice(indexOfFirstItem, indexOfLastItem);
const currentTask = ActiveJobList?.data?.slice(
indexOfFirstItem,
indexOfLastItem
);
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
// To navigate to task
const [btnLoader, setBtnLoader] = useState(false);
const navigateMarket = () => {
setBtnLoader(true);
setTimeout(() => {
navigate("/market", { replace: true });
setBtnLoader(false);
}, 2500);
};
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] relative ${
className || ""
}`}
} bg-cover bg-center`}
style={{
backgroundImage: !ActiveJobList?.data.length
? `url('${noTasksBg}')`
: "none",
}}
>
{ActiveJobList.loading ? (
<div className="w-full h-[500px] flex items-center justify-center">
{/* Adding this dark overlay in order to see the texts properly */}
{!ActiveJobList?.data.length && (
<div class="absolute inset-0 bg-black opacity-30"></div>
)}
{ActiveJobList?.data.length > 0 && ActiveJobList.loading && (
<div className="w-full h-[520px] flex items-center justify-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
) : (
<div className="relative w-full sm:rounded-lg">
<div className="h-auto w-full">
{ActiveJobList?.data?.length > 0 ? (
currentTask?.map((task, idx) => (
)}
<div className="relative w-full sm:rounded-lg">
<div className="h-auto w-full">
{ActiveJobList?.data?.length > 0 &&
currentTask?.map((task, idx) => {
let thePrice = PriceFormatter(
task?.price * 0.01,
task?.currency_code,
task?.currency
);
return (
<div
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] w-full flex justify-between items-center hover:bg-gray-50"
key={idx}
@@ -84,30 +88,30 @@ export default function MyJobTable({ className, ActiveJobList }) {
</span>
<span className="text-sm text-thin-light-gray">
Price:
<span className="text-purple ml-1">
{Number(task?.price) * 0.01}
</span>
<span className="text-purple ml-1">{thePrice}</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:
<span className="text-purple ml-1">
{Number(task?.timeline_days) === 1
? `${task?.timeline_days} day`
: `${task?.timeline_days} day(s)`}
<div className="flex gap-4 items-center">
<span className="text-sm text-thin-light-gray">
Duration:
<span className="text-purple ml-1">
{Number(task?.timeline_days) === 1
? `${task?.timeline_days} day`
: `${task?.timeline_days} day(s)`}
</span>
</span>
</span>
<span className="text-sm text-thin-light-gray">
Due Date:
<span className="text-purple ml-1">
{task?.delivery_date}
<span className="text-sm text-thin-light-gray">
Due Date:
<span className="text-purple ml-1">
{task?.delivery_date}
</span>
</span>
</span>
<span className="text-sm text-thin-light-gray">
Confirmation:
<span className="text-purple ml-1">
{task?.contract}
<span className="text-sm text-thin-light-gray">
Confirmation:
<span className="text-purple ml-1">
{task?.contract}
</span>
</span>
</span>
</div>
</div>
</div>
</div>
@@ -117,7 +121,7 @@ export default function MyJobTable({ className, ActiveJobList }) {
type="button"
onClick={() => {
navigate("/manage-active-job", {
state: {...task, pathname},
state: { ...task, pathname },
});
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
@@ -126,45 +130,49 @@ export default function MyJobTable({ className, ActiveJobList }) {
</button>
</div>
</div>
))
)
:
(
ActiveJobList.status ?
<div className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<div className="p-2">
No Tasks!
</div>
</div>
:
<div className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<p className="p-2">
Error Occurred! Unable to display Tasks!
</p>
</div>
)
}
</div>
);
})}
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
ActiveJobList?.data?.length
? true
: false
}
data={ActiveJobList?.data}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
{ActiveJobList?.data?.length <= 0 && (
<div className="flex flex-col items-center justify-center gap-9 my-5">
<div className="p-2 font-bold text-3xl text-white whitespace-nowrap">
You currently have "0" task
</div>
<button
className="w-[115px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
onClick={navigateMarket}
>
{btnLoader ? (
<div className="signup btn-loader"></div>
) : (
"Find Task"
)}
</button>
</div>
)}
{ActiveJobList?.internal_return < 0 && (
<div className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<p className="p-2">Error Occurred! Unable to display Tasks!</p>
</div>
)}
</div>
)}
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
ActiveJobList?.data?.length
? true
: false
}
data={ActiveJobList?.data}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
</div>
);
}
/* */
+395 -400
View File
@@ -6,413 +6,408 @@ import top4 from "../../assets/images/top-buyer-4.png";
import Icons from "../Helpers/Icons";
import SliderCom from "../Helpers/SliderCom";
import OfferJobPopout from '../jobPopout/OfferJobPopout'
import OfferJobPopout from "../jobPopout/OfferJobPopout";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import { PriceFormatter } from "../Helpers/PriceFormatter";
export default function MyOffersTable({ className, MyActiveOffersList }) {
let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
const settings = {
arrows: false,
dots: false,
infinite: MyActiveOffersList?.result_list?.length > 4,
autoplay: true,
slidesToShow: 4,
slidesToScroll: 1,
responsive: [
{
breakpoint: 426,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
infinite: MyActiveOffersList?.result_list?.length > 2,
},
},
],
};
export default function MyOffersTable({ className, MyActiveOffersList}) {
let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
const settings = {
arrows: false,
dots: false,
infinite: MyActiveOffersList?.result_list?.length > 4,
autoplay: true,
slidesToShow: 4,
slidesToScroll: 1,
responsive: [
{
breakpoint: 426,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
infinite: MyActiveOffersList?.result_list?.length > 2,
},
},
],
};
console.log("YES WE SEE OFFERS", MyActiveOffersList);
const sellSlider = useRef(null);
//const buySlider = useRef(null);
const prevHandler = (value) => {
if (value === "sell") {
sellSlider.current.slickPrev();
}
// if (value === "buy") {
// buySlider.current.slickPrev();
// }
};
const nextHandler = (value) => {
if (value === "sell") {
sellSlider.current.slickNext();
}
// if (value === "buy") {
// buySlider.current.slickNext();
// }
};
console.log("YES WE SEE OFFERS",MyActiveOffersList);
const sellSlider = useRef(null);
//const buySlider = useRef(null);
const prevHandler = (value) => {
if (value === "sell") {
sellSlider.current.slickPrev();
}
// if (value === "buy") {
// buySlider.current.slickPrev();
// }
};
const nextHandler = (value) => {
if (value === "sell") {
sellSlider.current.slickNext();
}
// if (value === "buy") {
// buySlider.current.slickNext();
// }
};
if (!MyActiveOffersList || MyActiveOffersList?.result_list?.length == 0) {
return ""; // want blank or no appear when no items
}
if ( !MyActiveOffersList || MyActiveOffersList?.result_list?.length == 0 ){
return(''); // want blank or no appear when no items
}
return (
<>
<div className={`top-seller-top-buyer-wrapper ${className || ""}`}>
<div className="top-seller-top-buyer-wrapper-container">
<div className="main-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0 sm:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow">
<div className="heading flex justify-between items-center mb-4">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">
Offers
</h1>
<div className="slider-btns flex space-x-4">
<button
onClick={() => nextHandler("sell")}
type="button"
className="transform rotate-180 text-dark-gray dark:text-white dark:opacity-25"
>
<Icons name="arrows" />
</button>
<button
onClick={() => prevHandler("sell")}
type="button"
className="transform rotate-180"
>
<div className=" text-dark-gray dark:text-white">
<svg
width="11"
height="19"
viewBox="0 0 11 19"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.09766 1.1499L1.13307 9.11449L9.09766 17.0791"
stroke="url(#paint0_linear_220_23410)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<defs>
<linearGradient
id="paint0_linear_220_23410"
x1="9.09766"
y1="1.1499"
x2="-4.2474"
y2="7.96749"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#F539F8" />
<stop offset="0.416763" stopColor="#C342F9" />
<stop offset="1" stopColor="#5356FB" />
</linearGradient>
</defs>
</svg>
</div>
</button>
</div>
</div>
<div className="slider-content">
<SliderCom settings={settings} selector={sellSlider}>
{
MyActiveOffersList && MyActiveOffersList?.result_list?.length > 0 &&
MyActiveOffersList?.result_list?.map((value, index) => (
<div className="item" key={index}>
<div className="offer-slide-item flex flex-col justify-between items-center">
{/* title */}
<div className="flex justify-center">
<p className="text-xl text-dark-gray dark:text-white font-bold mb-2">
{value.title}
</p>
</div>
{/* username */}
<div className="flex flex-col justify-center my-1">
<p className="text-xs text-thin-light-gray">
{value.timeline_days} Days
</p>
<div className="my-2 flex space-x-1 items-center text-purple text-xs">
<span>{value.price*0.01} {value.currency}</span>
</div>
</div>
{/* items */}
{/* <div className="flex justify-center">
<div className="flex space-x-1 items-center text-purple text-xs">
<span>{value.price*0.01} {value.currency}</span>
</div>
</div> */}
<button
type="button"
onClick={() => {
setOfferPopout({ show: true, data: value });
}}
className="w-20 h-11 self-center btn-gradient text-base rounded-full text-white"
>
Start Task
</button>
</div>
</div>
))
}
{/* <div className="item">*/}
{/* /!* img *!/*/}
{/* <div className="flex justify-center mb-4">*/}
{/* <div className=" w-14 h-14 relative">*/}
{/* <img src={top2} alt="top" className="w-full h-full" />*/}
{/* <div className="absolute right-0 top-0">*/}
{/* <svg*/}
{/* width="18"*/}
{/* height="17"*/}
{/* viewBox="0 0 18 17"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* d="M13.3341 14.7394C12.8954 14.7394 12.4564 14.7416 12.0177 14.7375C11.9347 14.7367 11.8877 14.7647 11.8451 14.835C11.4401 15.4977 11.0288 16.1565 10.6273 16.8213C10.5678 16.9196 10.5247 16.9134 10.444 16.8631C9.84979 16.4937 9.25283 16.1283 8.65967 15.7566C8.58338 15.7089 8.53208 15.708 8.45471 15.755C7.84092 16.1275 7.22251 16.4926 6.60872 16.865C6.51805 16.9202 6.48086 16.9117 6.42548 16.8178C6.03646 16.1562 5.63903 15.4993 5.24757 14.8391C5.20251 14.7628 5.15066 14.7373 5.06297 14.7375C4.23961 14.7408 3.41652 14.7397 2.59315 14.7392C2.38765 14.7392 2.41561 14.7563 2.41561 14.5549C2.4148 13.7182 2.41371 12.8812 2.41724 12.0446C2.41778 11.9479 2.39145 11.892 2.30539 11.8396C1.59985 11.4093 0.899185 10.9712 0.193637 10.5406C0.10921 10.4891 0.0950937 10.4578 0.149387 10.3707C0.541931 9.74279 0.926874 9.11 1.31969 8.48236C1.36855 8.40445 1.36611 8.35423 1.31969 8.27768C0.968138 7.69863 0.624187 7.11497 0.272634 6.5362C0.221055 6.45151 0.238972 6.41974 0.317427 6.37332C0.985783 5.97779 1.65088 5.57656 2.31978 5.18157C2.39905 5.13488 2.41751 5.08167 2.41724 4.99697C2.41452 4.12855 2.41778 3.26012 2.41317 2.39169C2.41262 2.27306 2.43624 2.23152 2.566 2.23261C3.39371 2.23912 4.22142 2.23478 5.0494 2.23777C5.13627 2.23804 5.18459 2.21388 5.23183 2.13651C5.64989 1.44996 6.07501 0.767762 6.49497 0.0823035C6.54574 -0.000494485 6.57994 -0.0284558 6.6793 0.0339821C7.333 0.444986 7.99321 0.845131 8.64799 1.25423C8.73351 1.30771 8.79459 1.30799 8.87874 1.25695C9.44231 0.914355 10.01 0.57882 10.5727 0.23514C10.6764 0.171888 10.7209 0.179218 10.7855 0.289706C11.1428 0.901868 11.512 1.50697 11.8725 2.11723C11.9244 2.20492 11.98 2.23939 12.0853 2.23885C12.9402 2.23369 13.795 2.23804 14.6499 2.23342C14.7604 2.23288 14.7943 2.25948 14.7935 2.37404C14.7886 3.21994 14.7921 4.06557 14.7889 4.91146C14.7886 5.0024 14.8133 5.0548 14.895 5.10475C15.5699 5.51575 16.2391 5.93653 16.9156 6.34509C17.0269 6.41241 17.0179 6.45965 16.9596 6.55276C16.5741 7.16927 16.1956 7.79012 15.8085 8.40554C15.742 8.51114 15.7417 8.58742 15.808 8.69574C16.1799 9.3041 16.5396 9.92006 16.9115 10.5287C16.9756 10.6335 16.959 10.6747 16.8597 10.7331C16.2062 11.1186 15.5574 11.5114 14.9037 11.8964C14.8179 11.9468 14.7881 12.0011 14.7886 12.0991C14.7924 12.9315 14.7889 13.7635 14.7932 14.5958C14.7938 14.7074 14.7645 14.7432 14.6499 14.7416C14.2117 14.7359 13.7728 14.7397 13.3341 14.7394ZM6.15184 8.14086C6.10596 8.18103 6.07881 8.20356 6.05329 8.22745C5.80979 8.45685 5.56655 8.68651 5.32358 8.91644C5.15283 9.07824 5.15093 9.08068 5.3111 9.25143C6.0723 10.062 6.8354 10.871 7.59551 11.6824C7.65577 11.7468 7.69975 11.7546 7.75703 11.6854C7.78282 11.6545 7.81676 11.6306 7.84662 11.6026C8.54565 10.9473 9.24522 10.2922 9.94399 9.63665C10.788 8.84477 11.6304 8.05154 12.4765 7.26184C12.5436 7.1994 12.5257 7.16954 12.4735 7.11497C12.2488 6.87934 12.0234 6.64398 11.8087 6.39965C11.7205 6.29921 11.67 6.30926 11.5777 6.3964C10.3569 7.54661 9.13148 8.69194 7.91014 9.84161C7.83223 9.9149 7.79395 9.91246 7.72201 9.83509C7.22034 9.29568 6.71323 8.76116 6.20857 8.2242C6.18713 8.20194 6.17301 8.17262 6.15184 8.14086Z"*/}
{/* fill="#3897EF"*/}
{/* />*/}
{/* </svg>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* /!* title *!/*/}
{/* <div className="flex justify-center">*/}
{/* <p className="text-base font-bold text-dark-gray dark:text-white">*/}
{/* Brokln Simons*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* username *!/*/}
{/* <div className="flex justify-center mb-1">*/}
{/* <p className="text-xs text-thin-light-gray">*/}
{/* @broklinslam_75*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* items *!/*/}
{/* <div className="flex justify-center">*/}
{/* <div className="flex space-x-1 items-center text-purple text-xs">*/}
{/*<span>*/}
{/* <svg*/}
{/* className="fill-current"*/}
{/* width="13"*/}
{/* height="11"*/}
{/* viewBox="0 0 13 11"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path d="M6.49948 11.0002C6.45633 10.9222 6.44195 10.8402 6.41935 10.7642C5.68171 8.2937 4.94614 5.82125 4.20645 3.35081C4.18385 3.27679 4.19001 3.25879 4.27836 3.25879C5.71459 3.28079 7.15287 3.2968 8.5891 3.3168C8.698 3.3188 8.698 3.3188 8.66923 3.42482C7.9542 5.92527 7.23917 8.42573 6.52414 10.9242C6.51797 10.9462 6.50975 10.9682 6.49948 11.0002Z" />*/}
{/* <path d="M13.0002 3.25468C10.9619 5.75913 8.93804 8.24759 6.91418 10.736C6.88952 10.71 6.91007 10.69 6.91623 10.67C7.60866 8.24959 8.30109 5.82715 8.99352 3.40671C9.00585 3.3607 9.04489 3.34269 9.07776 3.31469C9.20515 3.19867 9.34898 3.25868 9.48048 3.25868C10.6147 3.25268 11.7489 3.25468 12.883 3.25468C12.9159 3.25468 12.9467 3.25468 13.0002 3.25468Z" />*/}
{/* <path d="M0 3.25444C0.0472578 3.25444 0.0739687 3.25444 0.10068 3.25444C1.32322 3.25444 2.5437 3.25444 3.76624 3.25244C3.82994 3.25244 3.86281 3.26444 3.88336 3.33046C4.59428 5.72089 5.30725 8.11132 6.01818 10.5018C6.02845 10.5338 6.04694 10.5638 6.03667 10.6078C4.02513 8.15933 2.01976 5.71489 0 3.25444Z" />*/}
{/* <path d="M8.66592 2.93668C7.16189 2.93668 5.67224 2.93668 4.18054 2.93668C4.17438 2.90268 4.20314 2.88867 4.21753 2.86867C4.94899 1.96651 5.68046 1.06434 6.40988 0.160178C6.44275 0.120171 6.45919 0.0821637 6.51261 0.150176C7.21942 1.06634 7.93034 1.98051 8.63921 2.89668C8.64743 2.90668 8.65154 2.91668 8.66592 2.93668Z" />*/}
{/* <path d="M2.70399 0.129883C3.0615 1.07205 3.41491 2.00222 3.77037 2.93639C2.52729 2.93639 1.29448 2.93639 0.0390625 2.93639C0.930796 1.99622 1.81226 1.06805 2.70399 0.129883Z" />*/}
{/* <path d="M12.9687 2.9386C12.7324 2.9386 12.5166 2.9386 12.3009 2.9386C11.3126 2.9386 10.3263 2.9386 9.33803 2.9386C9.28255 2.9386 9.25173 2.9406 9.2805 2.86859C9.63185 1.97642 9.98115 1.08226 10.3304 0.190099C10.3366 0.174096 10.3387 0.154092 10.3633 0.14209C11.2263 1.06826 12.0913 1.99643 12.9687 2.9386Z" />*/}
{/* <path d="M8.97094 2.81832C8.24152 1.87815 7.52238 0.947984 6.79297 0.0078125C7.89223 0.0078125 8.9771 0.0078125 10.0702 0.0078125C9.70651 0.939982 9.34283 1.87015 8.97094 2.81832Z" />*/}
{/* <path d="M3.99333 2.65048C3.66252 1.78032 3.33994 0.930169 3.01735 0.0780142C2.99886 0.0320058 2.97626 0 3.0605 0C4.07962 0.00200036 5.09875 0.00200036 6.13842 0.00200036C5.42133 0.888161 4.71247 1.76432 3.99333 2.65048Z" />*/}
{/* </svg>*/}
{/*</span>*/}
{/* <span>3435 Items</span>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div className="item">*/}
{/* /!* img *!/*/}
{/* <div className="flex justify-center mb-4">*/}
{/* <div className=" w-14 h-14 relative">*/}
{/* <img src={top3} alt="top" className="w-full h-full" />*/}
{/* <div className="absolute right-0 top-0">*/}
{/* <svg*/}
{/* width="18"*/}
{/* height="17"*/}
{/* viewBox="0 0 18 17"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* d="M13.3341 14.7394C12.8954 14.7394 12.4564 14.7416 12.0177 14.7375C11.9347 14.7367 11.8877 14.7647 11.8451 14.835C11.4401 15.4977 11.0288 16.1565 10.6273 16.8213C10.5678 16.9196 10.5247 16.9134 10.444 16.8631C9.84979 16.4937 9.25283 16.1283 8.65967 15.7566C8.58338 15.7089 8.53208 15.708 8.45471 15.755C7.84092 16.1275 7.22251 16.4926 6.60872 16.865C6.51805 16.9202 6.48086 16.9117 6.42548 16.8178C6.03646 16.1562 5.63903 15.4993 5.24757 14.8391C5.20251 14.7628 5.15066 14.7373 5.06297 14.7375C4.23961 14.7408 3.41652 14.7397 2.59315 14.7392C2.38765 14.7392 2.41561 14.7563 2.41561 14.5549C2.4148 13.7182 2.41371 12.8812 2.41724 12.0446C2.41778 11.9479 2.39145 11.892 2.30539 11.8396C1.59985 11.4093 0.899185 10.9712 0.193637 10.5406C0.10921 10.4891 0.0950937 10.4578 0.149387 10.3707C0.541931 9.74279 0.926874 9.11 1.31969 8.48236C1.36855 8.40445 1.36611 8.35423 1.31969 8.27768C0.968138 7.69863 0.624187 7.11497 0.272634 6.5362C0.221055 6.45151 0.238972 6.41974 0.317427 6.37332C0.985783 5.97779 1.65088 5.57656 2.31978 5.18157C2.39905 5.13488 2.41751 5.08167 2.41724 4.99697C2.41452 4.12855 2.41778 3.26012 2.41317 2.39169C2.41262 2.27306 2.43624 2.23152 2.566 2.23261C3.39371 2.23912 4.22142 2.23478 5.0494 2.23777C5.13627 2.23804 5.18459 2.21388 5.23183 2.13651C5.64989 1.44996 6.07501 0.767762 6.49497 0.0823035C6.54574 -0.000494485 6.57994 -0.0284558 6.6793 0.0339821C7.333 0.444986 7.99321 0.845131 8.64799 1.25423C8.73351 1.30771 8.79459 1.30799 8.87874 1.25695C9.44231 0.914355 10.01 0.57882 10.5727 0.23514C10.6764 0.171888 10.7209 0.179218 10.7855 0.289706C11.1428 0.901868 11.512 1.50697 11.8725 2.11723C11.9244 2.20492 11.98 2.23939 12.0853 2.23885C12.9402 2.23369 13.795 2.23804 14.6499 2.23342C14.7604 2.23288 14.7943 2.25948 14.7935 2.37404C14.7886 3.21994 14.7921 4.06557 14.7889 4.91146C14.7886 5.0024 14.8133 5.0548 14.895 5.10475C15.5699 5.51575 16.2391 5.93653 16.9156 6.34509C17.0269 6.41241 17.0179 6.45965 16.9596 6.55276C16.5741 7.16927 16.1956 7.79012 15.8085 8.40554C15.742 8.51114 15.7417 8.58742 15.808 8.69574C16.1799 9.3041 16.5396 9.92006 16.9115 10.5287C16.9756 10.6335 16.959 10.6747 16.8597 10.7331C16.2062 11.1186 15.5574 11.5114 14.9037 11.8964C14.8179 11.9468 14.7881 12.0011 14.7886 12.0991C14.7924 12.9315 14.7889 13.7635 14.7932 14.5958C14.7938 14.7074 14.7645 14.7432 14.6499 14.7416C14.2117 14.7359 13.7728 14.7397 13.3341 14.7394ZM6.15184 8.14086C6.10596 8.18103 6.07881 8.20356 6.05329 8.22745C5.80979 8.45685 5.56655 8.68651 5.32358 8.91644C5.15283 9.07824 5.15093 9.08068 5.3111 9.25143C6.0723 10.062 6.8354 10.871 7.59551 11.6824C7.65577 11.7468 7.69975 11.7546 7.75703 11.6854C7.78282 11.6545 7.81676 11.6306 7.84662 11.6026C8.54565 10.9473 9.24522 10.2922 9.94399 9.63665C10.788 8.84477 11.6304 8.05154 12.4765 7.26184C12.5436 7.1994 12.5257 7.16954 12.4735 7.11497C12.2488 6.87934 12.0234 6.64398 11.8087 6.39965C11.7205 6.29921 11.67 6.30926 11.5777 6.3964C10.3569 7.54661 9.13148 8.69194 7.91014 9.84161C7.83223 9.9149 7.79395 9.91246 7.72201 9.83509C7.22034 9.29568 6.71323 8.76116 6.20857 8.2242C6.18713 8.20194 6.17301 8.17262 6.15184 8.14086Z"*/}
{/* fill="#3897EF"*/}
{/* />*/}
{/* </svg>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* /!* title *!/*/}
{/* <div className="flex justify-center">*/}
{/* <p className="text-base font-bold text-dark-gray dark:text-white">*/}
{/* Brokln Simons*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* username *!/*/}
{/* <div className="flex justify-center mb-1">*/}
{/* <p className="text-xs text-thin-light-gray">*/}
{/* @broklinslam_75*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* items *!/*/}
{/* <div className="flex justify-center">*/}
{/* <div className="flex space-x-1 items-center text-purple text-xs">*/}
{/*<span>*/}
{/* <svg*/}
{/* className="fill-current"*/}
{/* width="13"*/}
{/* height="11"*/}
{/* viewBox="0 0 13 11"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path d="M6.49948 11.0002C6.45633 10.9222 6.44195 10.8402 6.41935 10.7642C5.68171 8.2937 4.94614 5.82125 4.20645 3.35081C4.18385 3.27679 4.19001 3.25879 4.27836 3.25879C5.71459 3.28079 7.15287 3.2968 8.5891 3.3168C8.698 3.3188 8.698 3.3188 8.66923 3.42482C7.9542 5.92527 7.23917 8.42573 6.52414 10.9242C6.51797 10.9462 6.50975 10.9682 6.49948 11.0002Z" />*/}
{/* <path d="M13.0002 3.25468C10.9619 5.75913 8.93804 8.24759 6.91418 10.736C6.88952 10.71 6.91007 10.69 6.91623 10.67C7.60866 8.24959 8.30109 5.82715 8.99352 3.40671C9.00585 3.3607 9.04489 3.34269 9.07776 3.31469C9.20515 3.19867 9.34898 3.25868 9.48048 3.25868C10.6147 3.25268 11.7489 3.25468 12.883 3.25468C12.9159 3.25468 12.9467 3.25468 13.0002 3.25468Z" />*/}
{/* <path d="M0 3.25444C0.0472578 3.25444 0.0739687 3.25444 0.10068 3.25444C1.32322 3.25444 2.5437 3.25444 3.76624 3.25244C3.82994 3.25244 3.86281 3.26444 3.88336 3.33046C4.59428 5.72089 5.30725 8.11132 6.01818 10.5018C6.02845 10.5338 6.04694 10.5638 6.03667 10.6078C4.02513 8.15933 2.01976 5.71489 0 3.25444Z" />*/}
{/* <path d="M8.66592 2.93668C7.16189 2.93668 5.67224 2.93668 4.18054 2.93668C4.17438 2.90268 4.20314 2.88867 4.21753 2.86867C4.94899 1.96651 5.68046 1.06434 6.40988 0.160178C6.44275 0.120171 6.45919 0.0821637 6.51261 0.150176C7.21942 1.06634 7.93034 1.98051 8.63921 2.89668C8.64743 2.90668 8.65154 2.91668 8.66592 2.93668Z" />*/}
{/* <path d="M2.70399 0.129883C3.0615 1.07205 3.41491 2.00222 3.77037 2.93639C2.52729 2.93639 1.29448 2.93639 0.0390625 2.93639C0.930796 1.99622 1.81226 1.06805 2.70399 0.129883Z" />*/}
{/* <path d="M12.9687 2.9386C12.7324 2.9386 12.5166 2.9386 12.3009 2.9386C11.3126 2.9386 10.3263 2.9386 9.33803 2.9386C9.28255 2.9386 9.25173 2.9406 9.2805 2.86859C9.63185 1.97642 9.98115 1.08226 10.3304 0.190099C10.3366 0.174096 10.3387 0.154092 10.3633 0.14209C11.2263 1.06826 12.0913 1.99643 12.9687 2.9386Z" />*/}
{/* <path d="M8.97094 2.81832C8.24152 1.87815 7.52238 0.947984 6.79297 0.0078125C7.89223 0.0078125 8.9771 0.0078125 10.0702 0.0078125C9.70651 0.939982 9.34283 1.87015 8.97094 2.81832Z" />*/}
{/* <path d="M3.99333 2.65048C3.66252 1.78032 3.33994 0.930169 3.01735 0.0780142C2.99886 0.0320058 2.97626 0 3.0605 0C4.07962 0.00200036 5.09875 0.00200036 6.13842 0.00200036C5.42133 0.888161 4.71247 1.76432 3.99333 2.65048Z" />*/}
{/* </svg>*/}
{/*</span>*/}
{/* <span>3435 Items</span>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div className="item">*/}
{/* /!* img *!/*/}
{/* <div className="flex justify-center mb-4">*/}
{/* <div className=" w-14 h-14 relative">*/}
{/* <img src={top4} alt="top" className="w-full h-full" />*/}
{/* <div className="absolute right-0 top-0">*/}
{/* <svg*/}
{/* width="18"*/}
{/* height="17"*/}
{/* viewBox="0 0 18 17"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* d="M13.3341 14.7394C12.8954 14.7394 12.4564 14.7416 12.0177 14.7375C11.9347 14.7367 11.8877 14.7647 11.8451 14.835C11.4401 15.4977 11.0288 16.1565 10.6273 16.8213C10.5678 16.9196 10.5247 16.9134 10.444 16.8631C9.84979 16.4937 9.25283 16.1283 8.65967 15.7566C8.58338 15.7089 8.53208 15.708 8.45471 15.755C7.84092 16.1275 7.22251 16.4926 6.60872 16.865C6.51805 16.9202 6.48086 16.9117 6.42548 16.8178C6.03646 16.1562 5.63903 15.4993 5.24757 14.8391C5.20251 14.7628 5.15066 14.7373 5.06297 14.7375C4.23961 14.7408 3.41652 14.7397 2.59315 14.7392C2.38765 14.7392 2.41561 14.7563 2.41561 14.5549C2.4148 13.7182 2.41371 12.8812 2.41724 12.0446C2.41778 11.9479 2.39145 11.892 2.30539 11.8396C1.59985 11.4093 0.899185 10.9712 0.193637 10.5406C0.10921 10.4891 0.0950937 10.4578 0.149387 10.3707C0.541931 9.74279 0.926874 9.11 1.31969 8.48236C1.36855 8.40445 1.36611 8.35423 1.31969 8.27768C0.968138 7.69863 0.624187 7.11497 0.272634 6.5362C0.221055 6.45151 0.238972 6.41974 0.317427 6.37332C0.985783 5.97779 1.65088 5.57656 2.31978 5.18157C2.39905 5.13488 2.41751 5.08167 2.41724 4.99697C2.41452 4.12855 2.41778 3.26012 2.41317 2.39169C2.41262 2.27306 2.43624 2.23152 2.566 2.23261C3.39371 2.23912 4.22142 2.23478 5.0494 2.23777C5.13627 2.23804 5.18459 2.21388 5.23183 2.13651C5.64989 1.44996 6.07501 0.767762 6.49497 0.0823035C6.54574 -0.000494485 6.57994 -0.0284558 6.6793 0.0339821C7.333 0.444986 7.99321 0.845131 8.64799 1.25423C8.73351 1.30771 8.79459 1.30799 8.87874 1.25695C9.44231 0.914355 10.01 0.57882 10.5727 0.23514C10.6764 0.171888 10.7209 0.179218 10.7855 0.289706C11.1428 0.901868 11.512 1.50697 11.8725 2.11723C11.9244 2.20492 11.98 2.23939 12.0853 2.23885C12.9402 2.23369 13.795 2.23804 14.6499 2.23342C14.7604 2.23288 14.7943 2.25948 14.7935 2.37404C14.7886 3.21994 14.7921 4.06557 14.7889 4.91146C14.7886 5.0024 14.8133 5.0548 14.895 5.10475C15.5699 5.51575 16.2391 5.93653 16.9156 6.34509C17.0269 6.41241 17.0179 6.45965 16.9596 6.55276C16.5741 7.16927 16.1956 7.79012 15.8085 8.40554C15.742 8.51114 15.7417 8.58742 15.808 8.69574C16.1799 9.3041 16.5396 9.92006 16.9115 10.5287C16.9756 10.6335 16.959 10.6747 16.8597 10.7331C16.2062 11.1186 15.5574 11.5114 14.9037 11.8964C14.8179 11.9468 14.7881 12.0011 14.7886 12.0991C14.7924 12.9315 14.7889 13.7635 14.7932 14.5958C14.7938 14.7074 14.7645 14.7432 14.6499 14.7416C14.2117 14.7359 13.7728 14.7397 13.3341 14.7394ZM6.15184 8.14086C6.10596 8.18103 6.07881 8.20356 6.05329 8.22745C5.80979 8.45685 5.56655 8.68651 5.32358 8.91644C5.15283 9.07824 5.15093 9.08068 5.3111 9.25143C6.0723 10.062 6.8354 10.871 7.59551 11.6824C7.65577 11.7468 7.69975 11.7546 7.75703 11.6854C7.78282 11.6545 7.81676 11.6306 7.84662 11.6026C8.54565 10.9473 9.24522 10.2922 9.94399 9.63665C10.788 8.84477 11.6304 8.05154 12.4765 7.26184C12.5436 7.1994 12.5257 7.16954 12.4735 7.11497C12.2488 6.87934 12.0234 6.64398 11.8087 6.39965C11.7205 6.29921 11.67 6.30926 11.5777 6.3964C10.3569 7.54661 9.13148 8.69194 7.91014 9.84161C7.83223 9.9149 7.79395 9.91246 7.72201 9.83509C7.22034 9.29568 6.71323 8.76116 6.20857 8.2242C6.18713 8.20194 6.17301 8.17262 6.15184 8.14086Z"*/}
{/* fill="#3897EF"*/}
{/* />*/}
{/* </svg>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* /!* title *!/*/}
{/* <div className="flex justify-center">*/}
{/* <p className="text-base font-bold text-dark-gray dark:text-white">*/}
{/* Brokln Simons*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* username *!/*/}
{/* <div className="flex justify-center mb-1">*/}
{/* <p className="text-xs text-thin-light-gray">*/}
{/* @broklinslam_75*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* items *!/*/}
{/* <div className="flex justify-center">*/}
{/* <div className="flex space-x-1 items-center text-purple text-xs">*/}
{/*<span>*/}
{/* <svg*/}
{/* className="fill-current"*/}
{/* width="13"*/}
{/* height="11"*/}
{/* viewBox="0 0 13 11"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path d="M6.49948 11.0002C6.45633 10.9222 6.44195 10.8402 6.41935 10.7642C5.68171 8.2937 4.94614 5.82125 4.20645 3.35081C4.18385 3.27679 4.19001 3.25879 4.27836 3.25879C5.71459 3.28079 7.15287 3.2968 8.5891 3.3168C8.698 3.3188 8.698 3.3188 8.66923 3.42482C7.9542 5.92527 7.23917 8.42573 6.52414 10.9242C6.51797 10.9462 6.50975 10.9682 6.49948 11.0002Z" />*/}
{/* <path d="M13.0002 3.25468C10.9619 5.75913 8.93804 8.24759 6.91418 10.736C6.88952 10.71 6.91007 10.69 6.91623 10.67C7.60866 8.24959 8.30109 5.82715 8.99352 3.40671C9.00585 3.3607 9.04489 3.34269 9.07776 3.31469C9.20515 3.19867 9.34898 3.25868 9.48048 3.25868C10.6147 3.25268 11.7489 3.25468 12.883 3.25468C12.9159 3.25468 12.9467 3.25468 13.0002 3.25468Z" />*/}
{/* <path d="M0 3.25444C0.0472578 3.25444 0.0739687 3.25444 0.10068 3.25444C1.32322 3.25444 2.5437 3.25444 3.76624 3.25244C3.82994 3.25244 3.86281 3.26444 3.88336 3.33046C4.59428 5.72089 5.30725 8.11132 6.01818 10.5018C6.02845 10.5338 6.04694 10.5638 6.03667 10.6078C4.02513 8.15933 2.01976 5.71489 0 3.25444Z" />*/}
{/* <path d="M8.66592 2.93668C7.16189 2.93668 5.67224 2.93668 4.18054 2.93668C4.17438 2.90268 4.20314 2.88867 4.21753 2.86867C4.94899 1.96651 5.68046 1.06434 6.40988 0.160178C6.44275 0.120171 6.45919 0.0821637 6.51261 0.150176C7.21942 1.06634 7.93034 1.98051 8.63921 2.89668C8.64743 2.90668 8.65154 2.91668 8.66592 2.93668Z" />*/}
{/* <path d="M2.70399 0.129883C3.0615 1.07205 3.41491 2.00222 3.77037 2.93639C2.52729 2.93639 1.29448 2.93639 0.0390625 2.93639C0.930796 1.99622 1.81226 1.06805 2.70399 0.129883Z" />*/}
{/* <path d="M12.9687 2.9386C12.7324 2.9386 12.5166 2.9386 12.3009 2.9386C11.3126 2.9386 10.3263 2.9386 9.33803 2.9386C9.28255 2.9386 9.25173 2.9406 9.2805 2.86859C9.63185 1.97642 9.98115 1.08226 10.3304 0.190099C10.3366 0.174096 10.3387 0.154092 10.3633 0.14209C11.2263 1.06826 12.0913 1.99643 12.9687 2.9386Z" />*/}
{/* <path d="M8.97094 2.81832C8.24152 1.87815 7.52238 0.947984 6.79297 0.0078125C7.89223 0.0078125 8.9771 0.0078125 10.0702 0.0078125C9.70651 0.939982 9.34283 1.87015 8.97094 2.81832Z" />*/}
{/* <path d="M3.99333 2.65048C3.66252 1.78032 3.33994 0.930169 3.01735 0.0780142C2.99886 0.0320058 2.97626 0 3.0605 0C4.07962 0.00200036 5.09875 0.00200036 6.13842 0.00200036C5.42133 0.888161 4.71247 1.76432 3.99333 2.65048Z" />*/}
{/* </svg>*/}
{/*</span>*/}
{/* <span>3435 Items</span>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div className="item">*/}
{/* /!* img *!/*/}
{/* <div className="flex justify-center mb-4">*/}
{/* <div className=" w-14 h-14 relative">*/}
{/* <img src={top3} alt="top" className="w-full h-full" />*/}
{/* <div className="absolute right-0 top-0">*/}
{/* <svg*/}
{/* width="18"*/}
{/* height="17"*/}
{/* viewBox="0 0 18 17"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* d="M13.3341 14.7394C12.8954 14.7394 12.4564 14.7416 12.0177 14.7375C11.9347 14.7367 11.8877 14.7647 11.8451 14.835C11.4401 15.4977 11.0288 16.1565 10.6273 16.8213C10.5678 16.9196 10.5247 16.9134 10.444 16.8631C9.84979 16.4937 9.25283 16.1283 8.65967 15.7566C8.58338 15.7089 8.53208 15.708 8.45471 15.755C7.84092 16.1275 7.22251 16.4926 6.60872 16.865C6.51805 16.9202 6.48086 16.9117 6.42548 16.8178C6.03646 16.1562 5.63903 15.4993 5.24757 14.8391C5.20251 14.7628 5.15066 14.7373 5.06297 14.7375C4.23961 14.7408 3.41652 14.7397 2.59315 14.7392C2.38765 14.7392 2.41561 14.7563 2.41561 14.5549C2.4148 13.7182 2.41371 12.8812 2.41724 12.0446C2.41778 11.9479 2.39145 11.892 2.30539 11.8396C1.59985 11.4093 0.899185 10.9712 0.193637 10.5406C0.10921 10.4891 0.0950937 10.4578 0.149387 10.3707C0.541931 9.74279 0.926874 9.11 1.31969 8.48236C1.36855 8.40445 1.36611 8.35423 1.31969 8.27768C0.968138 7.69863 0.624187 7.11497 0.272634 6.5362C0.221055 6.45151 0.238972 6.41974 0.317427 6.37332C0.985783 5.97779 1.65088 5.57656 2.31978 5.18157C2.39905 5.13488 2.41751 5.08167 2.41724 4.99697C2.41452 4.12855 2.41778 3.26012 2.41317 2.39169C2.41262 2.27306 2.43624 2.23152 2.566 2.23261C3.39371 2.23912 4.22142 2.23478 5.0494 2.23777C5.13627 2.23804 5.18459 2.21388 5.23183 2.13651C5.64989 1.44996 6.07501 0.767762 6.49497 0.0823035C6.54574 -0.000494485 6.57994 -0.0284558 6.6793 0.0339821C7.333 0.444986 7.99321 0.845131 8.64799 1.25423C8.73351 1.30771 8.79459 1.30799 8.87874 1.25695C9.44231 0.914355 10.01 0.57882 10.5727 0.23514C10.6764 0.171888 10.7209 0.179218 10.7855 0.289706C11.1428 0.901868 11.512 1.50697 11.8725 2.11723C11.9244 2.20492 11.98 2.23939 12.0853 2.23885C12.9402 2.23369 13.795 2.23804 14.6499 2.23342C14.7604 2.23288 14.7943 2.25948 14.7935 2.37404C14.7886 3.21994 14.7921 4.06557 14.7889 4.91146C14.7886 5.0024 14.8133 5.0548 14.895 5.10475C15.5699 5.51575 16.2391 5.93653 16.9156 6.34509C17.0269 6.41241 17.0179 6.45965 16.9596 6.55276C16.5741 7.16927 16.1956 7.79012 15.8085 8.40554C15.742 8.51114 15.7417 8.58742 15.808 8.69574C16.1799 9.3041 16.5396 9.92006 16.9115 10.5287C16.9756 10.6335 16.959 10.6747 16.8597 10.7331C16.2062 11.1186 15.5574 11.5114 14.9037 11.8964C14.8179 11.9468 14.7881 12.0011 14.7886 12.0991C14.7924 12.9315 14.7889 13.7635 14.7932 14.5958C14.7938 14.7074 14.7645 14.7432 14.6499 14.7416C14.2117 14.7359 13.7728 14.7397 13.3341 14.7394ZM6.15184 8.14086C6.10596 8.18103 6.07881 8.20356 6.05329 8.22745C5.80979 8.45685 5.56655 8.68651 5.32358 8.91644C5.15283 9.07824 5.15093 9.08068 5.3111 9.25143C6.0723 10.062 6.8354 10.871 7.59551 11.6824C7.65577 11.7468 7.69975 11.7546 7.75703 11.6854C7.78282 11.6545 7.81676 11.6306 7.84662 11.6026C8.54565 10.9473 9.24522 10.2922 9.94399 9.63665C10.788 8.84477 11.6304 8.05154 12.4765 7.26184C12.5436 7.1994 12.5257 7.16954 12.4735 7.11497C12.2488 6.87934 12.0234 6.64398 11.8087 6.39965C11.7205 6.29921 11.67 6.30926 11.5777 6.3964C10.3569 7.54661 9.13148 8.69194 7.91014 9.84161C7.83223 9.9149 7.79395 9.91246 7.72201 9.83509C7.22034 9.29568 6.71323 8.76116 6.20857 8.2242C6.18713 8.20194 6.17301 8.17262 6.15184 8.14086Z"*/}
{/* fill="#3897EF"*/}
{/* />*/}
{/* </svg>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* /!* title *!/*/}
{/* <div className="flex justify-center">*/}
{/* <p className="text-base font-bold text-dark-gray dark:text-white">*/}
{/* Brokln Simons*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* username *!/*/}
{/* <div className="flex justify-center mb-1">*/}
{/* <p className="text-xs text-thin-light-gray">*/}
{/* @broklinslam_75*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* items *!/*/}
{/* <div className="flex justify-center">*/}
{/* <div className="flex space-x-1 items-center text-purple text-xs">*/}
{/*<span>*/}
{/* <svg*/}
{/* className="fill-current"*/}
{/* width="13"*/}
{/* height="11"*/}
{/* viewBox="0 0 13 11"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path d="M6.49948 11.0002C6.45633 10.9222 6.44195 10.8402 6.41935 10.7642C5.68171 8.2937 4.94614 5.82125 4.20645 3.35081C4.18385 3.27679 4.19001 3.25879 4.27836 3.25879C5.71459 3.28079 7.15287 3.2968 8.5891 3.3168C8.698 3.3188 8.698 3.3188 8.66923 3.42482C7.9542 5.92527 7.23917 8.42573 6.52414 10.9242C6.51797 10.9462 6.50975 10.9682 6.49948 11.0002Z" />*/}
{/* <path d="M13.0002 3.25468C10.9619 5.75913 8.93804 8.24759 6.91418 10.736C6.88952 10.71 6.91007 10.69 6.91623 10.67C7.60866 8.24959 8.30109 5.82715 8.99352 3.40671C9.00585 3.3607 9.04489 3.34269 9.07776 3.31469C9.20515 3.19867 9.34898 3.25868 9.48048 3.25868C10.6147 3.25268 11.7489 3.25468 12.883 3.25468C12.9159 3.25468 12.9467 3.25468 13.0002 3.25468Z" />*/}
{/* <path d="M0 3.25444C0.0472578 3.25444 0.0739687 3.25444 0.10068 3.25444C1.32322 3.25444 2.5437 3.25444 3.76624 3.25244C3.82994 3.25244 3.86281 3.26444 3.88336 3.33046C4.59428 5.72089 5.30725 8.11132 6.01818 10.5018C6.02845 10.5338 6.04694 10.5638 6.03667 10.6078C4.02513 8.15933 2.01976 5.71489 0 3.25444Z" />*/}
{/* <path d="M8.66592 2.93668C7.16189 2.93668 5.67224 2.93668 4.18054 2.93668C4.17438 2.90268 4.20314 2.88867 4.21753 2.86867C4.94899 1.96651 5.68046 1.06434 6.40988 0.160178C6.44275 0.120171 6.45919 0.0821637 6.51261 0.150176C7.21942 1.06634 7.93034 1.98051 8.63921 2.89668C8.64743 2.90668 8.65154 2.91668 8.66592 2.93668Z" />*/}
{/* <path d="M2.70399 0.129883C3.0615 1.07205 3.41491 2.00222 3.77037 2.93639C2.52729 2.93639 1.29448 2.93639 0.0390625 2.93639C0.930796 1.99622 1.81226 1.06805 2.70399 0.129883Z" />*/}
{/* <path d="M12.9687 2.9386C12.7324 2.9386 12.5166 2.9386 12.3009 2.9386C11.3126 2.9386 10.3263 2.9386 9.33803 2.9386C9.28255 2.9386 9.25173 2.9406 9.2805 2.86859C9.63185 1.97642 9.98115 1.08226 10.3304 0.190099C10.3366 0.174096 10.3387 0.154092 10.3633 0.14209C11.2263 1.06826 12.0913 1.99643 12.9687 2.9386Z" />*/}
{/* <path d="M8.97094 2.81832C8.24152 1.87815 7.52238 0.947984 6.79297 0.0078125C7.89223 0.0078125 8.9771 0.0078125 10.0702 0.0078125C9.70651 0.939982 9.34283 1.87015 8.97094 2.81832Z" />*/}
{/* <path d="M3.99333 2.65048C3.66252 1.78032 3.33994 0.930169 3.01735 0.0780142C2.99886 0.0320058 2.97626 0 3.0605 0C4.07962 0.00200036 5.09875 0.00200036 6.13842 0.00200036C5.42133 0.888161 4.71247 1.76432 3.99333 2.65048Z" />*/}
{/* </svg>*/}
{/*</span>*/}
{/* <span>3435 Items</span>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
</SliderCom>
</div>
</div>
return (
<>
<div className={`top-seller-top-buyer-wrapper ${className || ""}`}>
<div className="top-seller-top-buyer-wrapper-container">
<div className="main-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0 sm:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow">
<div className="heading flex justify-between items-center mb-4">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">
Offers
</h1>
<div className="slider-btns flex space-x-4">
<button
onClick={() => nextHandler("sell")}
type="button"
className="transform rotate-180 text-dark-gray dark:text-white dark:opacity-25"
>
<Icons name="arrows" />
</button>
<button
onClick={() => prevHandler("sell")}
type="button"
className="transform rotate-180"
>
<div className=" text-dark-gray dark:text-white">
<svg
width="11"
height="19"
viewBox="0 0 11 19"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.09766 1.1499L1.13307 9.11449L9.09766 17.0791"
stroke="url(#paint0_linear_220_23410)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<defs>
<linearGradient
id="paint0_linear_220_23410"
x1="9.09766"
y1="1.1499"
x2="-4.2474"
y2="7.96749"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#F539F8" />
<stop offset="0.416763" stopColor="#C342F9" />
<stop offset="1" stopColor="#5356FB" />
</linearGradient>
</defs>
</svg>
</div>
</button>
</div>
</div>
<div className="slider-content">
<SliderCom settings={settings} selector={sellSlider}>
{MyActiveOffersList &&
MyActiveOffersList?.result_list?.length > 0 &&
MyActiveOffersList?.result_list?.map((value, index) => {
let thePrice = PriceFormatter(
value?.price * 0.01,
value?.currency_code,
value?.currency
);
return (
<div className="item" key={index}>
<div className="offer-slide-item flex flex-col justify-between items-center">
{/* title */}
<div className="flex justify-center">
<p className="text-xl text-dark-gray dark:text-white font-bold mb-2">
{value.title}
</p>
</div>
{/* username */}
<div className="flex flex-col justify-center my-1">
<p className="text-xs text-thin-light-gray">
{value.timeline_days} Days
</p>
<div className="my-2 flex space-x-1 items-center text-purple text-xs">
<span>{thePrice}</span>
</div>
</div>
<button
type="button"
onClick={() => {
setOfferPopout({ show: true, data: value });
}}
className="w-20 h-11 self-center btn-gradient text-base rounded-full text-white"
>
Start Task
</button>
</div>
</div>
);
})}
{/* Offer Job Popout */}
{offerPopout.show && (
<OfferJobPopout
details={offerPopout.data}
onClose={() => {
setOfferPopout({ show: false, data: {} });
}}
situation={offerPopout.show}
/>
)}
{/* End of Offer Job Popout */}
{/* <div className="item">*/}
{/* /!* img *!/*/}
{/* <div className="flex justify-center mb-4">*/}
{/* <div className=" w-14 h-14 relative">*/}
{/* <img src={top2} alt="top" className="w-full h-full" />*/}
{/* <div className="absolute right-0 top-0">*/}
{/* <svg*/}
{/* width="18"*/}
{/* height="17"*/}
{/* viewBox="0 0 18 17"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* d="M13.3341 14.7394C12.8954 14.7394 12.4564 14.7416 12.0177 14.7375C11.9347 14.7367 11.8877 14.7647 11.8451 14.835C11.4401 15.4977 11.0288 16.1565 10.6273 16.8213C10.5678 16.9196 10.5247 16.9134 10.444 16.8631C9.84979 16.4937 9.25283 16.1283 8.65967 15.7566C8.58338 15.7089 8.53208 15.708 8.45471 15.755C7.84092 16.1275 7.22251 16.4926 6.60872 16.865C6.51805 16.9202 6.48086 16.9117 6.42548 16.8178C6.03646 16.1562 5.63903 15.4993 5.24757 14.8391C5.20251 14.7628 5.15066 14.7373 5.06297 14.7375C4.23961 14.7408 3.41652 14.7397 2.59315 14.7392C2.38765 14.7392 2.41561 14.7563 2.41561 14.5549C2.4148 13.7182 2.41371 12.8812 2.41724 12.0446C2.41778 11.9479 2.39145 11.892 2.30539 11.8396C1.59985 11.4093 0.899185 10.9712 0.193637 10.5406C0.10921 10.4891 0.0950937 10.4578 0.149387 10.3707C0.541931 9.74279 0.926874 9.11 1.31969 8.48236C1.36855 8.40445 1.36611 8.35423 1.31969 8.27768C0.968138 7.69863 0.624187 7.11497 0.272634 6.5362C0.221055 6.45151 0.238972 6.41974 0.317427 6.37332C0.985783 5.97779 1.65088 5.57656 2.31978 5.18157C2.39905 5.13488 2.41751 5.08167 2.41724 4.99697C2.41452 4.12855 2.41778 3.26012 2.41317 2.39169C2.41262 2.27306 2.43624 2.23152 2.566 2.23261C3.39371 2.23912 4.22142 2.23478 5.0494 2.23777C5.13627 2.23804 5.18459 2.21388 5.23183 2.13651C5.64989 1.44996 6.07501 0.767762 6.49497 0.0823035C6.54574 -0.000494485 6.57994 -0.0284558 6.6793 0.0339821C7.333 0.444986 7.99321 0.845131 8.64799 1.25423C8.73351 1.30771 8.79459 1.30799 8.87874 1.25695C9.44231 0.914355 10.01 0.57882 10.5727 0.23514C10.6764 0.171888 10.7209 0.179218 10.7855 0.289706C11.1428 0.901868 11.512 1.50697 11.8725 2.11723C11.9244 2.20492 11.98 2.23939 12.0853 2.23885C12.9402 2.23369 13.795 2.23804 14.6499 2.23342C14.7604 2.23288 14.7943 2.25948 14.7935 2.37404C14.7886 3.21994 14.7921 4.06557 14.7889 4.91146C14.7886 5.0024 14.8133 5.0548 14.895 5.10475C15.5699 5.51575 16.2391 5.93653 16.9156 6.34509C17.0269 6.41241 17.0179 6.45965 16.9596 6.55276C16.5741 7.16927 16.1956 7.79012 15.8085 8.40554C15.742 8.51114 15.7417 8.58742 15.808 8.69574C16.1799 9.3041 16.5396 9.92006 16.9115 10.5287C16.9756 10.6335 16.959 10.6747 16.8597 10.7331C16.2062 11.1186 15.5574 11.5114 14.9037 11.8964C14.8179 11.9468 14.7881 12.0011 14.7886 12.0991C14.7924 12.9315 14.7889 13.7635 14.7932 14.5958C14.7938 14.7074 14.7645 14.7432 14.6499 14.7416C14.2117 14.7359 13.7728 14.7397 13.3341 14.7394ZM6.15184 8.14086C6.10596 8.18103 6.07881 8.20356 6.05329 8.22745C5.80979 8.45685 5.56655 8.68651 5.32358 8.91644C5.15283 9.07824 5.15093 9.08068 5.3111 9.25143C6.0723 10.062 6.8354 10.871 7.59551 11.6824C7.65577 11.7468 7.69975 11.7546 7.75703 11.6854C7.78282 11.6545 7.81676 11.6306 7.84662 11.6026C8.54565 10.9473 9.24522 10.2922 9.94399 9.63665C10.788 8.84477 11.6304 8.05154 12.4765 7.26184C12.5436 7.1994 12.5257 7.16954 12.4735 7.11497C12.2488 6.87934 12.0234 6.64398 11.8087 6.39965C11.7205 6.29921 11.67 6.30926 11.5777 6.3964C10.3569 7.54661 9.13148 8.69194 7.91014 9.84161C7.83223 9.9149 7.79395 9.91246 7.72201 9.83509C7.22034 9.29568 6.71323 8.76116 6.20857 8.2242C6.18713 8.20194 6.17301 8.17262 6.15184 8.14086Z"*/}
{/* fill="#3897EF"*/}
{/* />*/}
{/* </svg>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* /!* title *!/*/}
{/* <div className="flex justify-center">*/}
{/* <p className="text-base font-bold text-dark-gray dark:text-white">*/}
{/* Brokln Simons*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* username *!/*/}
{/* <div className="flex justify-center mb-1">*/}
{/* <p className="text-xs text-thin-light-gray">*/}
{/* @broklinslam_75*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* items *!/*/}
{/* <div className="flex justify-center">*/}
{/* <div className="flex space-x-1 items-center text-purple text-xs">*/}
{/*<span>*/}
{/* <svg*/}
{/* className="fill-current"*/}
{/* width="13"*/}
{/* height="11"*/}
{/* viewBox="0 0 13 11"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path d="M6.49948 11.0002C6.45633 10.9222 6.44195 10.8402 6.41935 10.7642C5.68171 8.2937 4.94614 5.82125 4.20645 3.35081C4.18385 3.27679 4.19001 3.25879 4.27836 3.25879C5.71459 3.28079 7.15287 3.2968 8.5891 3.3168C8.698 3.3188 8.698 3.3188 8.66923 3.42482C7.9542 5.92527 7.23917 8.42573 6.52414 10.9242C6.51797 10.9462 6.50975 10.9682 6.49948 11.0002Z" />*/}
{/* <path d="M13.0002 3.25468C10.9619 5.75913 8.93804 8.24759 6.91418 10.736C6.88952 10.71 6.91007 10.69 6.91623 10.67C7.60866 8.24959 8.30109 5.82715 8.99352 3.40671C9.00585 3.3607 9.04489 3.34269 9.07776 3.31469C9.20515 3.19867 9.34898 3.25868 9.48048 3.25868C10.6147 3.25268 11.7489 3.25468 12.883 3.25468C12.9159 3.25468 12.9467 3.25468 13.0002 3.25468Z" />*/}
{/* <path d="M0 3.25444C0.0472578 3.25444 0.0739687 3.25444 0.10068 3.25444C1.32322 3.25444 2.5437 3.25444 3.76624 3.25244C3.82994 3.25244 3.86281 3.26444 3.88336 3.33046C4.59428 5.72089 5.30725 8.11132 6.01818 10.5018C6.02845 10.5338 6.04694 10.5638 6.03667 10.6078C4.02513 8.15933 2.01976 5.71489 0 3.25444Z" />*/}
{/* <path d="M8.66592 2.93668C7.16189 2.93668 5.67224 2.93668 4.18054 2.93668C4.17438 2.90268 4.20314 2.88867 4.21753 2.86867C4.94899 1.96651 5.68046 1.06434 6.40988 0.160178C6.44275 0.120171 6.45919 0.0821637 6.51261 0.150176C7.21942 1.06634 7.93034 1.98051 8.63921 2.89668C8.64743 2.90668 8.65154 2.91668 8.66592 2.93668Z" />*/}
{/* <path d="M2.70399 0.129883C3.0615 1.07205 3.41491 2.00222 3.77037 2.93639C2.52729 2.93639 1.29448 2.93639 0.0390625 2.93639C0.930796 1.99622 1.81226 1.06805 2.70399 0.129883Z" />*/}
{/* <path d="M12.9687 2.9386C12.7324 2.9386 12.5166 2.9386 12.3009 2.9386C11.3126 2.9386 10.3263 2.9386 9.33803 2.9386C9.28255 2.9386 9.25173 2.9406 9.2805 2.86859C9.63185 1.97642 9.98115 1.08226 10.3304 0.190099C10.3366 0.174096 10.3387 0.154092 10.3633 0.14209C11.2263 1.06826 12.0913 1.99643 12.9687 2.9386Z" />*/}
{/* <path d="M8.97094 2.81832C8.24152 1.87815 7.52238 0.947984 6.79297 0.0078125C7.89223 0.0078125 8.9771 0.0078125 10.0702 0.0078125C9.70651 0.939982 9.34283 1.87015 8.97094 2.81832Z" />*/}
{/* <path d="M3.99333 2.65048C3.66252 1.78032 3.33994 0.930169 3.01735 0.0780142C2.99886 0.0320058 2.97626 0 3.0605 0C4.07962 0.00200036 5.09875 0.00200036 6.13842 0.00200036C5.42133 0.888161 4.71247 1.76432 3.99333 2.65048Z" />*/}
{/* </svg>*/}
{/*</span>*/}
{/* <span>3435 Items</span>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div className="item">*/}
{/* /!* img *!/*/}
{/* <div className="flex justify-center mb-4">*/}
{/* <div className=" w-14 h-14 relative">*/}
{/* <img src={top3} alt="top" className="w-full h-full" />*/}
{/* <div className="absolute right-0 top-0">*/}
{/* <svg*/}
{/* width="18"*/}
{/* height="17"*/}
{/* viewBox="0 0 18 17"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* d="M13.3341 14.7394C12.8954 14.7394 12.4564 14.7416 12.0177 14.7375C11.9347 14.7367 11.8877 14.7647 11.8451 14.835C11.4401 15.4977 11.0288 16.1565 10.6273 16.8213C10.5678 16.9196 10.5247 16.9134 10.444 16.8631C9.84979 16.4937 9.25283 16.1283 8.65967 15.7566C8.58338 15.7089 8.53208 15.708 8.45471 15.755C7.84092 16.1275 7.22251 16.4926 6.60872 16.865C6.51805 16.9202 6.48086 16.9117 6.42548 16.8178C6.03646 16.1562 5.63903 15.4993 5.24757 14.8391C5.20251 14.7628 5.15066 14.7373 5.06297 14.7375C4.23961 14.7408 3.41652 14.7397 2.59315 14.7392C2.38765 14.7392 2.41561 14.7563 2.41561 14.5549C2.4148 13.7182 2.41371 12.8812 2.41724 12.0446C2.41778 11.9479 2.39145 11.892 2.30539 11.8396C1.59985 11.4093 0.899185 10.9712 0.193637 10.5406C0.10921 10.4891 0.0950937 10.4578 0.149387 10.3707C0.541931 9.74279 0.926874 9.11 1.31969 8.48236C1.36855 8.40445 1.36611 8.35423 1.31969 8.27768C0.968138 7.69863 0.624187 7.11497 0.272634 6.5362C0.221055 6.45151 0.238972 6.41974 0.317427 6.37332C0.985783 5.97779 1.65088 5.57656 2.31978 5.18157C2.39905 5.13488 2.41751 5.08167 2.41724 4.99697C2.41452 4.12855 2.41778 3.26012 2.41317 2.39169C2.41262 2.27306 2.43624 2.23152 2.566 2.23261C3.39371 2.23912 4.22142 2.23478 5.0494 2.23777C5.13627 2.23804 5.18459 2.21388 5.23183 2.13651C5.64989 1.44996 6.07501 0.767762 6.49497 0.0823035C6.54574 -0.000494485 6.57994 -0.0284558 6.6793 0.0339821C7.333 0.444986 7.99321 0.845131 8.64799 1.25423C8.73351 1.30771 8.79459 1.30799 8.87874 1.25695C9.44231 0.914355 10.01 0.57882 10.5727 0.23514C10.6764 0.171888 10.7209 0.179218 10.7855 0.289706C11.1428 0.901868 11.512 1.50697 11.8725 2.11723C11.9244 2.20492 11.98 2.23939 12.0853 2.23885C12.9402 2.23369 13.795 2.23804 14.6499 2.23342C14.7604 2.23288 14.7943 2.25948 14.7935 2.37404C14.7886 3.21994 14.7921 4.06557 14.7889 4.91146C14.7886 5.0024 14.8133 5.0548 14.895 5.10475C15.5699 5.51575 16.2391 5.93653 16.9156 6.34509C17.0269 6.41241 17.0179 6.45965 16.9596 6.55276C16.5741 7.16927 16.1956 7.79012 15.8085 8.40554C15.742 8.51114 15.7417 8.58742 15.808 8.69574C16.1799 9.3041 16.5396 9.92006 16.9115 10.5287C16.9756 10.6335 16.959 10.6747 16.8597 10.7331C16.2062 11.1186 15.5574 11.5114 14.9037 11.8964C14.8179 11.9468 14.7881 12.0011 14.7886 12.0991C14.7924 12.9315 14.7889 13.7635 14.7932 14.5958C14.7938 14.7074 14.7645 14.7432 14.6499 14.7416C14.2117 14.7359 13.7728 14.7397 13.3341 14.7394ZM6.15184 8.14086C6.10596 8.18103 6.07881 8.20356 6.05329 8.22745C5.80979 8.45685 5.56655 8.68651 5.32358 8.91644C5.15283 9.07824 5.15093 9.08068 5.3111 9.25143C6.0723 10.062 6.8354 10.871 7.59551 11.6824C7.65577 11.7468 7.69975 11.7546 7.75703 11.6854C7.78282 11.6545 7.81676 11.6306 7.84662 11.6026C8.54565 10.9473 9.24522 10.2922 9.94399 9.63665C10.788 8.84477 11.6304 8.05154 12.4765 7.26184C12.5436 7.1994 12.5257 7.16954 12.4735 7.11497C12.2488 6.87934 12.0234 6.64398 11.8087 6.39965C11.7205 6.29921 11.67 6.30926 11.5777 6.3964C10.3569 7.54661 9.13148 8.69194 7.91014 9.84161C7.83223 9.9149 7.79395 9.91246 7.72201 9.83509C7.22034 9.29568 6.71323 8.76116 6.20857 8.2242C6.18713 8.20194 6.17301 8.17262 6.15184 8.14086Z"*/}
{/* fill="#3897EF"*/}
{/* />*/}
{/* </svg>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* /!* title *!/*/}
{/* <div className="flex justify-center">*/}
{/* <p className="text-base font-bold text-dark-gray dark:text-white">*/}
{/* Brokln Simons*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* username *!/*/}
{/* <div className="flex justify-center mb-1">*/}
{/* <p className="text-xs text-thin-light-gray">*/}
{/* @broklinslam_75*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* items *!/*/}
{/* <div className="flex justify-center">*/}
{/* <div className="flex space-x-1 items-center text-purple text-xs">*/}
{/*<span>*/}
{/* <svg*/}
{/* className="fill-current"*/}
{/* width="13"*/}
{/* height="11"*/}
{/* viewBox="0 0 13 11"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path d="M6.49948 11.0002C6.45633 10.9222 6.44195 10.8402 6.41935 10.7642C5.68171 8.2937 4.94614 5.82125 4.20645 3.35081C4.18385 3.27679 4.19001 3.25879 4.27836 3.25879C5.71459 3.28079 7.15287 3.2968 8.5891 3.3168C8.698 3.3188 8.698 3.3188 8.66923 3.42482C7.9542 5.92527 7.23917 8.42573 6.52414 10.9242C6.51797 10.9462 6.50975 10.9682 6.49948 11.0002Z" />*/}
{/* <path d="M13.0002 3.25468C10.9619 5.75913 8.93804 8.24759 6.91418 10.736C6.88952 10.71 6.91007 10.69 6.91623 10.67C7.60866 8.24959 8.30109 5.82715 8.99352 3.40671C9.00585 3.3607 9.04489 3.34269 9.07776 3.31469C9.20515 3.19867 9.34898 3.25868 9.48048 3.25868C10.6147 3.25268 11.7489 3.25468 12.883 3.25468C12.9159 3.25468 12.9467 3.25468 13.0002 3.25468Z" />*/}
{/* <path d="M0 3.25444C0.0472578 3.25444 0.0739687 3.25444 0.10068 3.25444C1.32322 3.25444 2.5437 3.25444 3.76624 3.25244C3.82994 3.25244 3.86281 3.26444 3.88336 3.33046C4.59428 5.72089 5.30725 8.11132 6.01818 10.5018C6.02845 10.5338 6.04694 10.5638 6.03667 10.6078C4.02513 8.15933 2.01976 5.71489 0 3.25444Z" />*/}
{/* <path d="M8.66592 2.93668C7.16189 2.93668 5.67224 2.93668 4.18054 2.93668C4.17438 2.90268 4.20314 2.88867 4.21753 2.86867C4.94899 1.96651 5.68046 1.06434 6.40988 0.160178C6.44275 0.120171 6.45919 0.0821637 6.51261 0.150176C7.21942 1.06634 7.93034 1.98051 8.63921 2.89668C8.64743 2.90668 8.65154 2.91668 8.66592 2.93668Z" />*/}
{/* <path d="M2.70399 0.129883C3.0615 1.07205 3.41491 2.00222 3.77037 2.93639C2.52729 2.93639 1.29448 2.93639 0.0390625 2.93639C0.930796 1.99622 1.81226 1.06805 2.70399 0.129883Z" />*/}
{/* <path d="M12.9687 2.9386C12.7324 2.9386 12.5166 2.9386 12.3009 2.9386C11.3126 2.9386 10.3263 2.9386 9.33803 2.9386C9.28255 2.9386 9.25173 2.9406 9.2805 2.86859C9.63185 1.97642 9.98115 1.08226 10.3304 0.190099C10.3366 0.174096 10.3387 0.154092 10.3633 0.14209C11.2263 1.06826 12.0913 1.99643 12.9687 2.9386Z" />*/}
{/* <path d="M8.97094 2.81832C8.24152 1.87815 7.52238 0.947984 6.79297 0.0078125C7.89223 0.0078125 8.9771 0.0078125 10.0702 0.0078125C9.70651 0.939982 9.34283 1.87015 8.97094 2.81832Z" />*/}
{/* <path d="M3.99333 2.65048C3.66252 1.78032 3.33994 0.930169 3.01735 0.0780142C2.99886 0.0320058 2.97626 0 3.0605 0C4.07962 0.00200036 5.09875 0.00200036 6.13842 0.00200036C5.42133 0.888161 4.71247 1.76432 3.99333 2.65048Z" />*/}
{/* </svg>*/}
{/*</span>*/}
{/* <span>3435 Items</span>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div className="item">*/}
{/* /!* img *!/*/}
{/* <div className="flex justify-center mb-4">*/}
{/* <div className=" w-14 h-14 relative">*/}
{/* <img src={top4} alt="top" className="w-full h-full" />*/}
{/* <div className="absolute right-0 top-0">*/}
{/* <svg*/}
{/* width="18"*/}
{/* height="17"*/}
{/* viewBox="0 0 18 17"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* d="M13.3341 14.7394C12.8954 14.7394 12.4564 14.7416 12.0177 14.7375C11.9347 14.7367 11.8877 14.7647 11.8451 14.835C11.4401 15.4977 11.0288 16.1565 10.6273 16.8213C10.5678 16.9196 10.5247 16.9134 10.444 16.8631C9.84979 16.4937 9.25283 16.1283 8.65967 15.7566C8.58338 15.7089 8.53208 15.708 8.45471 15.755C7.84092 16.1275 7.22251 16.4926 6.60872 16.865C6.51805 16.9202 6.48086 16.9117 6.42548 16.8178C6.03646 16.1562 5.63903 15.4993 5.24757 14.8391C5.20251 14.7628 5.15066 14.7373 5.06297 14.7375C4.23961 14.7408 3.41652 14.7397 2.59315 14.7392C2.38765 14.7392 2.41561 14.7563 2.41561 14.5549C2.4148 13.7182 2.41371 12.8812 2.41724 12.0446C2.41778 11.9479 2.39145 11.892 2.30539 11.8396C1.59985 11.4093 0.899185 10.9712 0.193637 10.5406C0.10921 10.4891 0.0950937 10.4578 0.149387 10.3707C0.541931 9.74279 0.926874 9.11 1.31969 8.48236C1.36855 8.40445 1.36611 8.35423 1.31969 8.27768C0.968138 7.69863 0.624187 7.11497 0.272634 6.5362C0.221055 6.45151 0.238972 6.41974 0.317427 6.37332C0.985783 5.97779 1.65088 5.57656 2.31978 5.18157C2.39905 5.13488 2.41751 5.08167 2.41724 4.99697C2.41452 4.12855 2.41778 3.26012 2.41317 2.39169C2.41262 2.27306 2.43624 2.23152 2.566 2.23261C3.39371 2.23912 4.22142 2.23478 5.0494 2.23777C5.13627 2.23804 5.18459 2.21388 5.23183 2.13651C5.64989 1.44996 6.07501 0.767762 6.49497 0.0823035C6.54574 -0.000494485 6.57994 -0.0284558 6.6793 0.0339821C7.333 0.444986 7.99321 0.845131 8.64799 1.25423C8.73351 1.30771 8.79459 1.30799 8.87874 1.25695C9.44231 0.914355 10.01 0.57882 10.5727 0.23514C10.6764 0.171888 10.7209 0.179218 10.7855 0.289706C11.1428 0.901868 11.512 1.50697 11.8725 2.11723C11.9244 2.20492 11.98 2.23939 12.0853 2.23885C12.9402 2.23369 13.795 2.23804 14.6499 2.23342C14.7604 2.23288 14.7943 2.25948 14.7935 2.37404C14.7886 3.21994 14.7921 4.06557 14.7889 4.91146C14.7886 5.0024 14.8133 5.0548 14.895 5.10475C15.5699 5.51575 16.2391 5.93653 16.9156 6.34509C17.0269 6.41241 17.0179 6.45965 16.9596 6.55276C16.5741 7.16927 16.1956 7.79012 15.8085 8.40554C15.742 8.51114 15.7417 8.58742 15.808 8.69574C16.1799 9.3041 16.5396 9.92006 16.9115 10.5287C16.9756 10.6335 16.959 10.6747 16.8597 10.7331C16.2062 11.1186 15.5574 11.5114 14.9037 11.8964C14.8179 11.9468 14.7881 12.0011 14.7886 12.0991C14.7924 12.9315 14.7889 13.7635 14.7932 14.5958C14.7938 14.7074 14.7645 14.7432 14.6499 14.7416C14.2117 14.7359 13.7728 14.7397 13.3341 14.7394ZM6.15184 8.14086C6.10596 8.18103 6.07881 8.20356 6.05329 8.22745C5.80979 8.45685 5.56655 8.68651 5.32358 8.91644C5.15283 9.07824 5.15093 9.08068 5.3111 9.25143C6.0723 10.062 6.8354 10.871 7.59551 11.6824C7.65577 11.7468 7.69975 11.7546 7.75703 11.6854C7.78282 11.6545 7.81676 11.6306 7.84662 11.6026C8.54565 10.9473 9.24522 10.2922 9.94399 9.63665C10.788 8.84477 11.6304 8.05154 12.4765 7.26184C12.5436 7.1994 12.5257 7.16954 12.4735 7.11497C12.2488 6.87934 12.0234 6.64398 11.8087 6.39965C11.7205 6.29921 11.67 6.30926 11.5777 6.3964C10.3569 7.54661 9.13148 8.69194 7.91014 9.84161C7.83223 9.9149 7.79395 9.91246 7.72201 9.83509C7.22034 9.29568 6.71323 8.76116 6.20857 8.2242C6.18713 8.20194 6.17301 8.17262 6.15184 8.14086Z"*/}
{/* fill="#3897EF"*/}
{/* />*/}
{/* </svg>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* /!* title *!/*/}
{/* <div className="flex justify-center">*/}
{/* <p className="text-base font-bold text-dark-gray dark:text-white">*/}
{/* Brokln Simons*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* username *!/*/}
{/* <div className="flex justify-center mb-1">*/}
{/* <p className="text-xs text-thin-light-gray">*/}
{/* @broklinslam_75*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* items *!/*/}
{/* <div className="flex justify-center">*/}
{/* <div className="flex space-x-1 items-center text-purple text-xs">*/}
{/*<span>*/}
{/* <svg*/}
{/* className="fill-current"*/}
{/* width="13"*/}
{/* height="11"*/}
{/* viewBox="0 0 13 11"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path d="M6.49948 11.0002C6.45633 10.9222 6.44195 10.8402 6.41935 10.7642C5.68171 8.2937 4.94614 5.82125 4.20645 3.35081C4.18385 3.27679 4.19001 3.25879 4.27836 3.25879C5.71459 3.28079 7.15287 3.2968 8.5891 3.3168C8.698 3.3188 8.698 3.3188 8.66923 3.42482C7.9542 5.92527 7.23917 8.42573 6.52414 10.9242C6.51797 10.9462 6.50975 10.9682 6.49948 11.0002Z" />*/}
{/* <path d="M13.0002 3.25468C10.9619 5.75913 8.93804 8.24759 6.91418 10.736C6.88952 10.71 6.91007 10.69 6.91623 10.67C7.60866 8.24959 8.30109 5.82715 8.99352 3.40671C9.00585 3.3607 9.04489 3.34269 9.07776 3.31469C9.20515 3.19867 9.34898 3.25868 9.48048 3.25868C10.6147 3.25268 11.7489 3.25468 12.883 3.25468C12.9159 3.25468 12.9467 3.25468 13.0002 3.25468Z" />*/}
{/* <path d="M0 3.25444C0.0472578 3.25444 0.0739687 3.25444 0.10068 3.25444C1.32322 3.25444 2.5437 3.25444 3.76624 3.25244C3.82994 3.25244 3.86281 3.26444 3.88336 3.33046C4.59428 5.72089 5.30725 8.11132 6.01818 10.5018C6.02845 10.5338 6.04694 10.5638 6.03667 10.6078C4.02513 8.15933 2.01976 5.71489 0 3.25444Z" />*/}
{/* <path d="M8.66592 2.93668C7.16189 2.93668 5.67224 2.93668 4.18054 2.93668C4.17438 2.90268 4.20314 2.88867 4.21753 2.86867C4.94899 1.96651 5.68046 1.06434 6.40988 0.160178C6.44275 0.120171 6.45919 0.0821637 6.51261 0.150176C7.21942 1.06634 7.93034 1.98051 8.63921 2.89668C8.64743 2.90668 8.65154 2.91668 8.66592 2.93668Z" />*/}
{/* <path d="M2.70399 0.129883C3.0615 1.07205 3.41491 2.00222 3.77037 2.93639C2.52729 2.93639 1.29448 2.93639 0.0390625 2.93639C0.930796 1.99622 1.81226 1.06805 2.70399 0.129883Z" />*/}
{/* <path d="M12.9687 2.9386C12.7324 2.9386 12.5166 2.9386 12.3009 2.9386C11.3126 2.9386 10.3263 2.9386 9.33803 2.9386C9.28255 2.9386 9.25173 2.9406 9.2805 2.86859C9.63185 1.97642 9.98115 1.08226 10.3304 0.190099C10.3366 0.174096 10.3387 0.154092 10.3633 0.14209C11.2263 1.06826 12.0913 1.99643 12.9687 2.9386Z" />*/}
{/* <path d="M8.97094 2.81832C8.24152 1.87815 7.52238 0.947984 6.79297 0.0078125C7.89223 0.0078125 8.9771 0.0078125 10.0702 0.0078125C9.70651 0.939982 9.34283 1.87015 8.97094 2.81832Z" />*/}
{/* <path d="M3.99333 2.65048C3.66252 1.78032 3.33994 0.930169 3.01735 0.0780142C2.99886 0.0320058 2.97626 0 3.0605 0C4.07962 0.00200036 5.09875 0.00200036 6.13842 0.00200036C5.42133 0.888161 4.71247 1.76432 3.99333 2.65048Z" />*/}
{/* </svg>*/}
{/*</span>*/}
{/* <span>3435 Items</span>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div className="item">*/}
{/* /!* img *!/*/}
{/* <div className="flex justify-center mb-4">*/}
{/* <div className=" w-14 h-14 relative">*/}
{/* <img src={top3} alt="top" className="w-full h-full" />*/}
{/* <div className="absolute right-0 top-0">*/}
{/* <svg*/}
{/* width="18"*/}
{/* height="17"*/}
{/* viewBox="0 0 18 17"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* d="M13.3341 14.7394C12.8954 14.7394 12.4564 14.7416 12.0177 14.7375C11.9347 14.7367 11.8877 14.7647 11.8451 14.835C11.4401 15.4977 11.0288 16.1565 10.6273 16.8213C10.5678 16.9196 10.5247 16.9134 10.444 16.8631C9.84979 16.4937 9.25283 16.1283 8.65967 15.7566C8.58338 15.7089 8.53208 15.708 8.45471 15.755C7.84092 16.1275 7.22251 16.4926 6.60872 16.865C6.51805 16.9202 6.48086 16.9117 6.42548 16.8178C6.03646 16.1562 5.63903 15.4993 5.24757 14.8391C5.20251 14.7628 5.15066 14.7373 5.06297 14.7375C4.23961 14.7408 3.41652 14.7397 2.59315 14.7392C2.38765 14.7392 2.41561 14.7563 2.41561 14.5549C2.4148 13.7182 2.41371 12.8812 2.41724 12.0446C2.41778 11.9479 2.39145 11.892 2.30539 11.8396C1.59985 11.4093 0.899185 10.9712 0.193637 10.5406C0.10921 10.4891 0.0950937 10.4578 0.149387 10.3707C0.541931 9.74279 0.926874 9.11 1.31969 8.48236C1.36855 8.40445 1.36611 8.35423 1.31969 8.27768C0.968138 7.69863 0.624187 7.11497 0.272634 6.5362C0.221055 6.45151 0.238972 6.41974 0.317427 6.37332C0.985783 5.97779 1.65088 5.57656 2.31978 5.18157C2.39905 5.13488 2.41751 5.08167 2.41724 4.99697C2.41452 4.12855 2.41778 3.26012 2.41317 2.39169C2.41262 2.27306 2.43624 2.23152 2.566 2.23261C3.39371 2.23912 4.22142 2.23478 5.0494 2.23777C5.13627 2.23804 5.18459 2.21388 5.23183 2.13651C5.64989 1.44996 6.07501 0.767762 6.49497 0.0823035C6.54574 -0.000494485 6.57994 -0.0284558 6.6793 0.0339821C7.333 0.444986 7.99321 0.845131 8.64799 1.25423C8.73351 1.30771 8.79459 1.30799 8.87874 1.25695C9.44231 0.914355 10.01 0.57882 10.5727 0.23514C10.6764 0.171888 10.7209 0.179218 10.7855 0.289706C11.1428 0.901868 11.512 1.50697 11.8725 2.11723C11.9244 2.20492 11.98 2.23939 12.0853 2.23885C12.9402 2.23369 13.795 2.23804 14.6499 2.23342C14.7604 2.23288 14.7943 2.25948 14.7935 2.37404C14.7886 3.21994 14.7921 4.06557 14.7889 4.91146C14.7886 5.0024 14.8133 5.0548 14.895 5.10475C15.5699 5.51575 16.2391 5.93653 16.9156 6.34509C17.0269 6.41241 17.0179 6.45965 16.9596 6.55276C16.5741 7.16927 16.1956 7.79012 15.8085 8.40554C15.742 8.51114 15.7417 8.58742 15.808 8.69574C16.1799 9.3041 16.5396 9.92006 16.9115 10.5287C16.9756 10.6335 16.959 10.6747 16.8597 10.7331C16.2062 11.1186 15.5574 11.5114 14.9037 11.8964C14.8179 11.9468 14.7881 12.0011 14.7886 12.0991C14.7924 12.9315 14.7889 13.7635 14.7932 14.5958C14.7938 14.7074 14.7645 14.7432 14.6499 14.7416C14.2117 14.7359 13.7728 14.7397 13.3341 14.7394ZM6.15184 8.14086C6.10596 8.18103 6.07881 8.20356 6.05329 8.22745C5.80979 8.45685 5.56655 8.68651 5.32358 8.91644C5.15283 9.07824 5.15093 9.08068 5.3111 9.25143C6.0723 10.062 6.8354 10.871 7.59551 11.6824C7.65577 11.7468 7.69975 11.7546 7.75703 11.6854C7.78282 11.6545 7.81676 11.6306 7.84662 11.6026C8.54565 10.9473 9.24522 10.2922 9.94399 9.63665C10.788 8.84477 11.6304 8.05154 12.4765 7.26184C12.5436 7.1994 12.5257 7.16954 12.4735 7.11497C12.2488 6.87934 12.0234 6.64398 11.8087 6.39965C11.7205 6.29921 11.67 6.30926 11.5777 6.3964C10.3569 7.54661 9.13148 8.69194 7.91014 9.84161C7.83223 9.9149 7.79395 9.91246 7.72201 9.83509C7.22034 9.29568 6.71323 8.76116 6.20857 8.2242C6.18713 8.20194 6.17301 8.17262 6.15184 8.14086Z"*/}
{/* fill="#3897EF"*/}
{/* />*/}
{/* </svg>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* /!* title *!/*/}
{/* <div className="flex justify-center">*/}
{/* <p className="text-base font-bold text-dark-gray dark:text-white">*/}
{/* Brokln Simons*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* username *!/*/}
{/* <div className="flex justify-center mb-1">*/}
{/* <p className="text-xs text-thin-light-gray">*/}
{/* @broklinslam_75*/}
{/* </p>*/}
{/* </div>*/}
{/* /!* items *!/*/}
{/* <div className="flex justify-center">*/}
{/* <div className="flex space-x-1 items-center text-purple text-xs">*/}
{/*<span>*/}
{/* <svg*/}
{/* className="fill-current"*/}
{/* width="13"*/}
{/* height="11"*/}
{/* viewBox="0 0 13 11"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path d="M6.49948 11.0002C6.45633 10.9222 6.44195 10.8402 6.41935 10.7642C5.68171 8.2937 4.94614 5.82125 4.20645 3.35081C4.18385 3.27679 4.19001 3.25879 4.27836 3.25879C5.71459 3.28079 7.15287 3.2968 8.5891 3.3168C8.698 3.3188 8.698 3.3188 8.66923 3.42482C7.9542 5.92527 7.23917 8.42573 6.52414 10.9242C6.51797 10.9462 6.50975 10.9682 6.49948 11.0002Z" />*/}
{/* <path d="M13.0002 3.25468C10.9619 5.75913 8.93804 8.24759 6.91418 10.736C6.88952 10.71 6.91007 10.69 6.91623 10.67C7.60866 8.24959 8.30109 5.82715 8.99352 3.40671C9.00585 3.3607 9.04489 3.34269 9.07776 3.31469C9.20515 3.19867 9.34898 3.25868 9.48048 3.25868C10.6147 3.25268 11.7489 3.25468 12.883 3.25468C12.9159 3.25468 12.9467 3.25468 13.0002 3.25468Z" />*/}
{/* <path d="M0 3.25444C0.0472578 3.25444 0.0739687 3.25444 0.10068 3.25444C1.32322 3.25444 2.5437 3.25444 3.76624 3.25244C3.82994 3.25244 3.86281 3.26444 3.88336 3.33046C4.59428 5.72089 5.30725 8.11132 6.01818 10.5018C6.02845 10.5338 6.04694 10.5638 6.03667 10.6078C4.02513 8.15933 2.01976 5.71489 0 3.25444Z" />*/}
{/* <path d="M8.66592 2.93668C7.16189 2.93668 5.67224 2.93668 4.18054 2.93668C4.17438 2.90268 4.20314 2.88867 4.21753 2.86867C4.94899 1.96651 5.68046 1.06434 6.40988 0.160178C6.44275 0.120171 6.45919 0.0821637 6.51261 0.150176C7.21942 1.06634 7.93034 1.98051 8.63921 2.89668C8.64743 2.90668 8.65154 2.91668 8.66592 2.93668Z" />*/}
{/* <path d="M2.70399 0.129883C3.0615 1.07205 3.41491 2.00222 3.77037 2.93639C2.52729 2.93639 1.29448 2.93639 0.0390625 2.93639C0.930796 1.99622 1.81226 1.06805 2.70399 0.129883Z" />*/}
{/* <path d="M12.9687 2.9386C12.7324 2.9386 12.5166 2.9386 12.3009 2.9386C11.3126 2.9386 10.3263 2.9386 9.33803 2.9386C9.28255 2.9386 9.25173 2.9406 9.2805 2.86859C9.63185 1.97642 9.98115 1.08226 10.3304 0.190099C10.3366 0.174096 10.3387 0.154092 10.3633 0.14209C11.2263 1.06826 12.0913 1.99643 12.9687 2.9386Z" />*/}
{/* <path d="M8.97094 2.81832C8.24152 1.87815 7.52238 0.947984 6.79297 0.0078125C7.89223 0.0078125 8.9771 0.0078125 10.0702 0.0078125C9.70651 0.939982 9.34283 1.87015 8.97094 2.81832Z" />*/}
{/* <path d="M3.99333 2.65048C3.66252 1.78032 3.33994 0.930169 3.01735 0.0780142C2.99886 0.0320058 2.97626 0 3.0605 0C4.07962 0.00200036 5.09875 0.00200036 6.13842 0.00200036C5.42133 0.888161 4.71247 1.76432 3.99333 2.65048Z" />*/}
{/* </svg>*/}
{/*</span>*/}
{/* <span>3435 Items</span>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
</SliderCom>
</div>
</div>
</>
);
</div>
</div>
{/* Offer Job Popout */}
{offerPopout.show && (
<OfferJobPopout
details={offerPopout.data}
onClose={() => {
setOfferPopout({ show: false, data: {} });
}}
situation={offerPopout.show}
/>
)}
{/* End of Offer Job Popout */}
</div>
</>
);
}
+99 -47
View File
@@ -1,14 +1,18 @@
import React, {useState} from 'react'
import RecentActivityTable from './WalletComponent/RecentActivityTable'
import LoadingSpinner from '../Spinners/LoadingSpinner'
import { useNavigate } from 'react-router-dom'
import { useNavigate, useLocation } from 'react-router-dom'
import InputCom from '../Helpers/Inputs/InputCom'
import AddFundDollars from './AddFundDollars'
function AddFund({payment}) {
const navigate = useNavigate()
const {currency} = useLocation()?.state //GETS THE USER CURRENCY FOR ADD FUND
//STATE FOR CONTROLLED INPUT
let [input, setInput] = useState('0')
let [input, setInput] = useState('')
let [inputError, setInputError] = useState('')
@@ -22,65 +26,113 @@ function AddFund({payment}) {
setInputError('')
if(!input || input == '0'){
setInputError('Please Enter Amount')
return
return setTimeout(()=>{setInputError('')}, 5000)
}
if(isNaN(input)){
setInputError('Amount must be a Number')
return
return setTimeout(()=>{setInputError('')}, 5000)
}
const stateData = {amount: Number(input)}
const stateData = {amount: Number(input), currency: 'naira'}
navigate('confirm-add-fund', {state: stateData})
setInput('')
}
return (
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className='md:p-8 p-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Add Credit with Account Deposit</h2>
<hr />
<form className='md:p-8 p-4 add-fund-info'>
<div className='md:flex items-center'>
<label className='w-full md:w-2/4 text-slate-600 text-lg'>Amount(Naira) <span className='text-red-500'>*</span></label>
<input className='w-full md:w-2/4 p-3 text-lg text-right bg-slate-100 rounded-md outline-0 placeholder:text-slate-500 placeholder:text-lg'
value={input}
name='amount'
type="text"
placeholder='Amount'
required
onChange={handleChange}
/>
</div>
{inputError && <p className='text-base text-red-500'>{inputError}</p>}
</form>
<hr />
<div className='md:p-8 p-4 add-fund-btn flex justify-end items-center py-4'>
<button onClick={handleSubmit} className='text-lg text-white bg-sky-blue px-4 py-2 hover:opacity-90 rounded-md'>Continue</button>
</div>
</div>
<div className="add-fund py-4 my-2 w-full bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className='md:px-8 px-4 py-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Add Credit with Account Deposit</h2>
<hr />
<p className='md:px-8 px-4 py-2 text-slate-600 dark:text-white text-base lg:text-xl font-medium'>Transfer fund to WrenchBoard GTB Account 0250869867</p>
<p className='md:px-8 px-4 py-2 text-slate-500 dark:text-white text-sm lg:text-base font-medium'>
Make sure you add your account username in the notes part of the transfer for prompt processing. When the transfer is complete notify here <a className='text-sky-blue' href='#'>Contact us</a>
</p>
</div>
</div>
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full max-h-[590px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
<h2 className='text-gray-900 dark:text-white text-xl lg:text-2xl font-medium'>Recent Activity</h2>
{/* <p className='text-base text-gray-600 dark:text-white'>Activity Report</p> */}
{payment.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<RecentActivityTable payment={payment}/>
<div>
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="w-full flex justify-start space-x-3 items-center">
<button
type="button"
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
onClick={() =>
navigate('/my-wallet', { replace: true })
}
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="35"
height="35"
viewBox="0 0 24 24"
fill="skyblue"
>
<path d="M19 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H19v-2z" />
</svg>
</button>
<h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
Add Credit
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
</div>
</div>
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl shadow">
{/*<h2 className='md:p-8 p-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Add Credit with Account Deposit</h2>*/}
{/*<hr />*/}
<form className='md:p-8 p-4 add-fund-info'>
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
label={currency == 'US Dollars' ? "Amount (USD)" : "Amount (Naira)"}
type="text"
name="amount"
placeholder="0"
value={input}
inputHandler={handleChange}
/>
{inputError && <p className='text-base text-red-500'>{inputError}</p>}
</div>
</form>
<hr />
{/* SHOWS THIS IF USER CURRENCY IS DOLLARS */}
{currency == 'US Dollars' &&
<div className='w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow'>
<AddFundDollars setInputError={setInputError} input={input} setInput={setInput} />
</div>
}
{/* HIDES THIS BUTTON IF CURENCY IS NAIRA */}
{currency != 'US Dollars' &&
<div className='md:p-8 p-4 add-fund-btn flex justify-end items-center py-4'>
<button
onClick={handleSubmit}
type="button"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Continue</span>
</button>
</div>
}
</div>
</div>
</div>
{/* HIDES THIS SECTION IF CURENCY IS NAIRA */}
{currency != 'US Dollars' &&
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full min-h-[590px] bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className='text-gray-900 dark:text-white text-xl lg:text-2xl font-medium'>Recent Activity</h2>
{/* <p className='text-base text-gray-600 dark:text-white'>Activity Report</p> */}
{payment.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<RecentActivityTable payment={payment}/>
}
</div>
</div>
</div>
}
</div>
)
}
+480
View File
@@ -0,0 +1,480 @@
import React,{useEffect, useState} from 'react'
import { useNavigate } from 'react-router-dom'
import InputCom from '../Helpers/Inputs/InputCom';
import PaginatedList from '../Pagination/PaginatedList';
import { handlePagingFunc } from '../Pagination/HandlePagination';
import LoadingSpinner from '../Spinners/LoadingSpinner';
import usersService from '../../services/UsersService';
import { Form, Formik } from "formik";
import * as Yup from "yup";
const validationSchema = Yup.object().shape({
name: Yup.string()
.min(3, "Minimum 3 characters")
.max(50, "Maximum 50 characters")
.required("Name is required"),
cardNum: Yup.string()
.min(3, "Minimum 3 characters")
.max(25, "Maximum 25 characters")
.required("Card Number is required"),
code: Yup.string()
.min(3, "Minimum 3 characters")
.max(25, "Maximum 25 characters")
.required("Postal Code is required"),
state: Yup.string()
.min(3, "Minimum 3 characters")
.max(25, "Maximum 25 characters")
.required("State is required"),
address: Yup.string()
.min(3, "Minimum 3 characters")
.max(50, "Maximum 50 characters")
.required("Address is required"),
expirationYear: Yup.string()
.min(4, "Minimum 4 characters")
.max(4, "Maximum 4 characters")
.required("Expiration Year is required"),
expirationMonth: Yup.string()
.min(1, "Minimum 1 characters")
.max(2, "Maximum 2 characters")
.required("Expiration Month is required"),
cvv: Yup.string()
.min(3, "Minimum 3 characters")
.max(4, "Maximum 4 characters")
.required("CVV Year is required"),
});
const initialValues = {
name: '',
cardNum: '',
code: '',
state: '',
address: '',
expirationYear: '',
expirationMonth: '',
cvv: ''
};
function AddFundDollars(props) {
const navigate = useNavigate()
let apiCall = new usersService()
let [tab, setTab] = useState("previous"); //STATE FOR SWITCHING BETWEEN TABS
let [prevCardDetails, setPrevCardDetails] = useState(null) // STATE TO HOLD PREVIOUS CARD SELECTED
let [payListCard, setPayListCard] = useState({loading: true, data:[]}) //USER PREVIOUS CARDS
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentPreviousCards = payListCard?.data?.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e,setCurrentPage)
}
// FUNCTION TO SUBMIT
const handleSubmit = (values, helpers) => {
props.setInputError('')
if(!props.input || props.input == '0'){
props.setInputError('Please Enter Amount')
return setTimeout(()=>{props.setInputError('')}, 5000)
}
if(isNaN(props.input)){
props.setInputError('Amount must be a Number')
return setTimeout(()=>{props.setInputError('')}, 5000)
}
if(tab == 'previous'){
const stateData = {amount: Number(props.input), currency: 'dollars'}
navigate('confirm-add-fund', {state: stateData}) // State will change later dummy for now
}
if(tab == 'new'){
const stateData = {amount: Number(props.input), currency: 'dollars', ...values}
navigate('confirm-add-fund', {state: stateData}) // State will change later dummy for now
}
props.setInput('')
}
useEffect(()=>{
apiCall.payListCard().then(res => {
setPayListCard({loading: false, data: res.data.result_list})
}).catch(err => {
console.log('PAYCARDLIST ERROR', err)
setPayListCard({loading: false, data: []})
})
}, [])
return (
<>
<h1 className='mb-2 text-xl font-bold text-dark-gray dark:text-white'>Payment Method</h1>
<div className="w-full">
{/* switch button */}
<div className="my-1 flex items-center border-b border-slate-300">
<button
name="previous"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "previous" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
Previous Cards
</button>
<button
name="new"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "new" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
Add New Card
</button>
</div>
{/* END OF switch button */}
{/* previous tab */}
{tab == 'previous' ?
<div className="p-4 previous-details w-full border min-h-[300px] flex flex-col justify-between items-center">
{ payListCard.loading ?
<LoadingSpinner size='10' color='sky-blue' />
:
payListCard?.data?.length ?
<table className="my-3 w-full">
<tbody>
{currentPreviousCards.map((item, index)=>(
<tr key={index} className={index != 0 && 'border-t-2'}>
<td>
<div className='my-2 flex items-center gap-5'>
<input type="radio" className='w-8 h-8' name='card' value='value' />
<div className='card-details'>
<h1 className='text-lg font-bold text-dark-gray dark:text-white tracking-wide'>{item.description} Card</h1>
<p className='text-base font-bold text-dark-gray dark:text-white tracking-wide'>Bank **************{item.digits}</p>
<div className='w-full sm:flex items-center gap-5'>
<p className='text-base font-bold text-dark-gray dark:text-white tracking-wide'>{item.added}</p>
<p className='text-sm font-bold text-green-700 dark:text-white tracking-wide'>Verified</p>
</div>
</div>
</div>
</td>
<td>
<button
// onClick={handleSubmit}
type="button"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Manage</span>
</button>
</td>
</tr>
))
}
</tbody>
</table>
:
<div className='w-full flex flex-col items-center'>
<p className='my-5 text-base font-bold text-dark-gray dark:text-white tracking-wide'>No Previous Card Found!</p>
<button
onClick={()=> setTab('new')}
type="button"
className="my-5 px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Add Card</span>
</button>
</div>
}
{/* PAGINATION BUTTON */}
<div className='w-full'>
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= payListCard?.data?.length ? true : false} data={payListCard?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
</div>
{/* END OF PAGINATION BUTTON */}
</div>
:
<div className="new-details w-full min-h-[300px] border-t">
<div className="w-full flex flex-col justify-between">
<Formik
initialValues={initialValues}
validationSchema={validationSchema}
onSubmit={handleSubmit}
>
{(props) => {
return (
<Form>
<div className="flex flex-col-reverse sm:flex-row">
<div className="flex-1 sm:mr-10">
<div className="fields w-full">
{/* inputs starts here */}
{/* Name */}
<div className="field w-full my-6">
<InputCom
fieldClass="px-6"
spanTag='*'
label="Name on Card"
type="text"
name="name"
placeholder="DUMMY NAME"
value={props.values.name}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.name && props.touched.name && (
<p className="text-sm text-red-500">
{props.errors.name}
</p>
)}
</div>
{/* CARD NUMBER */}
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
spanTag='*'
iconName='master-card visa-card atm-card'
label="Card Number"
type="text"
name="cardNum"
placeholder="Enter Card Number"
value={props.values.cardNum}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.cardNum && props.touched.cardNum && (
<p className="text-sm text-red-500">
{props.errors.cardNum}
</p>
)}
</div>
{/* EXPIRE YEAR, YEAR AND CVV */}
<div className="sm:grid gap-5 grid-cols-3 mb-6">
<div className="field w-full mb-6 xl:mb-0 col-span-1">
<div className="select-option">
<div className={`flex items-center justify-between mb-2.5`}>
<label
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
htmlFor='expiration'
>Expiration Month <span className="text-red-700 text-sm tracking-wide">*</span></label>
</div>
<div
className={`input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base`}
>
<select
className={`input-field placeholder:text-base text-dark-gray w-full h-full tracking-wide dark:bg-[#11131F] bg-[#f5f8fa] focus:ring-0 focus:outline-none`}
value={props.values.expirationMonth}
onChange={props.handleChange}
onBlur={props.handleBlur}
name='expirationMonth'
>
<option value=''>Select...</option>
{expireMonth?.length &&
expireMonth.map((item, index) => (
<option key={index} value={item.value}>{item.name}</option>
))
}
</select>
</div>
</div>
{props.errors.expirationMonth && props.touched.expirationMonth && (
<p className="text-sm text-red-500">
{props.errors.expirationMonth}
</p>
)}
</div>
<div className="field w-full mb-6 xl:mb-0 col-span-1">
<div className="select-option">
<div className={`flex items-center justify-between mb-2.5`}>
<label
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
htmlFor='expiration'
>Expiration Year <span className="text-red-700 text-sm tracking-wide">*</span>
</label>
</div>
<div
className={`input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base`}
>
<select
className={`input-field placeholder:text-base text-dark-gray w-full h-full tracking-wide dark:bg-[#11131F] bg-[#f5f8fa] focus:ring-0 focus:outline-none`}
value={props.values.expirationYear}
onChange={props.handleChange}
onBlur={props.handleBlur}
name='expirationYear'
>
<option value=''>Select...</option>
{expireYear?.length &&
expireYear.map((item, index) => (
<option key={index} value={item}>{item}</option>
))
}
</select>
</div>
</div>
{props.errors.expirationYear && props.touched.expirationYear && (
<p className="text-sm text-red-500">
{props.errors.expirationYear}
</p>
)}
</div>
<div className="field w-full col-span-1">
<InputCom
fieldClass="px-6"
spanTag='*'
iconName='atm-card'
label="CVV"
type="text"
name="cvv"
placeholder="CVV"
value={props.values.cvv}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.cvv && props.touched.cvv && (
<p className="text-sm text-red-500">
{props.errors.cvv}
</p>
)}
</div>
</div>
{/* Address */}
<div className="field w-full my-6">
<InputCom
fieldClass="px-6"
spanTag='*'
label="Billing Address"
type="text"
name="address"
placeholder="Billing Address"
value={props.values.Address}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.address && props.touched.address && (
<p className="text-sm text-red-500">
{props.errors.address}
</p>
)}
</div>
{/* postal code and state */}
<div className="sm:grid gap-5 grid-cols-3 mb-6">
<div className="field w-full mb-6 xl:mb-0 col-span-1">
<InputCom
fieldClass="px-6"
spanTag='*'
label="Postal Code"
type="text"
name="code"
placeholder="Postal Code"
value={props.values.code}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.code && props.touched.code && (
<p className="text-sm text-red-500">
{props.errors.code}
</p>
)}
</div>
<div className="field w-full col-span-1">
<InputCom
fieldClass="px-6"
spanTag='*'
label="State"
type="text"
name="state"
placeholder="State"
value={props.values.state}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.state && props.touched.state && (
<p className="text-sm text-red-500">
{props.errors.state}
</p>
)}
</div>
</div>
</div>
</div>
</div>
{/* <div className="w-full">
{requestStatus.message != "" && (
<p
className={`text-center text-base ${
requestStatus.status ? "text-green-800" : "text-red-600"
}`}
>
{requestStatus.message}
</p>
)}
<div className="w-full h-[120px] border-t border-light-purple dark:border-[#5356fb29] flex justify-end items-center">
<div className="flex items-center space-x-4 mr-9">
<Link
to="/"
className="text-18 text-light-red tracking-wide "
>
<span className="border-b dark:border-[#5356fb29] border-light-red">
{" "}
Cancel
</span>
</Link>
{requestStatus.loading ? (
<LoadingSpinner size="8" color="sky-blue" />
) : (
<button
type="submit"
className="w-[152px] h-[46px] flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Update Profile
</button>
)}
</div>
</div>
</div> */}
<div className='md:p-8 p-4 add-fund-btn flex justify-end items-center py-4'>
<button
type="submit"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Continue</span>
</button>
</div>
</Form>
);
}}
</Formik>
</div>
</div>
}
</div>
{ tab == 'previous' &&
<div className='md:p-8 p-4 add-fund-btn flex justify-end items-center py-4'>
<button
onClick={handleSubmit}
type="button"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Continue</span>
</button>
</div>
}
</>
)
}
export default AddFundDollars
// FORMS ARRAY OF EXPIRATION YEAR FOR CARD
const expireYear = []
let currentYear = new Date().getFullYear()
for(let i=0; i<=6; i++){
expireYear.push(currentYear + i)
}
// FORMS ARRAY OF EXPIRATION MONTH FOR CARD
let month = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
const expireMonth = []
for(let i=0; i<month.length; i++){
expireMonth.push({name:month[i], value:i+1})
}
+60 -42
View File
@@ -8,13 +8,24 @@ import LoadingSpinner from '../Spinners/LoadingSpinner'
function Balance({wallet, coupon}) {
return (
<div className="content-wrapper">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
Wallet
</h1>
</div>
<div className="slider-btns flex space-x-4">
</div>
</div>
<div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'>
{/* WALLET SECTION */}
<div className="lg:w-3/4 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white rounded-2xl shadow">
<div className="lg:w-4/4 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white rounded-2xl shadow min-h-[520px]">
<div className='flex items-baseline justify-between'>
<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Wallet</h2>
<p className='text-base text-slate-500 dark:text-white'>Add New Wallet</p>
{/*<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Wallet</h2>*/}
{/*<p className='text-base text-slate-500 dark:text-white'>Add New Wallet</p>*/}
</div>
{/* wallet balance */}
{wallet.loading ?
@@ -22,32 +33,39 @@ function Balance({wallet, coupon}) {
:
wallet.data.length ?
wallet.data.map((item, index)=> (
<div key={index} className="md:flex items-center flex-wrap my-3 border-t-2 border-slate-400">
<div className='text-slate-900 w-full md:w-1/2 flex space-x-3 items-start justify-start'>
<div className='balance-info'>
<p className='py-2'></p>
<span className='text-base'>{item.description}</span>
<p className='text-base text-slate-500'>{item.symbol}</p>
<div key={index} className="p-3 md:flex items-center flex-wrap my-3 border-t-2 border-slate-400 wallet-box">
<div className='text-slate-900 w-full md:w-1/2 flex space-x-3 items-start justify-start'>
<div className='balance-info bal-col1'>
<p className='py-2'></p>
<span className='text-xl text-dark-gray dark:text-white'><b>{item.description}</b></span>
<p className='text-base text-slate-500'>{item.symbol}</p>
</div>
<div className='balance-info'>
<p className='py-2'>Balance</p>
<span className='py-1 px-2 bg-green-100 text-green-500 rounded-lg'>{item.symbol}{(item.amount*0.01).toFixed(2)}</span>
</div>
<div className='balance-info'>
<p className='py-2'>Escrow</p>
<span className='py-1 px-2 bg-red-100 text-red-500 rounded-lg'>{item.symbol}{(item.escrow*0.01).toFixed(2)}</span>
</div>
</div>
<div className='balance-info'>
<p className='py-2'>Balance</p>
<span className='text-sm py-1 px-2 bg-green-100 text-green-500 rounded-lg'>{item.symbol}{(item.amount*0.01).toFixed(2)}</span>
</div>
<div className='balance-info'>
<p className='py-2'>Escrow</p>
<span className='text-sm py-1 px-2 bg-red-100 text-red-500 rounded-lg'>{item.symbol}{(item.escrow*0.01).toFixed(2)}</span>
</div>
</div>
<div className='w-full my-2 md:my-0 md:w-1/2 flex space-x-2 items-center justify-start md:justify-end'>
{
item.action_type != 'AC_AD_FD_ONLY' ?
<Link to='transfer-fund' className='lg:flex hidden user-balance cursor-pointer lg:w-[152px] w-[150px] h-[48px]
items-center rounded-full relative bg-purple pr-1.5 pl-4'>Transfer</Link>:''
}
<Link to='add-fund' className='lg:flex hidden user-balance cursor-pointer lg:w-[152px] w-[150px] h-[48px]
items-center rounded-full relative bg-purple pr-1.5 pl-4'>+Add Credit</Link>
</div>
<div className='w-full my-2 md:my-0 md:w-1/2 flex space-x-2 items-center justify-start md:justify-end'>
{
item.action_type != 'AC_AD_FD_ONLY' ?
<Link to='transfer-fund' className='px-2 py-1 flex items-center gap-2 user-balance cursor-pointer h-[48px] rounded-full relative bg-purple lg:text-xl text-lg font-bold text-white'>Transfer</Link>:''
}
<Link to='add-fund' state={{currency:item.description}} className='px-2 py-1 flex items-center gap-2 user-balance cursor-pointer h-[48px] rounded-full relative bg-green lg:text-xl text-lg font-bold text-white'>
<span className="">
<svg xmlns="http://www.w3.org/2000/svg" width="38"
height="38" viewBox="0 0 42 42" fill="none"><path
d="M21 0C16.8466 0 12.7865 1.23163 9.33303 3.53914C5.8796 5.84665 3.18798 9.1264 1.59854 12.9636C0.00909901 16.8009 -0.406771 21.0233 0.403518 25.0969C1.21381 29.1705 3.21386 32.9123 6.15077 35.8492C9.08767 38.7861 12.8295 40.7862 16.9031 41.5965C20.9767 42.4068 25.1991 41.9909 29.0364 40.4015C32.8736 38.812 36.1534 36.1204 38.4609 32.667C40.7684 29.2135 42 25.1534 42 21C41.994 15.4323 39.7796 10.0944 35.8426 6.15741C31.9056 2.22045 26.5677 0.00602189 21 0ZM28 22.75H22.75V28C22.75 28.4641 22.5656 28.9092 22.2374 29.2374C21.9093 29.5656 21.4641 29.75 21 29.75C20.5359 29.75 20.0908 29.5656 19.7626 29.2374C19.4344 28.9092 19.25 28.4641 19.25 28V22.75H14C13.5359 22.75 13.0908 22.5656 12.7626 22.2374C12.4344 21.9092 12.25 21.4641 12.25 21C12.25 20.5359 12.4344 20.0907 12.7626 19.7626C13.0908 19.4344 13.5359 19.25 14 19.25H19.25V14C19.25 13.5359 19.4344 13.0908 19.7626 12.7626C20.0908 12.4344 20.5359 12.25 21 12.25C21.4641 12.25 21.9093 12.4344 22.2374 12.7626C22.5656 13.0908 22.75 13.5359 22.75 14V19.25H28C28.4641 19.25 28.9093 19.4344 29.2374 19.7626C29.5656 20.0907 29.75 20.5359 29.75 21C29.75 21.4641 29.5656 21.9092 29.2374 22.2374C28.9093 22.5656 28.4641 22.75 28 22.75Z"
fill="white"></path>
</svg>
</span>
<span className='text-white'>Add Credit</span>
</Link>
</div>
</div>
))
:
@@ -73,22 +91,22 @@ function Balance({wallet, coupon}) {
</div>
<div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'>
{/*<div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'>*/}
{/* COUPON SECTION */}
<div className="lg:w-3/4 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full max-h-[500px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Coupons</h2>
{coupon.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<CouponTable coupon={coupon} />
}
</div>
</div>
{/* END OF COUPON SECTION */}
{/* /!* COUPON SECTION *!/*/}
{/* <div className="lg:w-3/4 w-full mb-10 lg:mb-0">*/}
{/* <div className="wallet w-full md:p-8 p-4 h-full max-h-[500px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">*/}
{/* <h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Coupons</h2>*/}
{/* {coupon.loading ?*/}
{/* <LoadingSpinner size='16' color='sky-blue' />*/}
{/* :*/}
{/* <CouponTable coupon={coupon} />*/}
{/* }*/}
{/* </div>*/}
{/* </div>*/}
{/* /!* END OF COUPON SECTION *!/*/}
</div>
{/*</div>*/}
</div>
)
}
+19 -10
View File
@@ -50,7 +50,6 @@ function ConfirmAddFund({ payment }) {
toast.success("Account Topup was sucessful");
setTimeout(() => {
navigate("/my-wallet", { replace: true });
window.location.reload(true);
}, 1000);
})
.catch((err) => {
@@ -102,11 +101,11 @@ function ConfirmAddFund({ payment }) {
}, []);
return (
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="content-wrapper w-full">
{pageLoading ? (
<LoadingSpinner size="8" color="sky-blue" />
) : (
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="w-full mb-10">
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="md:p-8 p-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Confirm Add Fund To Account
@@ -116,7 +115,7 @@ function ConfirmAddFund({ payment }) {
<div className="field w-full mb-3">
<InputCom
fieldClass="px-6"
label="Amount (Naira):"
label={state.currency == 'naira' ? "Amount (Naira):" : "Amount (Dollars):"}
type="text"
name="amount"
value={state.amount || ""}
@@ -127,17 +126,27 @@ function ConfirmAddFund({ payment }) {
<hr />
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4">
<FlutterWaveButton
{...fwConfig}
className="text-lg text-white bg-sky-blue px-4 py-2 hover:opacity-90 rounded-md"
/>
{
state.currency == 'naira' ?
<FlutterWaveButton
{...fwConfig}
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
/>
:
<button
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
onClick={()=>console.log('WORKING')}
>
Continue
</button>
}
</div>
</div>
</div>
)}
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full max-h-[600px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
<div className="w-full mb-10">
<div className="wallet w-full md:p-8 p-4 h-full min-h-[600px] bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="text-gray-900 dark:text-white text-xl lg:text-2xl font-medium">
Recent Activity
</h2>
+1 -45
View File
@@ -20,9 +20,6 @@ function Wallet() {
}
const WalletRoutes = () => {
const apiCall = new usersService()
@@ -38,18 +35,6 @@ const WalletRoutes = () => {
error: false
})
let [purchaseHistory, setPurchaseHistory] = useState({ // FOR PURCHASE HISTORY
loading: true,
data: [],
error: false
})
let [couponHistory, setCouponHistory] = useState({ // FOR COUPON HISTORY
loading: true,
data: [],
error: false
})
//FUNCTION TO GET WALLET LIST
const getWalletList = ()=>{
apiCall.getUserWallets(null).then((res)=>{
@@ -76,38 +61,9 @@ const WalletRoutes = () => {
})
}
//FUNCTION TO GET PURCHASE HISTORY
const getPurchaseHistory = ()=>{
apiCall.getPurchaseHx().then((res)=>{
if(res.data.internal_return < 0){ // success but no data
setPurchaseHistory(prev => ({...prev, loading: false}))
return
}
// console.log('purchase',res.data)
setPurchaseHistory(prev => ({...prev, loading: false, data: res.data.result_list}))
}).catch((error)=>{
setPurchaseHistory(prev => ({...prev, loading: false, error: true}))
})
}
//FUNCTION TO GET COUPON HISTORY
const getCouponHistory = ()=>{
apiCall.getCouponHx().then((res)=>{
if(res.data.internal_return < 0){ // success but no data
setCouponHistory(prev => ({...prev, loading: false}))
return
}
setCouponHistory(prev => ({...prev, loading: false, data: res.data.result_list}))
}).catch((error)=>{
setCouponHistory(prev => ({...prev, loading: false, error: true}))
})
}
useEffect(()=>{
getWalletList()
getPaymentHistory()
getPurchaseHistory()
getCouponHistory()
}, [])
return (
<Routes>
@@ -115,7 +71,7 @@ const WalletRoutes = () => {
<Route path='add-fund' element={<AddFund payment={paymentHistory} />} />
<Route path='add-fund/confirm-add-fund' element={<ConfirmAddFund payment={paymentHistory} />} />
<Route path='transfer-fund' element={<TransferFund payment={paymentHistory} wallet={walletList} />} />
<Route index element={<Balance coupon={couponHistory} wallet={walletList} />} />
<Route index element={<Balance wallet={walletList} />} />
<Route path='transfer-fund/add-recipient' element={<AddRecipient />} />
<Route path='transfer-fund/confirm-transfer' element={<ConfirmTransfer payment={paymentHistory} wallet={walletList} />} />
<Route path='*' element={<Navigate to='/' />} />
@@ -1,66 +1,85 @@
import React, {useState} from 'react'
import React, { useState } from "react";
import PaginatedList from '../../Pagination/PaginatedList'
import { handlePagingFunc } from '../../Pagination/HandlePagination';
import PaginatedList from "../../Pagination/PaginatedList";
import { handlePagingFunc } from "../../Pagination/HandlePagination";
import { PriceFormatter } from "../../Helpers/PriceFormatter";
function CouponTable({coupon}) {
function CouponTable({ coupon }) {
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentCoupon = coupon?.data?.slice(indexOfFirstItem, indexOfLastItem);
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentCoupon = coupon?.data?.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e,setCurrentPage)
}
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
return (
<div className='flex flex-col justify-between h-full'>
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className='border-b-2'>
<tr className='text-slate-600'>
<div className="flex flex-col justify-between h-full">
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className="border-b-2">
<tr className="text-slate-600">
<th className="p-2">Date</th>
<th className="p-2">Description</th>
<th className="p-2">Amount</th>
<th className="p-2">Active</th>
</tr>
</tr>
</thead>
{coupon.data.length ?
(
<tbody>
{currentCoupon.map((item, index) => (
<tr key={index} className='text-slate-500'>
<td className="p-2">{item.added}</td>
<td className="p-2">{item.code}</td>
<td className="p-2">{item.amount}</td>
<td className="p-2">{item.status}</td>
{coupon.data.length ? (
<tbody>
{currentCoupon.map((item, index) => {
let thePrice = PriceFormatter(
item?.price * 0.01,
item?.currency_code,
item?.currency
);
return (
<tr key={index} className="text-slate-500">
<td className="p-2">{item.added}</td>
<td className="p-2">{item.code}</td>
<td className="p-2">{item.amount}</td>
<td className="p-2">{item.status}</td>
</tr>
);
})}
</tbody>
) : coupon.error ? (
<tbody>
<tr className="text-slate-500">
<td className="p-2" colSpan={4}>
Opps! an error occurred. Please try again!
</td>
</tr>
))}
</tbody>
)
:
coupon.error ?
(
<tbody>
<tr className='text-slate-500'>
<td className="p-2" colSpan={4}>Opps! an error occurred. Please try again!</td>
</tbody>
) : (
<tbody>
<tr className="text-slate-500">
<td className="p-2" colSpan={4}>
No Purchase History Found!
</td>
</tr>
</tbody>
)
:
<tbody>
<tr className='text-slate-500'>
<td className="p-2" colSpan={4}>No Purchase History Found!</td>
</tr>
</tbody>
}
</table>
</tbody>
)}
</table>
{/* PAGINATION BUTTON */}
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= coupon?.data?.length ? true : false} data={coupon?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
{/* END OF PAGINATION BUTTON */}
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
coupon?.data?.length
? true
: false
}
data={coupon?.data}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
)
);
}
export default CouponTable
export default CouponTable;
@@ -15,11 +15,11 @@ function PurchasesTable({purchase}) {
}
return (
<div className='flex flex-col justify-between h-full'>
<div className='flex flex-col justify-between min-h-[500px]'>
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className='border-b-2'>
<tr className='text-slate-600'>
<th className="p-4">Trx.</th>
<th className="p-2">Trx.</th>
<th className="p-2">Amount</th>
<th className="p-2">Fee</th>
</tr>
@@ -29,7 +29,7 @@ function PurchasesTable({purchase}) {
<tbody>
{currentPurchase.map((item, index) => (
<tr key={index} className='text-slate-500'>
<td className="p-4">{item.added_date}<br />
<td className="p-2">{item.added_date}<br />
<b>{item.confirmation} </b>
</td>
<td className="p-2">{item.amount}</td>
@@ -15,7 +15,7 @@ function RecentActivityTable({payment}) {
}
return (
<div className='flex flex-col justify-between h-full'>
<div className='flex flex-col justify-between min-h-[500px]'>
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className='border-b-2'>
<tr className='text-slate-600'>
@@ -1,60 +1,73 @@
import React, {useState} from 'react'
import { useState } from "react";
import PaginatedList from "../../Pagination/PaginatedList";
import { handlePagingFunc } from "../../Pagination/HandlePagination";
import PaginatedList from '../../Pagination/PaginatedList';
import {handlePagingFunc} from '../../Pagination/HandlePagination';
function ReferralTable({ history }) {
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentReferral = history?.data?.slice(
indexOfFirstItem,
indexOfLastItem
);
function ReferralTable({history}) {
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentReferral = history?.data?.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e,setCurrentPage)
}
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
return (
<div className='flex flex-col justify-between h-full'>
<table className="referral-list w-full table-auto border-collapse text-left">
<thead className='border-b-2'>
<tr className='text-slate-600'>
<th className="p-3">Added/Name</th>
<th className="p-3">Email</th>
<th className="p-3">Status</th>
</tr>
</thead>
<tbody>
{history.data.length ?
currentReferral.map((item, index) => (
<tr key={index} className='text-slate-500'>
<td className="p-3">{item.added_date} / {item.firstname} {item.lastname}</td>
<td className="p-3">{item.email}</td>
<td className="p-3">{item.status}</td>
</tr>
))
:
(
history.error ?
<tr className='text-slate-500'>
<td colSpan={3}>Opps! couldn't get referral history. Try reloading the page</td>
</tr>
:
(
<tr className='text-slate-500'>
<td colSpan={3}>No Item Found on referral List</td>
</tr>
)
)
}
</tbody>
</table>
<div className="flex flex-col justify-between min-h-[420px] overflow-x-auto">
<table className="referral-list w-full table-auto border-collapse text-left">
<thead className="border-b-2">
<tr className="text-slate-600">
<th className="p-3">Added/Name</th>
<th className="p-3">Email</th>
<th className="p-3">Status</th>
</tr>
</thead>
<tbody>
{history.data.length ? (
currentReferral.map((item, index) => (
<tr key={index} className="text-slate-500">
<td className="p-3">
{item.added_date} / {item.firstname} {item.lastname}
</td>
<td className="p-3">{item.email}</td>
<td className="p-3">{item.status}</td>
</tr>
))
) : history.error ? (
<tr className="text-slate-500">
<td colSpan={3}>
Opps! couldn't get referral history. Try reloading the page
</td>
</tr>
) : (
<tr className="text-slate-500">
<td colSpan={3}>No Item Found on referral List</td>
</tr>
)}
</tbody>
</table>
{/* PAGINATION BUTTON */}
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= history?.data?.length ? true : false} data={history?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
{/* END OF PAGINATION BUTTON */}
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
history?.data?.length
? true
: false
}
data={history?.data}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
)
);
}
export default ReferralTable
export default ReferralTable;
@@ -0,0 +1,302 @@
import React, { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import Layout from "../Partials/Layout";
import CommonHead from "../UserHeader/CommonHead";
import usersService from "../../services/UsersService";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import OthersInterestedTable from "./OthersInterestedTable";
export default function ManageInterestOffer(props) {
const navigate = useNavigate()
const apiCall = new usersService()
let [redirectTime, setRedirectTime] = useState(5)
let [tab, setTab] = useState("info"); //message STATE FOR SWITCHING BETWEEN TABS
let [requestStatus, setRequestStatus] = useState({loading: false, status: false, message: '', processType: ''})
const messageList = {data: [1,2,3,4,5,6]} // TO BE REMOVED AND REPLACE WITH REAL MESSAGE FROM API CALL
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem = Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentMessageList = messageList?.data?.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
};
//FUNCTION TO ACCEPT/REJECT OFFER INTEREST
const interestOfferProcess = ({target:{name}}) => {
setRequestStatus(prev => ({...prev, loading: true, processType: name}))
let reqData = { // API PAYLOADS
proc: name.toUpperCase(),
client_uid : props.offerDetails?.client_uid,
offer_code : props.offerDetails?.offer_code,
offer_uid: props.offerDetails?.offer_uid,
}
apiCall.offersInterestProc(reqData).then(res => {
if(res.status != 200 || res.data.internal_return < 0){
setRequestStatus({loading: false, status: false, message: 'Unable to complete request', processType: ''})
return
}
let intervalTime = setInterval(() => { // SETS REDIRECT COUNT DOWN
setRedirectTime(prev => prev - 1)
}, 1000);
setRequestStatus({loading: false, status: true, message: `Offer ${name}ed`, processType: ''})
setTimeout(()=>{
navigate('/offer-interest', {replace: true})
clearInterval(intervalTime)
},5000)
}).catch(err => {
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong. Try again', processType: ''})
}).finally(()=>{
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: '', processType: ''})
},5000)
})
}
useEffect(()=>{
// run API to get message to replace message array above, add reload variable as dependence array
},[])
return (
<Layout>
<CommonHead
commonHeadData={props.commonHeadData}
/>
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full mb-4">
{/* heading */}
<div className="sm:flex justify-between items-center mb-3">
<div className="mb-3 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span className={`${selectTab === "today" ? "block" : "hidden"}`}>Manage Offer Interest</span>
</h1>
</div>
</div>
{/* manage offer section */}
<div className="w-full p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow">
<div className="my-2 w-full sm:grid gap-5 grid-cols-4">
{/* Detail section */}
<div className="w-full mb-5 lg:mb-0 col-span-3">
<div className="w-full flex justify-start space-x-3 items-center">
<button
type="button"
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
onClick={() =>
navigate('/offer-interest', { replace: true })
}
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="35"
height="35"
viewBox="0 0 24 24"
fill="skyblue"
>
<path d="M19 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H19v-2z" />
</svg>
</button>
<h1 className="text-sm lg:text-xl font-bold text-sky-blue dark:text-white tracking-wide">
{props.offerDetails?.offer_code && props.offerDetails.offer_code}
</h1>
</div>
<h1 className="my-3 text-xl lg:text-2xl font-bold text-dark-gray dark:text-white tracking-wide border">
{props.offerDetails?.title}
</h1>
<div className="w-full">
{/* switch button */}
<div className="my-1 flex items-center border-b border-slate-300">
<button
name="info"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "info" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
Info
</button>
<button
name="message"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "message" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
Messages ({messageList.data.length})
</button>
</div>
{/* END OF switch button */}
{/* info tab */}
{tab == 'info' ?
<div className="info-details w-full border-t">
<div className="my-3 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Name</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_name}</span>
</div>
<div className="my-3 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Member Since</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_added}</span>
</div>
<div className="my-3 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs completed</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_jobs_completed ? props.offerDetails?.client_jobs_completed :0}</span>
</div>
<div className="my-0 md:my-3 block md:flex items-center gap-10">
<div className="my-3 md:my-0 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs active</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_jobs_active ? props.offerDetails?.client_jobs_active:0}</span>
</div>
<div className="my-3 md:my-0 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs uncompleted</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_jobs_missed ? props.offerDetails?.client_jobs_missed:0}</span>
</div>
</div>
<div className="block md:flex items-center gap-10">
<div className="my-3 md:my-0 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">% completion</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_percent_completion ? props.offerDetails?.client_percent_completion:0}</span>
</div>
<div className="flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Pending Offers</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_offers_pending ? props.offerDetails?.client_offers_pending:0}</span>
</div>
</div>
</div>
:
<div className="message-details w-full border-t">
<div className="my-0 w-full flex items-center gap-5">
<div className="w-3/4">
<p className="text-base font-bold text-dark-gray dark:text-white tracking-wide">Message to dummy name</p>
<textarea rows={2} autoFocus={true} className="p-2 text-base font-bold text-dark-gray dark:text-white dark:bg-dark-gray border tracking-wide w-full resize-none rounded-md outline-none" />
</div>
<div className="w-1/4 flex flex-col justify-center items-center">
<button
type="button"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Send</span>
</button>
</div>
</div>
{/* message list */}
<div className="min-h-[100px] max-h-[200px] overflow-y-auto">
{currentMessageList.map((item, index)=>(
<div key={index} className="my-2 w-full flex items-center gap-1">
<p className="text-base font-bold text-dark-gray dark:text-white tracking-wide">2023-04-06-from { }<span className="font-normal">Dummy name</span></p>
<p className="text-base font-bold text-dark-gray dark:text-white tracking-wide">I am testing message</p>
</div>
))}
</div>
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
messageList?.data?.length
? true
: false
}
data={messageList?.data}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
}
</div>
</div>
{/* END OF Detail section */}
{/* BUTTON section */}
<div className="p-4 w-full min-h-full bg-sky-100 dark:bg-dark-gray col-span-1">
<div className="w-full h-full">
<div className="mt-0 sm:mt-10 flex sm:flex-col justify-center items-center gap-10">
{requestStatus.loading && requestStatus.processType == 'accept' ?
<LoadingSpinner color='sky-blue' size='10' />
:
<button
type="button"
name='accept'
disabled={requestStatus.loading}
onClick={interestOfferProcess}
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Accept
</button>
}
{requestStatus.loading && requestStatus.processType == 'reject' ?
<LoadingSpinner color='sky-blue' size='10' />
:
<button
type="button"
name='reject'
disabled={requestStatus.loading}
onClick={interestOfferProcess}
className="px-2 py-1 h-11 flex justify-center items-center border-gradient text-base rounded-full text-black"
>
Reject
</button>
}
</div>
{/* ERROR DISPLAY */}
<div className="w-full">
{/* error or success display */}
{requestStatus.message != "" && requestStatus.processType != 'sendmeassge' &&
(!requestStatus.status ? (
<div
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{requestStatus.message}
</div>
) : (
requestStatus.status && (
<div
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{`${requestStatus.message} redirecting.... ${redirectTime}sec`}
</div>
)
))}
</div>
{/* End of error or success display */}
</div>
</div>
{/* END of BUTTON section */}
</div>
</div>
{/* END OF manage offer section */}
</div>
<div className="w-full overflow-x-auto">
{/* heading */}
<div className="sm:flex justify-between items-center mb-3">
<div className="mb-3 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span className={`${selectTab === "today" ? "block" : "hidden"}`}>Others interested in this Task</span>
</h1>
</div>
</div>
<OthersInterestedTable othersInterestedList={props.othersInterestedList} />
</div>
</div>
</Layout>
);
}
@@ -0,0 +1,169 @@
import React, { useState } from "react";
import dataImage1 from "../../assets/images/data-table-user-1.png";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import { useNavigate, useLocation, Link } from "react-router-dom";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import familyImage from '../../assets/images/no-family-side.png'
export default function OffersInterestTable({offerInterestList, className}) {
const navigate = useNavigate();
let { pathname } = useLocation();
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentOfferInterestList = offerInterestList?.data?.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
return (
<div
className={`update-table w-full my-8 p-8 bg-white dark:bg-dark-white rounded-2xl section-shadow min-h-[520px] ${
className || ""
}`}
>
{offerInterestList?.loading ? (
<div className="min-h-[520px] w-full flex flex-col justify-center items-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
)
:
offerInterestList?.data?.length > 0 ?
(
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
<thead className="sticky top-0">
{/* <tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-bottom ">
<th className="py-4">Name</th>
<th className="py-4 text-center">Last Login</th>
<th className="py-4 text-center">No of Tasks</th>
<th className="py-4 text-right"></th>
</tr> */}
</thead>
<tbody className="h-full">
{currentOfferInterestList?.map((item, index) => {
return (
<tr key={index} className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
<td className=" py-4">
<div className="flex space-x-2 items-center">
<div className="min-w-[60px] min-h-[60px] rounded-full overflow-hidden flex justify-center items-center">
<img
src={dataImage1}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{item?.title}
</h1>
<span className="text-sm text-thin-light-gray">{item?.expire}</span>
</div>
</div>
</td>
<td className="text-center py-4 px-2">
<div className="flex space-x-1 items-center justify-center">
<p className="font-bold text-x text-dark-gray dark:text-white">{item?.client_name}</p>
</div>
</td>
<td className="text-center py-4 px-2">
<div className="flex space-x-1 items-center justify-center">
{/* <span className="font-bold text-x text-dark-gray dark:text-white">{formatNumber(item?.price * 0.01)}</span> */}
<span className="font-bold text-x text-dark-gray dark:text-white">{PriceFormatter(item?.price * 0.01,item?.currency_code,item?.currency)}</span>
</div>
</td>
<td className="text-right py-4">
<button
onClick={() => {
navigate("/manage-offer", {
state: { ...item, pathname },
});
}}
type="button"
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</td>
</tr>
);
})
}
</tbody>
</table>
)
:
(
<div className="font-bold text-center text-xl md:text-2xl lg:text-4xl text-dark-gray md:flex items-center justify-between">
<div className="p-2 w-full md:w-1/2">
<p className="mb-4 p-3 md:p-16">No Offer list avaliable.</p>
<button
onClick={()=>{navigate('/market', {replace: true})}}
type="button"
className="text-white btn-gradient text-lg tracking-wide px-5 py-2 rounded-full"
>
Goto Market
</button>
</div>
<div className="p-2 w-full md:w-1/2">
<img className='w-full' src={familyImage && familyImage} alt="Add Family" />
</div>
</div>
)
}
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
offerInterestList?.data?.length
? true
: false
}
data={offerInterestList?.data}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
);
}
// Function to format number to two(2) decimal places
// function formatNumber(number) {
// // Convert the number to a string
// let numStr = String(number);
// // Split the string into integer and decimal parts
// let parts = numStr.split('.');
// let integerPart = parts[0];
// let decimalPart = parts[1] || '';
// // Add thousands separators to the integer part
// let formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
// // Truncate or pad the decimal part to two decimal points
// let formattedDecimal = decimalPart.slice(0, 2).padEnd(2, '0');
// // Combine the formatted integer and decimal parts
// let formattedNumber = formattedInteger + '.' + formattedDecimal;
// return formattedNumber;
// }
@@ -0,0 +1,148 @@
import React, { useState } from "react";
import dataImage1 from "../../assets/images/data-table-user-1.png";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import { useNavigate, useLocation, Link } from "react-router-dom";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
import { useDispatch } from "react-redux";
import { tableReload } from "../../store/TableReloads";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import familyImage from '../../assets/images/no-family-side.png'
export default function OthersInterestTable({othersInterestedList, className}) {
const dispatch = useDispatch()
const navigate = useNavigate();
let { pathname } = useLocation();
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentOthersInterestedList = othersInterestedList?.data?.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
return (
<div
className={`update-table w-full p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow min-h-[520px] ${
className || ""
}`}
>
{othersInterestedList?.loading ? (
<div className="min-h-[520px] w-full flex flex-col justify-center items-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
)
:
othersInterestedList?.data?.length > 0 ?
(
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
<thead className="sticky top-0">
{/* <tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-bottom ">
<th className="py-4">Name</th>
<th className="py-4 text-center">Last Login</th>
<th className="py-4 text-center">No of Tasks</th>
<th className="py-4 text-right"></th>
</tr> */}
</thead>
<tbody className="h-full">
{currentOthersInterestedList?.map((item, index) => {
return (
<tr key={index} className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
<td className=" py-4">
<div className="flex space-x-2 items-center">
<div className="min-w-[60px] min-h-[60px] rounded-full overflow-hidden flex justify-center items-center">
<img
src={dataImage1}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{item?.title}
</h1>
<span className="text-sm text-thin-light-gray">{item?.expire}</span>
</div>
</div>
</td>
<td className="text-center py-4 px-2">
<div className="flex space-x-1 items-center justify-center">
<p className="font-bold text-x text-dark-gray dark:text-white">{item?.client_name}</p>
</div>
</td>
<td className="text-center py-4 px-2">
<div className="flex space-x-1 items-center justify-center">
{/* <span className="font-bold text-x text-dark-gray dark:text-white">{formatNumber(item?.price * 0.01)}</span> */}
<span className="font-bold text-x text-dark-gray dark:text-white">{PriceFormatter(item?.price * 0.01,item?.currency_code,item?.currency)}</span>
</div>
</td>
<td className="text-right py-4">
<button
onClick={() => {
dispatch(tableReload({type:'OTHERSINTERESTEDTABLE'}))
navigate("/manage-offer", {
state: { ...item, pathname },
});
}}
type="button"
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</td>
</tr>
);
})
}
</tbody>
</table>
)
:
(
<div className="font-bold text-center text-xl md:text-2xl lg:text-4xl text-dark-gray md:flex items-center justify-between">
<div className="p-2 w-full md:w-1/2">
<p className="mb-4 p-3 md:p-16">No Offer list avaliable.</p>
<button
onClick={()=>{navigate('/market', {replace: true})}}
type="button"
className="text-white btn-gradient text-lg tracking-wide px-5 py-2 rounded-full"
>
Goto Market
</button>
</div>
<div className="p-2 w-full md:w-1/2">
<img className='w-full' src={familyImage && familyImage} alt="Add Family" />
</div>
</div>
)
}
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
othersInterestedList?.data?.length
? true
: false
}
data={othersInterestedList?.data}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
);
}
+32
View File
@@ -0,0 +1,32 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import Layout from "../Partials/Layout";
import CommonHead from "../UserHeader/CommonHead";
import OffersInterestTable from './OffersInterestTable'
export default function OffersInterest(props) {
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
};
return (
<Layout>
<CommonHead
commonHeadData={props.commonHeadData}
/>
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span className={`${selectTab === "today" ? "block" : "hidden"}`}>Offer Interest</span>
</h1>
</div>
</div>
</div>
</div>
<OffersInterestTable offerInterestList={props.offerInterestList} />
</Layout>
);
}
+49 -43
View File
@@ -1,54 +1,60 @@
import React from 'react';
import { createRoutesFromChildren } from 'react-router-dom';
const PaginatedList = ({ onClick, prev, next, data, start, stop }) => {
if(data.length > process.env.REACT_APP_ITEM_PER_PAGE){
if (data.length > process.env.REACT_APP_ITEM_PER_PAGE) {
return (
<div className='p-3 flex justify-center items-center space-x-2 border-t-2'>
<div className="p-3 flex justify-center items-center min-h-[70px] space-x-2 border-t-2">
{/* Render pagination buttons */}
{!prev &&
<button
className={`p-2 ${prev ? 'border' : null}`}
name='prev'
onClick={onClick}
>
<>&lt;</>
</button>
}
{!prev && (
<button
className={`p-2 border ${
prev ? "border-black dark:border-white dark:text-white" : "border-transparent dark:text-white"
} btn-shine rounded-full h-11 w-11`}
name="prev"
onClick={onClick}
>
<>&lt;</>
</button>
)}
{
data.map((item, index)=>{
if(index%process.env.REACT_APP_ITEM_PER_PAGE == 0 && index >= start && index <= stop){
return (
<button
key={index}
value={index}
className={`p-2 ${index==start ? 'border' : null}`}
onClick={onClick}
name='page_num'
disabled={index == start}
>
{index <= 0 ? index+1 : (index/process.env.REACT_APP_ITEM_PER_PAGE)+1}
</button>
)
}
})
}
{!next &&
{data.map((item, index) => {
if (
index % process.env.REACT_APP_ITEM_PER_PAGE == 0 &&
index >= start &&
index <= stop
) {
return (
<button
className={`p-2 ${next ? 'border' : null}`}
name='next'
key={index}
value={index}
className={`p-2 border ${
index === start ? "border-black dark:border-white dark:text-white" : "border-transparent dark:text-white"
} btn-shine rounded-full h-11 w-11`}
onClick={onClick}
name="page_num"
disabled={index === start}
>
<>&gt;</>
{index <= 0
? index + 1
: index / process.env.REACT_APP_ITEM_PER_PAGE + 1}
</button>
}
</div>
)
}else{
return null
);
}
})}
{!next && (
<button
className={`p-2 border ${
next ? "border-black dark:border-white dark:text-white" : "border-transparent dark:text-white"
} btn-shine rounded-full h-11 w-11`}
name="next"
onClick={onClick}
>
<>&gt;</>
</button>
)}
</div>
);
} else {
return null;
}
};
+2 -2
View File
@@ -100,7 +100,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
// User Profile
let { firstname, lastname, email, profile_pic } = userDetails;
let userEmail = email.split("@")[0];
let userEmail = email?.split("@")[0];
return (
<>
@@ -827,7 +827,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
type="button"
className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Cannected
Connected
</button>
</div>
</div>
+24 -23
View File
@@ -76,7 +76,7 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJ
{/* menu and settings item */}
<div className="menu-setting-items mb-11">
{/* menus item */}
<div className="menu-item transition-all duration-300 ease-in-out mb-14">
<div className="menu-item transition-all duration-300 ease-in-out mb-5">
<div className="heading mb-5 active">
<h1 className="title text-xl font-bold text-purple">Menu</h1>
</div>
@@ -110,20 +110,17 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJ
{/* menu and settings item */}
{userDetails?.account_type !== "FAMILY" && (
<div className="menu-setting-items mb-11">
{/* menus item */}
<div
className={`menu-item transition-all duration-300 ease-in-out ${
sidebar ? "mb-14" : ""
sidebar ? "mb-5" : "mb-2"
}`}
>
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
Family
</h1>
</div>
<div className="items">
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
Family
</h1>
</div>
<ul className="flex flex-col space-y-6">
<ListItem
title="Family Corner"
@@ -134,25 +131,22 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJ
</ul>
</div>
</div>
</div>
)}
{userDetails?.account_type !== "FAMILY" && (
<>
{!userDetails?.post_jobs ? (
<div className="menu-setting-items mb-11">
{/* menus item */}
<div
className={`menu-item transition-all duration-300 ease-in-out bg-pink dark:bg-dark-white rounded-2xl p-3 ${
sidebar ? "mb-14" : "rounded-none p-0"
sidebar ? "mb-5" : "mb-2 rounded-none p-0"
}`}
>
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
Job Post
</h1>
</div>
<div className="items">
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
Job Post
</h1>
</div>
<ul className="flex flex-col space-y-6">
<li className="item group">
<NavLink
@@ -179,9 +173,12 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJ
</ul>
</div>
</div>
</div>
) : myJobList?.data?.result_list?.length ? (
<div className="setting-item">
<div
className={`menu-item transition-all duration-300 ease-in-out ${
sidebar ? "mb-5" : "mb-2"
}`}
>
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
My Jobs
@@ -213,8 +210,12 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJ
</ul>
</div>
</div>
) : !myJobList?.loading && (
<div className="setting-item">
) : (
<div
className={`menu-item transition-all duration-300 ease-in-out ${
sidebar ? "mb-5" : "mb-2"
}`}
>
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
My Jobs
+85 -85
View File
@@ -95,7 +95,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler, myJobList
{/* menus item */}
<div
className={`menu-item transition-all duration-300 ease-in-out ${
sidebar ? "mb-14" : ""
sidebar ? "mb-5" : "mb-2"
}`}
>
<div className="heading mb-5">
@@ -131,19 +131,17 @@ export default function Sidebar({ sidebar, action, logoutModalHandler, myJobList
{/* menu and settings item */}
{userDetails?.account_type !== "FAMILY" && (
<div className="menu-setting-items mb-11">
{/* menus item */}
<div
className={`menu-item transition-all duration-300 ease-in-out ${
sidebar ? "mb-14" : ""
sidebar ? "my-5" : ""
}`}
>
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
Family
</h1>
</div>
<div className="items">
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
Family
</h1>
</div>
<ul className="flex flex-col space-y-6">
<ListItem
title="Family Corner"
@@ -154,92 +152,94 @@ export default function Sidebar({ sidebar, action, logoutModalHandler, myJobList
</ul>
</div>
</div>
</div>
)}
{userDetails?.account_type !== "FAMILY" && (
<>
{!userDetails?.post_jobs ? (
<div className="menu-setting-items mb-11">
{/* menus item */}
<div
className={`menu-item transition-all duration-300 ease-in-out bg-pink dark:bg-dark-white rounded-2xl p-3 ${
sidebar ? "mb-14" : "rounded-none p-0"
}`}
>
<div className="items">
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
Job Post
</h1>
</div>
<ul className="flex flex-col space-y-6">
<li className="item group">
<NavLink
to="/start-job"
className={`nav-item flex items-center ${
((navData) => (navData.isActive ? "active" : ""),
sidebar
? "justify-start space-x-3.5"
: "justify-center")
<div
className={`menu-item transition-all duration-300 ease-in-out bg-pink dark:bg-dark-white rounded-2xl p-3 ${
sidebar ? "mb-5" : "mb-2 rounded-none p-0"
}`}
>
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
Job Post
</h1>
</div>
<div className="items">
<ul className="flex flex-col space-y-6">
<li className="item group">
<NavLink
to="/start-job"
className={`nav-item flex items-center ${
((navData) => (navData.isActive ? "active" : ""),
sidebar
? "justify-start space-x-3.5"
: "justify-center")
}`}
>
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white dark:text-lighter-gray">
<Icons name="people-two" />
</span>
<span
className={`item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium ${
sidebar ? "active flex-1" : "w-0"
}`}
>
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white dark:text-lighter-gray">
<Icons name="people-two" />
</span>
<span
className={`item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium ${
sidebar ? "active flex-1" : "w-0"
}`}
>
Enable Job Post
</span>
</NavLink>
</li>
</ul>
</div>
Enable Job Post
</span>
</NavLink>
</li>
</ul>
</div>
</div>
) : myJobList?.data?.result_list?.length ? (
<>
<div className="setting-item">
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
My Jobs
</h1>
</div>
<div className="items">
<ul className="flex flex-col space-y-6">
{[
{
name: "List",
path: "/myjobs",
iconName: "people-two",
},
{
name: "Pending",
path: "/my-pending-jobs",
iconName: "people-two",
},
{
name: "Active",
path: "/my-active-jobs",
iconName: "people-two",
},
].map(({ name, path, iconName }, idx) => (
<ListItem
key={idx}
title={name}
route={path}
sidebar={sidebar}
iconName={iconName}
/>
))}
</ul>
</div>
<div
className={`menu-item transition-all duration-300 ease-in-out ${
sidebar ? "mb-5" : "mb-2"
}`}
>
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
My Jobs
</h1>
</div>
</>
) : !myJobList?.loading && (
<div className="setting-item">
<div className="items">
<ul className="flex flex-col space-y-6">
{[
{
name: "List",
path: "/myjobs",
iconName: "people-two",
},
{
name: "Pending",
path: "/my-pending-jobs",
iconName: "people-two",
},
{
name: "Active",
path: "/my-active-jobs",
iconName: "people-two",
},
].map(({ name, path, iconName }, idx) => (
<ListItem
key={idx}
title={name}
route={path}
sidebar={sidebar}
iconName={iconName}
/>
))}
</ul>
</div>
</div>
) : (
<div
className={`menu-item transition-all duration-300 ease-in-out ${
sidebar ? "mb-5" : "mb-2"
}`}
>
<div className="heading mb-5">
<h1 className="title text-xl font-bold text-purple">
My Jobs
+6 -6
View File
@@ -1,13 +1,13 @@
import React from 'react'
import Layout from '../Partials/Layout'
import ReferralDisplay from './ReferralDisplay'
import React from "react";
import Layout from "../Partials/Layout";
import ReferralDisplay from "./ReferralDisplay";
function Referral() {
return (
<Layout>
<ReferralDisplay />
<ReferralDisplay />
</Layout>
)
);
}
export default Referral
export default Referral;
+68 -67
View File
@@ -1,5 +1,4 @@
import React, { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import { toast } from "react-toastify";
import usersService from "../../services/UsersService";
import InputCom from "../Helpers/Inputs/InputCom";
@@ -10,30 +9,29 @@ import * as Yup from "yup";
import ReferralTable from "../MyWallet/WalletComponent/ReferralTable";
const validationSchema = Yup.object().shape({
email: Yup.string()
ref_email: Yup.string()
.email("Wrong email format")
.min(3, "Minimum 3 characters")
.max(50, "Maximum 50 characters")
.required("Email is required"),
firstname: Yup.string()
ref_firstname: Yup.string()
.min(3, "Minimum 3 characters")
.max(25, "Maximum 25 characters")
.required("Firstname is required"),
lastname: Yup.string()
ref_lastname: Yup.string()
.min(3, "Minimum 3 characters")
.max(25, "Maximum 25 characters")
.required("Lastname is required"),
});
const initialValues = {
firstname: "",
lastname: "",
email: "",
ref_firstname: "",
ref_lastname: "",
ref_email: "",
};
function ReferralDisplay() {
const apiCall = new usersService(); // GET API CALL
const navigate = useNavigate();
let [refHistoryReload, setRefHistoryReload] = useState(false); // Determines when referral history reloads
@@ -76,13 +74,13 @@ function ReferralDisplay() {
.then((res) => {
if (res.data.internal_return < 0) {
setError({
message: "Email already referred",
message: res.data.status,
loading: false,
status: false,
});
return;
} else {
toast.success("Message Sent");
toast.success(res.data.status | "Message Sent!");
setError({ message: "", loading: false, status: true });
setRefHistoryReload((prev) => !prev);
}
@@ -99,16 +97,7 @@ function ReferralDisplay() {
//FUNCTION TO HANDLE SUBMIT
const handleSubmit = (values, helpers) => {
setError({ message: "", loading: true, status: false });
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: 11032,
...values,
};
sendReferralMsg(postData); // FUNCTION TO SEND REFERRAL MESSAGE
sendReferralMsg({...values}); // FUNCTION TO SEND REFERRAL MESSAGE
};
useEffect(() => {
@@ -116,10 +105,18 @@ function ReferralDisplay() {
}, [refHistoryReload]);
return (
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="referral w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
<div className="content-wrapper w-full lg:flex xl:space-x-8 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
<span>Refer a Friend</span>
</h1>
</div>
</div>
<div className="referral w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="mb-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Send Referral
</h2>
<Formik
@@ -129,42 +126,46 @@ function ReferralDisplay() {
>
{(props) => (
<Form className="referral-info">
{/* Firstname */}
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
label="Firstname"
type="text"
name="firstname"
placeholder="Firstname"
value={props.values.firstname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.firstname && props.touched.firstname && (
<p className="text-sm text-red-500">
{props.errors.firstname}
</p>
)}
</div>
<div className="block md:mb-6 md:flex gap-10">
{/* Firstname */}
<div className="field w-full mb-6 md:mb-0">
<InputCom
fieldClass="px-6"
label="Firstname"
type="text"
name="ref_firstname"
placeholder="Firstname"
value={props.values.ref_firstname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.ref_firstname &&
props.touched.ref_firstname && (
<p className="text-sm text-red-500">
{props.errors.ref_firstname}
</p>
)}
</div>
{/* Lastname */}
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
label="Lastname"
type="text"
name="lastname"
placeholder="Lastname"
value={props.values.lastname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.lastname && props.touched.lastname && (
<p className="text-sm text-red-500">
{props.errors.lastname}
</p>
)}
{/* Lastname */}
<div className="field w-full mb-6 md:mb-0">
<InputCom
fieldClass="px-6"
label="Lastname"
type="text"
name="ref_lastname"
placeholder="Lastname"
value={props.values.ref_lastname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.ref_lastname &&
props.touched.ref_lastname && (
<p className="text-sm text-red-500">
{props.errors.ref_lastname}
</p>
)}
</div>
</div>
<div className="field w-full mb-6">
@@ -172,14 +173,16 @@ function ReferralDisplay() {
fieldClass="px-6"
label="Email"
type="text"
name="email"
name="ref_email"
placeholder="Email"
value={props.values.email}
value={props.values.ref_email}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.email && props.touched.email && (
<p className="text-sm text-red-500">{props.errors.email}</p>
{props.errors.ref_email && props.touched.ref_email && (
<p className="text-sm text-red-500">
{props.errors.ref_email}
</p>
)}
</div>
@@ -193,7 +196,7 @@ function ReferralDisplay() {
) : (
<button
type="submit"
className="text-lg text-white bg-sky-blue p-2 hover:opacity-90 rounded-md"
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Send Message
</button>
@@ -203,10 +206,8 @@ function ReferralDisplay() {
)}
</Formik>
</div>
</div>
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="referral w-full md:p-8 p-4 h-full max-h-[700px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
<div className="w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="mb-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Referral List
</h2>
+9 -5
View File
@@ -1,14 +1,18 @@
import React from "react";
import Accordion from "../../Helpers/Accordion";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
export default function FaqTab({ datas = [] }) {
export default function FaqTab({ datas }) {
return (
<div className="faq-tab w-full">
<div className="accordion-items w-full">
{datas &&
datas.length > 0 &&
datas.map((value) => (
<Accordion key={value.id + Math.random()} datas={value} />
{datas.loading ?
<LoadingSpinner color='sky-blue' size={16} />
:
datas &&
datas?.data?.length > 0 &&
datas.data.map((value, index) => (
<Accordion key={index + Math.random()} datas={value} />
))}
</div>
</div>
+3 -5
View File
@@ -1,7 +1,7 @@
import React, { useRef, useState } from "react";
import cover from "../../assets/images/profile-info-cover.png";
import profile from "../../assets/images/profile-info-profile.png";
import faq from "../../data/faq.json";
import Icons from "../Helpers/Icons";
import Layout from "../Partials/Layout";
import ChangePasswordTab from "./Tabs/ChangePasswordTab";
@@ -12,7 +12,7 @@ import PaymentMathodsTab from "./Tabs/PaymentMathodsTab";
import PersonalInfoTab from "./Tabs/PersonalInfoTab";
import TermsConditionTab from "./Tabs/TermsConditionTab";
export default function Settings() {
export default function Settings({faq}) {
const tabs = [
{
id: 1,
@@ -83,8 +83,6 @@ export default function Settings() {
}
};
// fab tab
const faqData = faq.datas;
return (
<>
<Layout>
@@ -259,7 +257,7 @@ export default function Settings() {
)}
{tab === "login_activity" && <LoginActivityTab />}
{tab === "password" && <ChangePasswordTab />}
{tab === "faq" && <FaqTab datas={faqData} />}
{tab === "faq" && <FaqTab datas={faq} />}
{tab === "terms" && <TermsConditionTab />}
</div>
</div>
+22 -21
View File
@@ -1,34 +1,35 @@
import React from "react";
import { Link } from "react-router-dom";
import RecomendedSliders from "./RecomendedSliders";
export default function CommonHead({ className,commonHeadData }) {
const vvv= commonHeadData();
console.log("UUUUUUUU-",vvv);
return (
<div
className={`create-nft w-full lg:h-[140px] shadow lg:flex rounded-lg justify-between items-center md:p-9 p-4 bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] -2 border-pink mb-10 ${
className={`create-nft w-full lg:h-[140px] shadow lg:flex rounded-lg justify-between items-center md:p-2 p-2 bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] -2 border-pink mb-10 ${
className || ""
}`}
>
<div className="lg:w-8/12 w-full mb-8 lg:mb-0">
<h1 className="text-2xl text-dark-gray dark:text-white font-bold mb-2">
This is common head which will appear as needed , will take many shape
</h1>
<p className="text-base text-thin-light-gray tracking-wide">
some space for extra texts here
</p>
</div>
<div className="flex-1 flex lg:justify-end">
<div className="flex items-center space-x-5">
<Link
to="/mytask"
className="w-40 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View Task
</Link>
{commonHeadData?.length > 0 && <RecomendedSliders bannerData={commonHeadData} /> }
{/*<div className="lg:w-8/12 w-full mb-8 lg:mb-0">*/}
{/* /!*<h1 className="text-2xl text-dark-gray dark:text-white font-bold mb-2">*!/*/}
{/* /!* This is common head which will appear as needed , will take many shape*!/*/}
{/* /!*</h1>*!/*/}
{/* /!*<p className="text-base text-thin-light-gray tracking-wide">*!/*/}
{/* /!* some space for extra texts here*!/*/}
{/* /!*</p>*!/*/}
{/* */}
{/*</div>*/}
{/*<div className="flex-1 flex lg:justify-end">*/}
{/* <div className="flex items-center space-x-5">*/}
{/* <Link*/}
{/* to="/mytask"*/}
{/* className="w-40 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"*/}
{/* >*/}
{/* View Task*/}
{/* </Link>*/}
</div>
</div>
{/* </div>*/}
{/*</div>*/}
</div>
);
}
@@ -0,0 +1,132 @@
import React, { useRef } from "react";
import top from "../../assets/images/top-buyer-1png.png";
import top2 from "../../assets/images/top-buyer-2.png";
import top3 from "../../assets/images/top-buyer-3.png";
import top4 from "../../assets/images/top-buyer-4.png";
import Icons from "../Helpers/Icons";
import SliderCom from "../Helpers/SliderCom";
import { Link } from "react-router-dom";
export default function RecomendedSliders({ className,bannerData }) {
const settings = {
arrows: false,
dots: false,
infinite: bannerData.length > 4 ? true : false,
autoplay: true,
slidesToShow: bannerData.length > 4 ? 4 : bannerData.length,
slidesToScroll: 1,
responsive: [
{
breakpoint: 426,
settings: {
infinite: bannerData.length > 2 ? true : false,
slidesToShow: bannerData.length > 2 ? 2 : bannerData.length,
slidesToScroll: 1,
},
},
],
};
const sellSlider = useRef(null);
const buySlider = useRef(null);
const prevHandler = (value) => {
if (value === "sell") {
sellSlider.current.slickPrev();
}
if (value === "buy") {
buySlider.current.slickPrev();
}
};
const nextHandler = (value) => {
if (value === "sell") {
sellSlider.current.slickNext();
}
if (value === "buy") {
buySlider.current.slickNext();
}
};
return (
<>
{/*<div className="heading flex justify-between items-center mb-4">*/}
{/* <h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">*/}
{/* Top Seller*/}
{/* </h1>*/}
{/* <div className="slider-btns flex space-x-4">*/}
{/* <button*/}
{/* onClick={() => nextHandler("sell")}*/}
{/* type="button"*/}
{/* className="transform rotate-180 text-dark-gray dark:text-white dark:opacity-25"*/}
{/* >*/}
{/* <Icons name="arrows" />*/}
{/* </button>*/}
{/* <button*/}
{/* onClick={() => prevHandler("sell")}*/}
{/* type="button"*/}
{/* className="transform rotate-180"*/}
{/* >*/}
{/* <div className=" text-dark-gray dark:text-white">*/}
{/* <svg*/}
{/* width="11"*/}
{/* height="19"*/}
{/* viewBox="0 0 11 19"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* d="M9.09766 1.1499L1.13307 9.11449L9.09766 17.0791"*/}
{/* stroke="url(#paint0_linear_220_23410)"*/}
{/* strokeWidth="2"*/}
{/* strokeLinecap="round"*/}
{/* strokeLinejoin="round"*/}
{/* />*/}
{/* <defs>*/}
{/* <linearGradient*/}
{/* id="paint0_linear_220_23410"*/}
{/* x1="9.09766"*/}
{/* y1="1.1499"*/}
{/* x2="-4.2474"*/}
{/* y2="7.96749"*/}
{/* gradientUnits="userSpaceOnUse"*/}
{/* >*/}
{/* <stop stopColor="#F539F8" />*/}
{/* <stop offset="0.416763" stopColor="#C342F9" />*/}
{/* <stop offset="1" stopColor="#5356FB" />*/}
{/* </linearGradient>*/}
{/* </defs>*/}
{/* </svg>*/}
{/* </div>*/}
{/* </button>*/}
{/* </div>*/}
{/*</div>*/}
<div className="slider-content">
<SliderCom settings={settings} selector={sellSlider}>
{bannerData.map((item, index) => (
<Link key={index} to={`/${item.link_path}`}>
<div className="item">
<div className={`commonHeaderSliderItem flex flex-col justify-between items-center ${item.short_style}`}>
{/* title */}
<div className="flex justify-center">
<p className="text-base font-bold text-dark-gray dark:text-white">
{item.short_title}
</p>
</div>
{/* username */}
<div className="flex justify-center mb-1">
<p className="text-xs text-thin-light-gray">
{item.short_description}
</p>
</div>
{/* items */}
<div className="flex justify-center">
<div className="flex space-x-1 items-center text-purple text-xs">
<span>{item.short_button_text}</span>
</div>
</div>
</div>
</div>
</Link>
))}
</SliderCom>
</div>
</>
);
}
+159 -138
View File
@@ -1,152 +1,173 @@
import React, { useState } from 'react'
import ModalCom from '../Helpers/ModalCom'
import { useNavigate } from 'react-router-dom'
import usersService from '../../services/UsersService'
import LoadingSpinner from '../Spinners/LoadingSpinner'
import { useDispatch } from 'react-redux'
import { tableReload } from '../../store/TableReloads'
import React, { useState } from "react";
import ModalCom from "../Helpers/ModalCom";
import { useNavigate } from "react-router-dom";
import usersService from "../../services/UsersService";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import { useDispatch } from "react-redux";
import { tableReload } from "../../store/TableReloads";
function DeleteJobPopout({details, onClose, situation}) {
let dispatch = useDispatch()
const navigate = useNavigate()
const ApiCall = new usersService()
function DeleteJobPopout({ details, onClose, situation }) {
let dispatch = useDispatch();
const navigate = useNavigate();
const ApiCall = new usersService();
let [requestStatus, setRequestStatus] = useState({laoding: false, status:false, message: ''}) // STATE FOR KNOWING WHEN A REQUEST IS MADE TO THE SERVER
let [requestStatus, setRequestStatus] = useState({
laoding: false,
status: false,
message: "",
}); // STATE FOR KNOWING WHEN A REQUEST IS MADE TO THE SERVER
// FUNCTION CALLED ONCE USER CONFIRM DELETE JOB
const deleteJob = (details) => {
setRequestStatus({laoding: true, status:false, message: ''})
let reqData = {
job_id: details.job_id,
job_uid: details.job_uid
} // DATA NEEDED BY THE API
// API CALL TO DELETE A JOB
ApiCall.deleteJob(reqData).then(res => {
if(res.data.internal_return < 0){
setRequestStatus({laoding: false, status:false, message: 'Could not perform the request, try again!'})
return
}
setRequestStatus({laoding: false, status:true, message: 'Job deleted successfully'})
setTimeout(()=>{
dispatch(tableReload({type:'JOBTABLE'}))
navigate('/myjobs', {replace: true})
onClose()
}, 1000)
}).catch(error => {
setRequestStatus({laoding: false, status:false, message: 'Opps! something went wrong, try again'})
}).finally(()=>{
setTimeout(()=>{
setRequestStatus({laoding: false, status:false, message: ''})
}, 5000)
})
}
// FUNCTION CALLED ONCE USER CONFIRM DELETE JOB
const deleteJob = (details) => {
setRequestStatus({ laoding: true, status: false, message: "" });
let reqData = {
job_id: details.job_id,
job_uid: details.job_uid,
}; // DATA NEEDED BY THE API
// API CALL TO DELETE A JOB
ApiCall.deleteJob(reqData)
.then((res) => {
if (res.data.internal_return < 0) {
setRequestStatus({
laoding: false,
status: false,
message: "Could not perform the request, try again!",
});
return;
}
setRequestStatus({
laoding: false,
status: true,
message: "Job deleted successfully",
});
setTimeout(() => {
dispatch(tableReload({ type: "JOBTABLE" }));
navigate("/myjobs", { replace: true });
onClose();
}, 1000);
})
.catch((error) => {
setRequestStatus({
laoding: false,
status: false,
message: "Opps! something went wrong, try again",
});
})
.finally(() => {
setTimeout(() => {
setRequestStatus({ laoding: false, status: false, message: "" });
}, 5000);
});
};
return (
<ModalCom action={onClose} situation={situation}>
<div className="logout-modal-wrapper lg:w-[600px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Delete Job
</h1>
<div className="logout-modal-wrapper lg:w-[600px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Delete Job
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
onClick={onClose}
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<div className="logout-modal-body w-full flex flex-col items-center px-10 py-8">
<div className="what-icon mb-6 cursor-pointer">
<svg
width="136"
height="136"
viewBox="0 0 136 136"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="68" cy="68" r="68" fill="#5356FB" />
<path
d="M69.8844 35.7891C71.1588 36.0357 72.4569 36.1967 73.7044 36.5423C81.5447 38.7098 87.2705 45.5378 87.9574 53.6156C88.5113 60.1147 86.3075 65.6006 81.5043 70.0195C79.8359 71.5545 78.0497 72.9604 76.3408 74.4534C76.127 74.6397 75.9654 75.0037 75.9604 75.2872C75.9284 77.2752 75.9435 79.2649 75.9435 81.2965C70.8895 81.2965 65.8758 81.2965 60.7915 81.2965C60.7915 81.0616 60.7915 80.8385 60.7915 80.6137C60.7915 76.5454 60.7999 72.4772 60.7797 68.4106C60.778 67.9392 60.9312 67.649 61.2831 67.3537C64.5643 64.5957 67.8271 61.8175 71.1033 59.0545C72.2616 58.0781 72.9215 56.8702 72.9081 55.3419C72.8878 52.916 70.8608 50.9146 68.423 50.8911C65.9701 50.8693 63.9145 52.8053 63.832 55.2328C63.8084 55.8988 63.8286 56.5665 63.8286 57.2695C58.7745 57.2695 53.7744 57.2695 48.6917 57.2695C48.6917 56.3149 48.6462 55.3385 48.6984 54.3655C49.222 44.699 56.7442 36.8745 66.4331 35.8914C66.5762 35.8763 66.7142 35.8243 66.854 35.7891C67.8641 35.7891 68.8742 35.7891 69.8844 35.7891Z"
fill="white"
/>
<path
d="M67.485 100.21C66.1617 99.9268 64.9041 99.5091 63.803 98.6787C61.3804 96.8484 60.2877 93.7699 61.0386 90.7888C61.7726 87.8747 64.2138 85.6703 67.2089 85.2157C71.273 84.6 75.2024 87.3681 75.8135 91.277C76.4937 95.6153 73.8202 99.3782 69.544 100.103C69.4429 100.12 69.3487 100.172 69.2527 100.209C68.6635 100.21 68.0742 100.21 67.485 100.21Z"
fill="white"
/>
</svg>
</div>
<div className="mb-6">
<p className="text-xl tracking-wide text-dark-gray dark:text-white">
{details.title}
</p>
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
Price: {details.thePrice}
</p>
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
Duration: {details.timeline_days} day(s)
</p>
</div>
<div className="flex space-x-2.5">
<button
onClick={onClose}
type="button"
className=" border-gradient text-18 tracking-wide px-4 py-3 rounded-full"
>
<span className="text-gradient">Cancel</span>
</button>
{requestStatus.laoding ? (
<LoadingSpinner size="8" color="sky-blue" />
) : (
<button
onClick={() => deleteJob(details)}
type="button"
className="text-[#374557] dark:text-red-500"
onClick={onClose}
className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full"
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
Confirm Delete
</button>
</div>
<div className="logout-modal-body w-full flex flex-col items-center px-10 py-8">
<div className="what-icon mb-6 cursor-pointer">
<svg
width="136"
height="136"
viewBox="0 0 136 136"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="68" cy="68" r="68" fill="#5356FB" />
<path
d="M69.8844 35.7891C71.1588 36.0357 72.4569 36.1967 73.7044 36.5423C81.5447 38.7098 87.2705 45.5378 87.9574 53.6156C88.5113 60.1147 86.3075 65.6006 81.5043 70.0195C79.8359 71.5545 78.0497 72.9604 76.3408 74.4534C76.127 74.6397 75.9654 75.0037 75.9604 75.2872C75.9284 77.2752 75.9435 79.2649 75.9435 81.2965C70.8895 81.2965 65.8758 81.2965 60.7915 81.2965C60.7915 81.0616 60.7915 80.8385 60.7915 80.6137C60.7915 76.5454 60.7999 72.4772 60.7797 68.4106C60.778 67.9392 60.9312 67.649 61.2831 67.3537C64.5643 64.5957 67.8271 61.8175 71.1033 59.0545C72.2616 58.0781 72.9215 56.8702 72.9081 55.3419C72.8878 52.916 70.8608 50.9146 68.423 50.8911C65.9701 50.8693 63.9145 52.8053 63.832 55.2328C63.8084 55.8988 63.8286 56.5665 63.8286 57.2695C58.7745 57.2695 53.7744 57.2695 48.6917 57.2695C48.6917 56.3149 48.6462 55.3385 48.6984 54.3655C49.222 44.699 56.7442 36.8745 66.4331 35.8914C66.5762 35.8763 66.7142 35.8243 66.854 35.7891C67.8641 35.7891 68.8742 35.7891 69.8844 35.7891Z"
fill="white"
/>
<path
d="M67.485 100.21C66.1617 99.9268 64.9041 99.5091 63.803 98.6787C61.3804 96.8484 60.2877 93.7699 61.0386 90.7888C61.7726 87.8747 64.2138 85.6703 67.2089 85.2157C71.273 84.6 75.2024 87.3681 75.8135 91.277C76.4937 95.6153 73.8202 99.3782 69.544 100.103C69.4429 100.12 69.3487 100.172 69.2527 100.209C68.6635 100.21 68.0742 100.21 67.485 100.21Z"
fill="white"
/>
</svg>
</div>
<div className="mb-6">
<p className="text-xl tracking-wide text-dark-gray dark:text-white">
{details.title}
</p>
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
Price: {details.price * 0.01}
</p>
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
Duration: {details.timeline_days} day(s)
</p>
</div>
<div className="flex space-x-2.5">
<button
onClick={onClose}
type="button"
className=" border-gradient text-18 tracking-wide px-4 py-3 rounded-full"
>
<span className="text-gradient">Cancel</span>
</button>
{requestStatus.laoding ?
<LoadingSpinner size='8' color='sky-blue' />
:
<button
onClick={() => deleteJob(details)}
type="button"
className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full"
>
Confirm Delete
</button>
}
</div>
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
{requestStatus.message != "" && (
!requestStatus.status ?
(<div className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}>
{requestStatus.message}
</div>)
:
requestStatus.status &&
(<div className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}>
{requestStatus.message}
</div>
)
)}
{/* End of error or success display */}
</div>
)}
</div>
</ModalCom>
)
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
{requestStatus.message != "" &&
(!requestStatus.status ? (
<div
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{requestStatus.message}
</div>
) : (
requestStatus.status && (
<div
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{requestStatus.message}
</div>
)
))}
{/* End of error or success display */}
</div>
</div>
</ModalCom>
);
}
export default DeleteJobPopout
export default DeleteJobPopout;
+105 -84
View File
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useMemo, useState } from "react";
import React, { useCallback, useMemo, useState } from "react";
import ModalCom from "../Helpers/ModalCom";
import { Field, Form, Formik } from "formik";
import * as Yup from "yup";
@@ -6,13 +6,17 @@ import InputCom from "../Helpers/Inputs/InputCom";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import usersService from "../../services/UsersService";
import { useNavigate } from "react-router-dom";
import { tableReload } from "../../store/TableReloads";
import { useDispatch } from "react-redux";
const EditJobPopOut = ({ details, onClose, situation, country }) => {
const dispatch = useDispatch()
const EditJobPopOut = ({
details,
onClose,
situation,
country,
categories,
}) => {
const dispatch = useDispatch();
let [requestStatus, setRequestStatus] = useState({
loading: false,
@@ -55,27 +59,31 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
description: details?.description,
job_detail: details?.job_detail,
timeline_days: details?.timeline_days,
category: details?.category
};
console.log("This is the init values for edit job",initialValues)
const jobApi = useMemo(() => new usersService(), []);
const navigate = useNavigate();
const handleEditJob = useCallback(
async (values) => {
values.category = values.category?.join("@");
setRequestStatus({ loading: true, message: "" });
let reqData = {
job_id: details.job_id,
job_uid: details.job_uid,
...values,
};
delete reqData?.country
delete reqData?.country;
try {
let res = await jobApi.jobManagerUpdateJob(reqData);
let { data } = await res;
if (data?.internal_return < 0) return;
setRequestStatus({ loading: false, message: null });
setTimeout(() => {
dispatch(tableReload({type:'JOBTABLE'}))
dispatch(tableReload({ type: "JOBTABLE" }));
navigate("/myjobs", { replace: true });
onClose();
}, 1000);
@@ -130,7 +138,7 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
<Form className="w-full">
<div className="flex flex-col-reverse sm:flex-row">
<div className="fields w-full">
<div className="xl:flex xl:space-x-7 mb-6">
<div className="xl:flex xl:space-x-7 mb-[0.5rem]">
<div className="field w-full mb-6 xl:mb-0">
<InputCom
fieldClass="px-6 cursor-default"
@@ -145,11 +153,6 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
blurHandler={props.handleBlur}
disable={true}
/>
{props.errors.country && props.touched.country && (
<p className="text-sm text-red-500">
{props.errors.country}
</p>
)}
</div>
{/* Price */}
@@ -162,20 +165,17 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
inputClass="input-curve lg border border-light-purple"
type="number"
name="price"
// placeholder="Please Enter Amount"
value={props.values.price * 0.01}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
errorBorder={
props.errors.price && props.touched.price
}
/>
{props.errors.price && props.touched.price && (
<p className="text-sm text-red-500">
{props.errors.price}
</p>
)}
</div>
</div>
{/* Title */}
<div className="field w-full mb-6">
<div className="field w-full mb-[0.5rem]">
<InputCom
fieldClass="px-6"
label="Title"
@@ -184,20 +184,15 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
inputClass=" input-curve lg border border-light-purple"
type="text"
name="title"
// placeholder="Enter Job Title"
value={props.values.title}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
errorBorder={props.errors.title && props.touched.title}
/>
{props.errors.title && props.touched.title && (
<p className="text-sm text-red-500">
{props.errors.title}
</p>
)}
</div>
{/* Description */}
<div className="field w-full mb-6">
<div className="field w-full mb-[0.5rem]">
<InputCom
fieldClass="px-6"
label="Description"
@@ -206,84 +201,110 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
inputClass=" input-curve lg border border-light-purple"
type="text"
name="description"
// placeholder="Enter a description"
value={props.values.description}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
errorBorder={
props.errors.description && props.touched.description
}
/>
{props.errors.description &&
props.touched.description && (
<p className="text-sm text-red-500">
{props.errors.description}
</p>
)}
</div>
{/* Details */}
<div className="field w-full mb-6">
<label
htmlFor="Job Delivery Details"
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block mb-3'
>
Job Delivery Details
</label>
<textarea
id="Job Delivery Details"
rows="5"
className={`input-field px-6 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] border border-[#dce4e9] rounded-[10px]`}
style={{ resize: "none" }}
name="job_detail"
value={props.values.job_detail}
onChange={props.handleChange}
onBlur={props.handleBlur}
/>
<div className="field flex flex-col sm:flex-row w-full mb-[5px] gap-2">
<div className="sm:w-[60%] w-full">
<label
htmlFor="Job Delivery Details"
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"'
>
Job Delivery Details
</label>
<textarea
id="Job Delivery Details"
rows="5"
className={`input-field px-6 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] border border-[#dce4e9] rounded-[10px]`}
style={{ resize: "none" }}
name="job_detail"
value={props.values.job_detail}
onChange={props.handleChange}
onBlur={props.handleBlur}
/>
</div>
<div className="sm:w-[35%] w-full">
<div
htmlFor="Job Categories"
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"'
id="checked-group"
>
Categories
</div>
<div
className="sm:flex-col flex flex-wrap px-3 mt-3"
role="group"
aria-labelledby="checked-group"
>
{Object.entries(categories).map(([key, value]) => (
<label
key={key}
className="flex gap-1 w-full items-center"
>
<Field
type="checkbox"
name="category"
value={key}
/>
<span className="text-[13.975px]">{value}</span>
</label>
))}
</div>
</div>
{/* <div className={`${!props.errors && "invisible"} h-5`}>
{props.errors.job_detail && props.touched.job_detail && (
<p className="text-sm text-red-500">
{props.errors.job_detail}
</p>
)}
</div> */}
</div>
<div className="field w-full mb-6">
<div className={`flex items-center justify-between mb-2.5`}>
<label
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
htmlFor="timeline_days"
<div
className={`flex items-center justify-between mb-2.5`}
>
Timeline
<span className="text-green-700 text-sm tracking-wide">
- Expected duration of this task
</span>
</label>
</div>
<Field
component="select"
name="timeline_days"
className="input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none"
value={props.values.timeline_days}
>
<option value="">Select Duration</option>
{publicArray.map(({ name, duration }, idx) => (
<option
className="text-slate-500 text-lg"
value={duration}
<label
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
htmlFor="timeline_days"
>
{name}
</option>
))}
</Field>
{props.errors.timeline_days &&
props.touched.timeline_days && (
<p className="text-sm text-red-500">
{props.errors.timeline_days}
</p>
)}
Timeline
<span className="text-green-700 text-sm tracking-wide">
- Expected duration of this task
</span>
</label>
</div>
<Field
component="select"
name="timeline_days"
className="input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none"
value={props.values.timeline_days}
>
<option value="">Select Duration</option>
{publicArray.map(({ name, duration }, idx) => (
<option
className="text-slate-500 text-lg"
value={duration}
>
{name}
</option>
))}
</Field>
</div>
{/* inputs ends here */}
</div>
</div>
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
<div className="content-footer w-full">
{/* error or success display */}
{requestStatus.message != "" &&
+2 -2
View File
@@ -3,7 +3,7 @@ import Detail from "./popoutcomponent/Detail";
import ModalCom from "../Helpers/ModalCom";
import InputCom from "../Helpers/Inputs/InputCom/index";
import SiteService from "../../services/SiteService";
import { Form, Formik, Field, ErrorMessage } from "formik";
import { Form, Formik, Field } from "formik";
import * as Yup from "yup";
import LoadingSpinner from "../Spinners/LoadingSpinner";
@@ -210,7 +210,7 @@ function JobListPopout({ details, onClose, situation }) {
</div>
<div className="my-3 md:flex">
<Detail label="Price" value={`${details.price * 0.01} Naira`} />
<Detail label="Price" value={details.thePrice} />
</div>
<div className="my-3 md:flex">
+60 -31
View File
@@ -1,46 +1,63 @@
import React, { useMemo, useState } from "react";
import React, { useCallback, useMemo, useState } from "react";
import Detail from "./popoutcomponent/Detail";
import ModalCom from "../Helpers/ModalCom";
import usersService from "../../services/UsersService";
import { toast } from "react-toastify";
import LoadingSpinner from "../Spinners/LoadingSpinner";
const showSuccessToast = (message) => {
toast.success(message, {
autoClose: 3000,
hideProgressBar: true,
});
};
function PendingJobsPopout({ details, onClose, situation }) {
const [pendingJobLoader, setPendingJobLoader] = useState(false)
const [pendingJobLoader, setPendingJobLoader] = useState({
extend: false,
offer: false,
});
const apiCall = useMemo(() => new usersService(), []);
const handlePendingJobsBtn = async ({ target: { name } }) => {
setPendingJobLoader(true)
let { job_uid, offer_code } = details;
let reqData;
const handlePendingJobsBtn = useCallback(
async ({ target: { name } }) => {
let { job_uid, offer_code } = details;
let pendingData = { job_uid, offer_code };
let reqData;
let pendingData = { job_uid, offer_code };
if (name === "extend") {
try {
reqData = { ...pendingData };
let { data } = await apiCall.pendingJobExtend(reqData);
console.log("This is for extend", data);
setPendingJobLoader(false)
if (name === "extend") {
setPendingJobLoader({ extend: true });
reqData = { ...pendingData };
// let { data } =
await apiCall.pendingJobExtend(reqData);
// console.log("This is for extend", data);
showSuccessToast("Job has been extended by a week!");
} else if (name === "offer") {
setPendingJobLoader({ offer: true });
reqData = { ...pendingData };
// let { data } =
await apiCall.pendingJobSendTome(reqData);
// console.log("This is for offer", data);
showSuccessToast("Offer sent, check your email");
} else return;
setTimeout(() => {
setPendingJobLoader({ extend: false, offer: false });
onClose();
}, 2700);
} catch (error) {
setPendingJobLoader(false)
setPendingJobLoader({ extend: false, offer: false });
throw new Error(error);
}
} else if (name === "offer") {
try {
reqData = { ...pendingData };
let { data } = await apiCall.pendingJobSendTome(reqData);
console.log("This is for offer", data);
setPendingJobLoader(false)
} catch (error) {
setPendingJobLoader(false)
throw new Error(error);
}
} else return;
},
[onClose, apiCall, details]
);
onClose();
};
return (
<ModalCom action={onClose} situation={situation}>
<ModalCom action={onClose} situation={situation} className="edit-popup">
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
@@ -159,7 +176,13 @@ function PendingJobsPopout({ details, onClose, situation }) {
onClick={handlePendingJobsBtn}
name="extend"
>
Extend by a week
{pendingJobLoader.extend ? (
<div className="w-[136px] flex justify-center items-center h-full">
<LoadingSpinner size={5} color="sky-blue" />
</div>
) : (
"Extend by a week"
)}
</button>
</div>
@@ -169,7 +192,13 @@ function PendingJobsPopout({ details, onClose, situation }) {
onClick={handlePendingJobsBtn}
name="offer"
>
Send to me
{pendingJobLoader.offer ? (
<div className="w-[96px] flex justify-center items-center h-full">
<LoadingSpinner size={5} color="sky-blue" />
</div>
) : (
"Send to me"
)}
</button>
</div>
@@ -200,4 +229,4 @@ function PendingJobsPopout({ details, onClose, situation }) {
);
}
export default PendingJobsPopout;
export default PendingJobsPopout;
+124 -6
View File
@@ -9,20 +9,84 @@
font-family: "Product Sans";
src: url("./assets/fonts/Product Sans Bold.ttf");
}
.wallet-box{
background-color: aliceblue;
border-radius: 20px;
}
.bal-col1{
width: 110px;
}
.bg-green{
background-color: darkgreen;
}
.referral{
margin-bottom: 20px
}
.heroSilderTitle{
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
font-family: sans; color: white;
font-size: 42px;
}
.job-action{
background-color: lightgoldenrodyellow;
height: 100px;
border-radius: 15px;
}
.msg_box{
background-color: aliceblue;
margin: 5px;
padding: 5px;
border-radius: 15px;
}
.msg_header{
background-color: #1a3544;
color: white;
font-weight: bold;
}
.siderCardHeader{
margin: 40px 40px 10px 40px;
font-size: 24px;
font-weight: bolder;
}
.siderCardDescription{
margin: 20px 45px 10px 45px;
font-size: 20px;
margin: 10px 45px 10px 45px;
font-size: 18px;
background-color: aliceblue;
padding: 5px;
border-radius: 5px;
}
.siderCardButton{
margin-top: 10px;
width: 100%;
text-align: center;
}
.commonHeaderSliderItem{
background-color: aliceblue;
border-radius: 10px;
margin: 0px 5px 0px 5px;
height: 95px;
padding: 5px;
}
.short_style{
background-color: transparent;
border-color: #a2d7f1;
border-width: 3px;
}
.lr{
background-color: #e1cace;
}
.lg{
background-color: #a7dca7;
}
.lb{
background-color: #b3ccd7;
}
.ly{
background-color: #eeee67;
}
.offer-slide-item{
background: rgb(2,0,36);
background: radial-gradient(circle, rgba(2,0,36,1) 0%, rgba(3,51,2,0.782125350140056) 0%, rgba(0,212,255,0.07904411764705888) 0%, rgba(153,182,201,1) 99%);
@@ -578,6 +642,20 @@ input[type="text"][dir="rtl"] {
.modal-com {
transition: all 0.1s ease-in-out;
}
@media print {
body .modal-com{
height: 100%;
overflow: hidden;
}
.job-action-modal-body button, .message-modal-header button {
display: none;
}
.message-modal-wrapper .message-table{
height: 100%;
overflow-y: hidden;
}
}
/* TODO: =================================modal end================================= */
/* TODO: =================================login ================================= */
.btn-login {
@@ -775,18 +853,22 @@ TODO: Responsive ===========================
}
/* Update table scrollbar */
.update-table::-webkit-scrollbar-track, .update-table > *::-webkit-scrollbar-track{
.update-table::-webkit-scrollbar-track, .update-table > *::-webkit-scrollbar-track,
.market-pop::-webkit-scrollbar-track,
.wallet.coupon::-webkit-scrollbar-track{
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
background-color: transparent;
border-radius: 10px;
}
.update-table::-webkit-scrollbar, .update-table > *::-webkit-scrollbar {
.update-table::-webkit-scrollbar, .update-table > *::-webkit-scrollbar,
.market-pop::-webkit-scrollbar,
.wallet.coupon::-webkit-scrollbar {
width: 10px;
background-color: transparent;
}
.update-table::-webkit-scrollbar-thumb, .update-table > *::-webkit-scrollbar-thumb {
.update-table::-webkit-scrollbar-thumb, .update-table > *::-webkit-scrollbar-thumb, .wallet.coupon::-webkit-scrollbar-thumb {
border-radius: 10px;
border-top-right-radius: 50px;
border-bottom-right-radius: 50px;
@@ -794,6 +876,15 @@ TODO: Responsive ===========================
background: linear-gradient(134.38deg, #f539f8 0%, #c342f9 43.55%, #5356fb 104.51%);
}
.market-pop::-webkit-scrollbar-thumb {
border-radius: 100px;
/* background-color: #fafafa; */
/* background: linear-gradient(134.38deg, #f539f8 0%, #c342f9 43.55%, #5356fb 104.51%); */
background: rgb(236,237,241);
background: linear-gradient(90deg, rgba(236,237,241,1) 0%, rgba(252,252,252,1) 31%, rgba(255,255,255,0.9416141456582633) 41%, rgba(255,255,255,0.9752275910364145) 61%, rgba(252,252,252,1) 71%, rgba(236,237,241,1) 100%);
}
.input-curve.lg{
border-radius: 35px !important;
}
@@ -804,4 +895,31 @@ TODO: Responsive ===========================
.job-popup{
top: 55px;
}
}
.addJob-popup{
top: 30px;
height: 55rem !important;
}
@keyframes shake {
0% {
transform: translateX(0);
}
25% {
transform: translateX(-5px);
}
50% {
transform: translateX(5px);
}
75% {
transform: translateX(-5px);
}
100% {
transform: translateX(0);
}
}
.ebu-animate-shake {
animation: shake 0.3s linear 3;
}
+2 -4
View File
@@ -1,4 +1,2 @@
export default function localImgLoad(location) {
const img = require(`../assets/${location}`);
return img;
}
const localImgLoad = (location) => require(`../assets/${location}`);
export default localImgLoad
+42 -14
View File
@@ -6,29 +6,43 @@ import { useDispatch, useSelector } from "react-redux";
import { updateUserDetails } from "../store/UserDetails";
import { updateJobs } from "../store/jobLists";
import { updateUserJobList } from "../store/userJobList";
import { commonHeadBanner } from "../store/CommonHeadBanner";
const AuthRoute = ({ redirectPath = "/login", children }) => {
const apiCall = useMemo(() => new usersService(), []);
const dispatch = useDispatch();
const [lastActivityTime, setLastActivityTime] = useState(Date.now());
const [isLogin, setIsLogin] = useState({ loading: true, status: false });
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
const navigate = useNavigate();
const {jobListTable} = useSelector((state) => state.tableReload)
const { jobListTable } = useSelector((state) => state.tableReload);
useEffect(() => {
//Removing Data stored at localStorage after session expires
const expireSession = () => {
localStorage.clear();
localStorage.removeItem("uid");
localStorage.removeItem("member_id");
localStorage.removeItem("session_token");
navigate("/login", { replace: true }); // redirects user to login page after session expires
};
const checkInactivity = setInterval(() => {
if (
Date.now() - lastActivityTime >
process.env.REACT_APP_SESSION_EXPIRE_MINUTES
) {
expireSession();
let { account_type } = loadProfileDetails;
if (account_type === "FAMILY") {
if (
Date.now() - lastActivityTime >
process.env.REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY
) {
expireSession();
}
} else {
if (
Date.now() - lastActivityTime >
process.env.REACT_APP_SESSION_EXPIRE_MINUTES
) {
expireSession();
}
}
}, process.env.REACT_APP_SESSION_EXPIRE_CHECKER); // Checks for inactivity every minute
@@ -65,6 +79,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
setIsLogin({ loading: false, status: false });
return;
}
setLoadProfileDetails(res.data);
dispatch(updateUserDetails(res.data));
setIsLogin({ loading: false, status: true });
})
@@ -76,22 +91,22 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}
}, []);
useEffect(()=>{
useEffect(() => {
const getMyJobList = async () => {
dispatch(updateUserJobList({loading: true, data:[]}))
dispatch(updateUserJobList({ loading: true, data: [] }));
try {
const res = await apiCall.getMyJobList();
// setMyJobList({loading: false, data:res.data})
// setMyJobList(res.data);
dispatch(updateUserJobList({loading: false, data:res.data}))
dispatch(updateUserJobList({ loading: false, data: res.data }));
} catch (error) {
dispatch(updateUserJobList({loading: false, data:[]}))
dispatch(updateUserJobList({ loading: false, data: [] }));
// setMyJobList({loading: false, data:[]})
console.log("Error getting mode");
}
};
getMyJobList()
},[jobListTable])
getMyJobList();
}, [jobListTable]);
useEffect(() => {
// Getting market data
@@ -106,6 +121,19 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
getMarketActiveJobList();
}, [apiCall, dispatch]);
//FUNCTION TO GET COMMON HEAD DATA
useEffect(()=>{
apiCall.getHeroJBanners().then((res) => {
if (res.data.internal_return < 0) {
return;
}
dispatch(commonHeadBanner(res.data));
})
.catch((error) => {
console.log('ERROR ', error)
});
},[])
return isLogin.loading ? (
<LoadingSpinner size="32" color="sky-blue" height="h-screen" />
) : // Stills needs fixing
+151 -6
View File
@@ -16,9 +16,10 @@ class usersService {
return this.postAuxEnd("/completesignuplink", reqData);
}
// FUNCTION TO GET USER CURRENT TASK DUE TIME
getHomeDate() {
var postData = {
uuid: localStorage.getItem("uid"),
// uuid: localStorage.getItem("uid"),
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
@@ -212,6 +213,21 @@ class usersService {
return this.postAuxEnd("/familymanage", postData);
}
// Family Tasks
ManageTasks(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
job_mode: "ACTIVE",
limit: 30,
offset: 0,
action: 13008,
...reqData
};
return this.postAuxEnd("/jobmanageractive", postData);
}
// Task for the person doing the job
getMyActiveTaskList() {
var postData = {
@@ -229,6 +245,32 @@ class usersService {
uuid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
job_mode: "ACTIVE",
page: 0,
offset: 0,
limit: 100,
};
return this.postAuxEnd("/jobmanageractive", postData);
}
getMyPastDueJobList() {
var postData = {
uuid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
job_mode: "PASTDUE",
page: 0,
offset: 0,
limit: 100,
};
return this.postAuxEnd("/jobmanageractive", postData);
}
getMyReviewDueJobList() {
var postData = {
uuid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
job_mode: "REVIEW",
page: 0,
offset: 0,
limit: 100,
@@ -402,7 +444,14 @@ class usersService {
//END POINT CALL FOR SENDING REFERRAL MESSAGE
sendReferralMsg(postData) {
return this.postAuxEnd("/sendreferral", postData);
var reqData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: 11032,
...postData
}
return this.postAuxEnd("/sendreferral", reqData);
}
StartResetPassword(reqData) {
@@ -413,13 +462,13 @@ class usersService {
return this.postAuxEnd("/stepresetpass", reqData);
}
getCouponRedeem() {
getCouponRedeem(reqData) {
var postData = {
uuid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
page: 0,
limit: 100,
action: 85020,
...reqData
};
return this.postAuxEnd("/couponredeem", postData);
}
@@ -452,6 +501,31 @@ class usersService {
return this.postAuxEnd("/accounttypes", postData);
}
// Manage Interest
MarketInterest(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
msg_type: 'JOB',
action: 13033,
...reqData
};
return this.postAuxEnd("/marketinterest", postData);
}
MarketMessage(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
msg_type: 'JOB',
action: 13036,
...reqData
};
return this.postAuxEnd("/marketmessage", postData);
}
// END POINT TO ACCEPT TERMS AND AGREEMENT
jobManagerAgree() {
var postData = {
@@ -549,7 +623,9 @@ class usersService {
for (let data in postData) {
formData.append(data, postData[data]);
}
return this.postAuxEnd("/uploads", formData);
// return this.postAuxEnd("/uploads", formData);
return this.postAuxEnd("/uploads", postData);
}
// END POINT TO DELETE A JOB
@@ -584,6 +660,75 @@ class usersService {
return this.postAuxEnd("/offersresponse", postData);
}
// END POINT FOR OFFERS INTEREST LIST
offersInterestList() {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: 13024,
limit: 30,
offset: 0
};
return this.postAuxEnd("/offersinterestlist", postData);
}
// END POINT FOR PROCESSING OFFER INTEREST
offersInterestProc(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: 13034,
...reqData
};
return this.postAuxEnd("/offersinterestproc", postData);
}
// END POINT FOR WORKER TO MARK TASK AS COMPLETED
workerJobAction(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: 14015,
...reqData,
};
return this.postAuxEnd("/activetaskstatus", postData);
}
// END POINT FOR OWNER JOB ACTION
ownerJobAction(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: 14015,
...reqData,
};
return this.postAuxEnd("/activejobstatus", postData);
}
// END POINT FOR OWNER JOB ACTION
getFaq() {
var postData = {
uid: localStorage.getItem("uid"),
// member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
};
return this.postAuxEnd("/faq", postData);
}
// END POINT TO GET LIST OF USER PREVIOUS CARDS
payListCard() {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: 11055
};
return this.postAuxEnd("/paylistcard", postData);
}
/*
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
+20
View File
@@ -0,0 +1,20 @@
import { createSlice } from "@reduxjs/toolkit";
const initialState = {
commonHeadBanner: {}
};
export const commonHeadBannerSlice = createSlice({
name: "commonHeadBanner",
initialState,
reducers: {
commonHeadBanner: (state,action) => {
state.commonHeadBanner = {...action.payload}
},
},
});
// Action creators are generated for each case reducer function
export const { commonHeadBanner } = commonHeadBannerSlice.actions;
export default commonHeadBannerSlice.reducer;
+18 -10
View File
@@ -3,7 +3,9 @@ import { createSlice } from "@reduxjs/toolkit";
const initialState = {
jobListTable: false,
pendingListTable: false,
myTaskTable: false
myTaskTable: false,
othersInterestedTable: false,
couponTable: false
};
export const tableReloadSlice = createSlice({
@@ -11,18 +13,24 @@ export const tableReloadSlice = createSlice({
initialState,
reducers: {
tableReload: (state, action) => {
switch(action.payload.type){
case 'JOBTABLE':
switch (action.payload.type) {
case "JOBTABLE":
state.jobListTable = !state.jobListTable;
return
case 'PENDINGTABLE' :
return;
case "PENDINGTABLE":
state.pendingListTable = !state.pendingListTable;
return
case 'MYTASKTABLE' :
return;
case "MYTASKTABLE":
state.myTaskTable = !state.myTaskTable;
return
return;
case "OTHERSINTERESTEDTABLE":
state.othersInterestedTable = !state.othersInterestedTable;
return;
case "COUPONTABLE":
state.couponTable = !state.couponTable;
return;
default:
return state
return state;
}
},
},
@@ -30,4 +38,4 @@ export const tableReloadSlice = createSlice({
export const { tableReload } = tableReloadSlice.actions;
export default tableReloadSlice.reducer;
export default tableReloadSlice.reducer;
+3 -1
View File
@@ -5,6 +5,7 @@ import userDetailReducer from "./UserDetails";
import jobReducer from "./jobLists";
import tableReloadReducer from "./TableReloads";
import userJobListReducer from './userJobList'
import commonHeadBannerReducer from './CommonHeadBanner'
export default configureStore({
reducer: {
@@ -12,6 +13,7 @@ export default configureStore({
userDetails: userDetailReducer,
jobLists: jobReducer,
tableReload: tableReloadReducer,
userJobList: userJobListReducer
userJobList: userJobListReducer,
commonHeadBanner: commonHeadBannerReducer
},
});
+36 -10
View File
@@ -1,14 +1,40 @@
import React from 'react'
import AddJob from '../components/AddJob/AddJob'
import Layout from '../components/Partials/Layout'
import React from "react";
import AddJob from "../components/AddJob/AddJob";
import ModalCom from "../components/Helpers/ModalCom";
function AddJobPage() {
function AddJobPage({ action, situation, categories }) {
return (
<Layout>
<AddJob />
</Layout>
)
<ModalCom action={action} situation={situation} className="edit-popup">
<div className="lg:w-[600px] w-full lg:overflow-hidden lg:rounded-2xl bg-white dark:bg-dark-white ">
<div className="heading flex justify-between items-center py-6 md:px-[30px] px-[23px] border-b dark:border-[#5356fb29] border-light-purple dark:border-[#5356fb29] ">
<p className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Create New Job
</p>
<button type="button" onClick={action}>
<svg
width="32"
height="32"
viewBox="0 0 32 32"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M32 14.3645C32 15.5022 32 16.6399 32 17.7779C31.8143 17.8408 31.8787 18.0048 31.8565 18.1334C30.6952 24.8402 26.8853 29.2664 20.4091 31.362C19.4672 31.6668 18.4669 31.7917 17.4935 31.9997C16.3558 31.9997 15.2181 31.9997 14.0801 31.9997C13.8574 31.741 13.5279 31.7984 13.2475 31.7416C6.90872 30.4552 2.74424 26.7311 0.684152 20.6107C0.386668 19.7268 0.396442 18.7733 0 17.9199C0 16.6399 0 15.3598 0 14.0798C0.259 13.884 0.190585 13.5694 0.240675 13.3162C1.52285 6.84244 5.35655 2.66392 11.5936 0.623067C12.4549 0.34116 13.3785 0.343909 14.2221 0C15.3125 0 16.4029 0 17.4932 0C17.525 0.110258 17.6111 0.120948 17.7089 0.130417C24.2666 0.77242 29.8064 5.52819 31.449 11.9351C31.6552 12.739 31.8174 13.5542 32 14.3645ZM29.3431 16.0699C29.3718 8.68538 23.4154 2.66942 16.0684 2.66178C8.69759 2.65445 2.66972 8.58489 2.65353 15.8601C2.63704 23.2563 8.52319 29.2979 15.7868 29.3404C23.2862 29.3846 29.3144 23.4832 29.3431 16.0699Z"
fill="#374557"
fillOpacity="0.6"
/>
<path
d="M14.1604 16.0221C12.3843 14.2567 10.6724 12.5534 8.95837 10.8525C8.53353 10.431 8.23421 9.97162 8.46175 9.34031C8.83956 8.29209 9.95101 8.07371 10.794 8.906C12.3611 10.4536 13.9344 11.9963 15.4529 13.5909C15.9202 14.0817 16.1447 14.0005 16.5662 13.5643C18.0961 11.9804 19.6617 10.4307 21.2282 8.88248C22.0596 8.06058 23.208 8.30064 23.5522 9.35008C23.7584 9.97865 23.459 10.4383 23.0336 10.8619C21.489 12.3991 19.9531 13.9443 18.4088 15.4815C18.2421 15.6476 18.0408 15.779 17.8188 15.9558C19.629 17.7563 21.366 19.4676 23.0831 21.1987C23.934 22.0567 23.6875 23.2106 22.6072 23.556C21.9658 23.761 21.5223 23.4186 21.1067 23.0023C19.5502 21.444 17.9757 19.9031 16.448 18.3171C16.0616 17.9157 15.8854 17.9811 15.5375 18.3378C13.9835 19.9318 12.399 21.4956 10.8242 23.0692C10.4015 23.4916 9.94887 23.7768 9.30961 23.516C8.27819 23.0948 8.06073 22.0814 8.87591 21.2418C10.0307 20.0528 11.2118 18.8891 12.3895 17.7221C12.9588 17.1577 13.5462 16.6106 14.1604 16.0221Z"
fill="#374557"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<AddJob popUpHandler={action} categories={categories} />
</div>
</ModalCom>
);
}
export default AddJobPage
export default AddJobPage;
+13
View File
@@ -0,0 +1,13 @@
import React, { useContext, useState, useEffect } from "react";
import BlogItem from "../components/Blogs";
import { useSelector } from "react-redux";
export default function BlogPage() {
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
return (
<>
<BlogItem commonHeadData={commonHeadBanner.result_list} />
</>
);
}
+5 -17
View File
@@ -1,29 +1,17 @@
import React, {useState, useEffect} from 'react'
import Home from "../components/Home";
import usersService from "../services/UsersService";
import { useSelector } from 'react-redux';
export default function HomePages() {
// const [marketActiveJobList, setMarketActiveJobList] = useState([]);
const [bannerList, setBannerList] = useState([]);
const api = new usersService();
const getHeroJBannersList = async () => {
try {
const res = await api.getHeroJBanners();
// console.log("BANNERS->",res.data);
setBannerList(res.data?.result_list);
} catch (error) {
console.log("Error getting BANNERS....");
}
};
useEffect(() => {
getHeroJBannersList();
}, []);
const {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
return (
<>
<Home
bannerList={bannerList}
bannerList={commonHeadBanner?.result_list}
/>
</>
);
+46
View File
@@ -0,0 +1,46 @@
import React, { useContext,useState, useEffect } from "react";
import usersService from "../services/UsersService";
import ManageInterestOffer from "../components/OffersInterest/ManageInterestOffer";
import { useSelector } from "react-redux";
import { useLocation, useNavigate } from "react-router-dom";
export default function MyReviewDueJobsPage() {
const {state} = useLocation()
let navigate = useNavigate()
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
let { othersInterestedTable } = useSelector((state) => state.tableReload); // FOR OTHERS INTERESTED TABLE RELOAD
const apiCall = new usersService();
const [othersInterestedList, setOthersInterestedList] = useState({loading: true, data: []})
useEffect(() => {
if(!state){
navigate('/', {replace: true})
return
}
apiCall.offersInterestList().then(res => {
let newData
if(res.data.result_list.length){
newData = res.data.result_list.filter(item => item.offer_code == state.offer_code && item.client_uid != state.client_uid)
}else{
newData = []
}
setOthersInterestedList({loading: false, data: newData})
}).catch(err => {
setOthersInterestedList({loading: false, data: []})
console.log('Error: ', err)
})
}, [othersInterestedTable]);
// debugger;
return (
<>
<ManageInterestOffer
othersInterestedList={othersInterestedList}
commonHeadData={commonHeadBanner.result_list}
offerDetails={state}
/>
</>
);
}
+4 -5
View File
@@ -1,16 +1,15 @@
import MarketPlace from "../components/MarketPlace";
import { useSelector } from "react-redux";
export default function MarketPlacePage() {
const commonHeadData =()=>{
console.log("COMMON HEAD DATA ----------------=====---------------------");
return 0;
}
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
return (
<>
<MarketPlace
commonHeadData={commonHeadData} />
commonHeadData={commonHeadBanner?.result_list} />
</>
);
}

Some files were not shown because too many files have changed in this diff Show More