Browse Source

change router to v6 and caoursel timer to 5 second

master
azri 1 month ago
parent
commit
05500ca552
4 changed files with 30 additions and 61 deletions
  1. 25
    50
      package-lock.json
  2. 2
    1
      package.json
  3. 2
    9
      src/App.js
  4. 1
    1
      src/components/CarouselContainer/CarouselContainer.jsx

+ 25
- 50
package-lock.json View File

@@ -30,7 +30,8 @@
30 30
         "react-material-ui-carousel": "^3.4.2",
31 31
         "react-redux": "^9.2.0",
32 32
         "react-responsive-carousel": "^3.2.23",
33
-        "react-router-dom": "^7.0.2",
33
+        "react-router": "^6.29.0",
34
+        "react-router-dom": "^6.29.0",
34 35
         "react-scripts": "^5.0.1",
35 36
         "shopify-api-node": "^3.14.0",
36 37
         "swiper": "^11.1.4",
@@ -3652,6 +3653,15 @@
3652 3653
         "url": "https://opencollective.com/immer"
3653 3654
       }
3654 3655
     },
3656
+    "node_modules/@remix-run/router": {
3657
+      "version": "1.22.0",
3658
+      "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.22.0.tgz",
3659
+      "integrity": "sha512-MBOl8MeOzpK0HQQQshKB7pABXbmyHizdTpqnrIseTbsv0nAepwC2ENZa1aaBExNQcpLoXmWthhak8SABLzvGPw==",
3660
+      "license": "MIT",
3661
+      "engines": {
3662
+        "node": ">=14.0.0"
3663
+      }
3664
+    },
3655 3665
     "node_modules/@rollup/plugin-babel": {
3656 3666
       "version": "5.3.1",
3657 3667
       "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz",
@@ -4331,12 +4341,6 @@
4331 4341
         "@types/node": "*"
4332 4342
       }
4333 4343
     },
4334
-    "node_modules/@types/cookie": {
4335
-      "version": "0.6.0",
4336
-      "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz",
4337
-      "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==",
4338
-      "license": "MIT"
4339
-    },
4340 4344
     "node_modules/@types/eslint": {
4341 4345
       "version": "8.56.12",
4342 4346
       "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.12.tgz",
@@ -15809,52 +15813,35 @@
15809 15813
       }
15810 15814
     },
15811 15815
     "node_modules/react-router": {
15812
-      "version": "7.0.2",
15813
-      "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.0.2.tgz",
15814
-      "integrity": "sha512-m5AcPfTRUcjwmhBzOJGEl6Y7+Crqyju0+TgTQxoS4SO+BkWbhOrcfZNq6wSWdl2BBbJbsAoBUb8ZacOFT+/JlA==",
15816
+      "version": "6.29.0",
15817
+      "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.29.0.tgz",
15818
+      "integrity": "sha512-DXZJoE0q+KyeVw75Ck6GkPxFak63C4fGqZGNijnWgzB/HzSP1ZfTlBj5COaGWwhrMQ/R8bXiq5Ooy4KG+ReyjQ==",
15815 15819
       "license": "MIT",
15816 15820
       "dependencies": {
15817
-        "@types/cookie": "^0.6.0",
15818
-        "cookie": "^1.0.1",
15819
-        "set-cookie-parser": "^2.6.0",
15820
-        "turbo-stream": "2.4.0"
15821
+        "@remix-run/router": "1.22.0"
15821 15822
       },
15822 15823
       "engines": {
15823
-        "node": ">=20.0.0"
15824
+        "node": ">=14.0.0"
15824 15825
       },
15825 15826
       "peerDependencies": {
15826
-        "react": ">=18",
15827
-        "react-dom": ">=18"
15828
-      },
15829
-      "peerDependenciesMeta": {
15830
-        "react-dom": {
15831
-          "optional": true
15832
-        }
15827
+        "react": ">=16.8"
15833 15828
       }
15834 15829
     },
15835 15830
     "node_modules/react-router-dom": {
15836
-      "version": "7.0.2",
15837
-      "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.0.2.tgz",
15838
-      "integrity": "sha512-VJOQ+CDWFDGaWdrG12Nl+d7yHtLaurNgAQZVgaIy7/Xd+DojgmYLosFfZdGz1wpxmjJIAkAMVTKWcvkx1oggAw==",
15831
+      "version": "6.29.0",
15832
+      "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.29.0.tgz",
15833
+      "integrity": "sha512-pkEbJPATRJ2iotK+wUwHfy0xs2T59YPEN8BQxVCPeBZvK7kfPESRc/nyxzdcxR17hXgUPYx2whMwl+eo9cUdnQ==",
15839 15834
       "license": "MIT",
15840 15835
       "dependencies": {
15841
-        "react-router": "7.0.2"
15836
+        "@remix-run/router": "1.22.0",
15837
+        "react-router": "6.29.0"
15842 15838
       },
15843 15839
       "engines": {
15844
-        "node": ">=20.0.0"
15840
+        "node": ">=14.0.0"
15845 15841
       },
15846 15842
       "peerDependencies": {
15847
-        "react": ">=18",
15848
-        "react-dom": ">=18"
15849
-      }
15850
-    },
15851
-    "node_modules/react-router/node_modules/cookie": {
15852
-      "version": "1.0.2",
15853
-      "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
15854
-      "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==",
15855
-      "license": "MIT",
15856
-      "engines": {
15857
-        "node": ">=18"
15843
+        "react": ">=16.8",
15844
+        "react-dom": ">=16.8"
15858 15845
       }
15859 15846
     },
15860 15847
     "node_modules/react-scripts": {
@@ -16804,12 +16791,6 @@
16804 16791
         "node": ">= 0.8.0"
16805 16792
       }
16806 16793
     },
16807
-    "node_modules/set-cookie-parser": {
16808
-      "version": "2.7.1",
16809
-      "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
16810
-      "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==",
16811
-      "license": "MIT"
16812
-    },
16813 16794
     "node_modules/set-function-length": {
16814 16795
       "version": "1.2.2",
16815 16796
       "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
@@ -18207,12 +18188,6 @@
18207 18188
       "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
18208 18189
       "license": "0BSD"
18209 18190
     },
18210
-    "node_modules/turbo-stream": {
18211
-      "version": "2.4.0",
18212
-      "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.0.tgz",
18213
-      "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==",
18214
-      "license": "ISC"
18215
-    },
18216 18191
     "node_modules/type-check": {
18217 18192
       "version": "0.4.0",
18218 18193
       "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",

+ 2
- 1
package.json View File

@@ -25,7 +25,8 @@
25 25
     "react-material-ui-carousel": "^3.4.2",
26 26
     "react-redux": "^9.2.0",
27 27
     "react-responsive-carousel": "^3.2.23",
28
-    "react-router-dom": "^7.0.2",
28
+    "react-router": "^6.29.0",
29
+    "react-router-dom": "^6.29.0",
29 30
     "react-scripts": "^5.0.1",
30 31
     "shopify-api-node": "^3.14.0",
31 32
     "swiper": "^11.1.4",

+ 2
- 9
src/App.js View File

@@ -59,15 +59,8 @@ function App() {
59 59
         <Routes>
60 60
           <Route path='/' element={<Home />} />
61 61
           <Route path='/login' element={<Login />} />
62
-
63
-          <Route path='products'>
64
-            {/* All Products */}
65
-            <Route index element={<Products />} />
66
-
67
-            {/* Single Product */}
68
-            <Route path=':pid' element={<Product />} />
69
-
70
-          </Route>
62
+          <Route path="products" element={<Products />} />
63
+          <Route path="products/:pid" element={<Product />} />
71 64
           <Route path='/cart' element={<Cart />} />
72 65
           <Route path='/checkout' element={<Checkout />} />
73 66
           <Route path='/delivery_info' element={<DeliveryInfo />} /> 

+ 1
- 1
src/components/CarouselContainer/CarouselContainer.jsx View File

@@ -28,7 +28,7 @@ const CarouselContainer = () => {
28 28
 
29 29
   return (
30 30
 
31
-    <Carousel showStatus={false} autoPlay={true} infiniteLoop={true} interval={3000} showIndicators={false} stopOnHover={false}>
31
+    <Carousel showStatus={false} autoPlay={true} infiniteLoop={true} interval={5000} showIndicators={false} stopOnHover={false}>
32 32
       {items?.map(({ img_src, alt_name }, index) => (
33 33
         <Box
34 34
           key={index}

Loading…
Cancel
Save