Skip to content

Instantly share code, notes, and snippets.

@rastaman
Last active April 9, 2023 02:56
Show Gist options
  • Save rastaman/3fe714f4f4977acd9c23d4f082def860 to your computer and use it in GitHub Desktop.
Save rastaman/3fe714f4f4977acd9c23d4f082def860 to your computer and use it in GitHub Desktop.
diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index fc5047e..0000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "env": {
- "browser": true,
- "es2021": true
- },
- "extends": ["plugin:react/recommended", "airbnb", "prettier"],
- "parserOptions": {
- "ecmaFeatures": {
- "jsx": true
- },
- "ecmaVersion": 12,
- "sourceType": "module"
- },
- "plugins": ["react", "prettier"],
- "rules": {
- "prettier/prettier": [
- "error",
- {
- "endOfLine": "auto"
- }
- ],
- "react/react-in-jsx-scope": "off",
- "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
- "react/jsx-props-no-spreading": [
- 1,
- {
- "custom": "ignore"
- }
- ],
- "react/jsx-curly-spacing": [2, "never"]
- },
- "settings": { "import/resolver": { "node": { "paths": ["src"] } } }
-}
diff --git a/package.json b/package.json
index 3be496a..577cc92 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
"react-dom": "17.0.2",
"react-flatpickr": "3.10.7",
"react-router-dom": "6.0.2",
- "react-scripts": "4.0.3",
+ "react-scripts": "5.0.1",
"react-syntax-highlighter": "15.4.5",
"rellax": "1.12.1",
"swiper": "7.3.4",
@@ -49,7 +49,7 @@
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
- "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start"
+ "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install --legacy-peer-deps && npm start"
},
"eslintConfig": {
"extends": [
diff --git a/src/components/MKPagination/index.js b/src/components/MKPagination/index.js
index 6901081..c8e69d0 100644
--- a/src/components/MKPagination/index.js
+++ b/src/components/MKPagination/index.js
@@ -29,7 +29,10 @@ const Context = createContext();
const MKPagination = forwardRef(
({ item, variant, color, size, active, children, placement, ...rest }, ref) => {
- const context = item ? useContext(Context) : null;
+ let context = useContext(Context);
+ if (item == null) {
+ context = null;
+ }
const paginationSize = context ? context.size : null;
let placementValue = "flex-end";
diff --git a/src/layouts/sections/page-sections/testimonials/components/TestimonialsTwo/code.js b/src/layouts/sections/page-sections/testimonials/components/TestimonialsTwo/code.js
index ac104e8..6820e7f 100644
--- a/src/layouts/sections/page-sections/testimonials/components/TestimonialsTwo/code.js
+++ b/src/layouts/sections/page-sections/testimonials/components/TestimonialsTwo/code.js
@@ -4,11 +4,11 @@ const testimonialsTwoCode = `import { useRef } from "react";
import SwiperCore, { Autoplay, Navigation } from "swiper";
// SwiperJS react components
-import { Swiper, SwiperSlide } from "swiper/react/swiper-react";
+import { Swiper, SwiperSlide } from 'swiper/react';
// SwiperJS styles
-import "swiper/swiper.min.css";
-import "swiper/modules/navigation/navigation.min.css";
+import 'swiper/css';
+import 'swiper/css/navigation';
// @mui material components
import Container from "@mui/material/Container";
diff --git a/src/layouts/sections/page-sections/testimonials/components/TestimonialsTwo/index.js b/src/layouts/sections/page-sections/testimonials/components/TestimonialsTwo/index.js
index 851722b..cd22048 100644
--- a/src/layouts/sections/page-sections/testimonials/components/TestimonialsTwo/index.js
+++ b/src/layouts/sections/page-sections/testimonials/components/TestimonialsTwo/index.js
@@ -19,11 +19,11 @@ import { useRef } from "react";
import SwiperCore, { Autoplay, Navigation } from "swiper";
// SwiperJS react components
-import { Swiper, SwiperSlide } from "swiper/react/swiper-react";
+import { Swiper, SwiperSlide } from 'swiper/react';
// SwiperJS styles
-import "swiper/swiper.min.css";
-import "swiper/modules/navigation/navigation.min.css";
+import 'swiper/css';
+import 'swiper/css/navigation';
// @mui material components
import Container from "@mui/material/Container";
diff --git a/src/pages/Blogs/SingleArticle/sections/Steps.js b/src/pages/Blogs/SingleArticle/sections/Steps.js
index 583c985..d115647 100644
--- a/src/pages/Blogs/SingleArticle/sections/Steps.js
+++ b/src/pages/Blogs/SingleArticle/sections/Steps.js
@@ -19,11 +19,11 @@ import { useRef, useState } from "react";
import SwiperCore, { Autoplay, Navigation } from "swiper";
// SwiperJS react components
-import { Swiper, SwiperSlide } from "swiper/react/swiper-react";
+import { Swiper, SwiperSlide } from 'swiper/react';
// SwiperJS styles
-import "swiper/swiper.min.css";
-import "swiper/modules/navigation/navigation.min.css";
+import 'swiper/css';
+import 'swiper/css/navigation';
// @mui material components
import Container from "@mui/material/Container";
@@ -31,7 +31,7 @@ import Grid from "@mui/material/Grid";
// Material Kit 2 PRO React components
import MKBox from "components/MKBox";
-import MKTypography from "components/MKTypography";
+import MKTypography from "components/MKTypography";
function Steps() {
// install SwiperJS modules
diff --git a/src/pages/Company/Pricing/sections/Header.js b/src/pages/Company/Pricing/sections/Header.js
index e9579ce..50586d8 100644
--- a/src/pages/Company/Pricing/sections/Header.js
+++ b/src/pages/Company/Pricing/sections/Header.js
@@ -17,11 +17,11 @@ Coded by www.creative-tim.com
import SwiperCore, { Autoplay, Navigation } from "swiper";
// SwiperJS react components
-import { Swiper, SwiperSlide } from "swiper/react/swiper-react";
+import { Swiper, SwiperSlide } from 'swiper/react';
// SwiperJS styles
-import "swiper/swiper.min.css";
-import "swiper/modules/navigation/navigation.min.css";
+import 'swiper/css';
+import 'swiper/css/navigation';
// Pricing page components
import SliderHeader from "pages/Company/Pricing/components/Header";
diff --git a/src/pages/Company/Pricing/sections/Testimonials.js b/src/pages/Company/Pricing/sections/Testimonials.js
index 2985681..0fdd75c 100644
--- a/src/pages/Company/Pricing/sections/Testimonials.js
+++ b/src/pages/Company/Pricing/sections/Testimonials.js
@@ -19,11 +19,11 @@ import { useRef } from "react";
import SwiperCore, { Autoplay, Navigation } from "swiper";
// SwiperJS react components
-import { Swiper, SwiperSlide } from "swiper/react/swiper-react";
+import { Swiper, SwiperSlide } from 'swiper/react';
// SwiperJS styles
-import "swiper/swiper.min.css";
-import "swiper/modules/navigation/navigation.min.css";
+import 'swiper/css';
+import 'swiper/css/navigation';
// @mui material components
import Container from "@mui/material/Container";
@eleventhaus
Copy link

If you're applying this patch to the 2.0.0 version of the template, make sure to use the ignore-space-change and ignore-whitespace flags when using the git apply command

git apply --ignore-space-change --ignore-whitespace npm1_18_react_script5_swiper.patch.patch

Otherwise you'll get error

error: patch failed: package.json:36
error: package.json: patch does not apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment