diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e16d433b..5877a5fc 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -4,8 +4,14 @@ module.exports = { es2021: true, node: true, }, - extends: "airbnb", - plugins: ["prettier"], + extends: [ + "airbnb", + "airbnb/hooks", + "eslint:recommended", + // "plugin:prettier/recommended", + "plugin:react/recommended", + ], + plugins: ["react", "prettier"], overrides: [ { env: { @@ -24,8 +30,30 @@ module.exports = { rules: { semi: 0, "comma-dangle": 0, - "prettier/prettier": "error", "react/jsx-filename-extension": [1, { extensions: [".js", ".jsx"] }], quotes: ["error", "double"], + "linebreak-style": ["error", "unix"], + "no-console": "error", + "react/react-in-jsx-scope": 0, + "import/order": [ + "error", + { + groups: [ + "builtin", + "external", + "internal", + "parent", + "sibling", + "index", + ], + alphabetize: { order: "asc", caseInsensitive: true }, + }, + ], + "prettier/prettier": [ + "error", + { + endOfLine: "auto", + }, + ], }, }; diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 00000000..f8b48885 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/SYT-Web-Redesign/FileContentIndex/7875359b-7b73-4b72-9718-0b7b3c711662.vsidx b/.vs/SYT-Web-Redesign/FileContentIndex/7875359b-7b73-4b72-9718-0b7b3c711662.vsidx new file mode 100644 index 00000000..cad8ff7f Binary files /dev/null and b/.vs/SYT-Web-Redesign/FileContentIndex/7875359b-7b73-4b72-9718-0b7b3c711662.vsidx differ diff --git a/.vs/SYT-Web-Redesign/v17/.wsuo b/.vs/SYT-Web-Redesign/v17/.wsuo new file mode 100644 index 00000000..2d707b7c Binary files /dev/null and b/.vs/SYT-Web-Redesign/v17/.wsuo differ diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 00000000..6b611411 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,6 @@ +{ + "ExpandedNodes": [ + "" + ], + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 00000000..5a258830 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/package.json b/package.json index 9439c340..02ed4264 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "start": "react-scripts start", "test": "react-scripts test", "eject": "react-scripts eject", - "pretty": "prettier --write ." + "pretty": "prettier --write .", + "knip": "knip" }, "dependencies": { "@emailjs/browser": "^3.11.0", @@ -32,7 +33,6 @@ "react-fast-marquee": "^1.6.2", "react-hook-form": "^7.48.2", "react-photo-album": "^2.3.0", - "react-query": "^3.39.3", "react-router-dom": "^6.11.2", "react-simple-wysiwyg": "^2.2.5", "tailwind-scrollbar-hide": "^1.1.7", @@ -51,13 +51,12 @@ "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.3.4", "husky": "^8.0.0", - "lint-staged": "^13.2.2", + "knip": "^4.3.1", "postcss": "^8.4.23", "prettier": "^2.8.8", "tailwindcss": "^3.3.2", - "vite": "^4.3.2" + "vite": "^4.5.1" }, "lint-staged": { "**/*.{js,jsx}": [ diff --git a/src/ADMIN/index.js b/src/ADMIN/index.js deleted file mode 100644 index d3724d52..00000000 --- a/src/ADMIN/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import AllBlogsPage from "./pages/blogs/AllBlogsPage"; -import AddChapterPage from "./pages/chapters/AddChapterPage"; -import AllChaptersPage from "./pages/chapters/AllChaptersPage"; -import AddEventPage from "./pages/events/AddEventPage"; -import AllEventsPage from "./pages/events/AllEventsPage"; -import UpdateEventPage from "./pages/events/UpdateEventPage"; -import AdminLayout from "./components/AdminLayout"; - -export { - AddChapterPage, - AddEventPage, - AllBlogsPage, - AllChaptersPage, - AllEventsPage, - UpdateEventPage, - AdminLayout, -}; diff --git a/src/ADMIN/pages/chapters/AddChapterPage.jsx b/src/ADMIN/pages/chapters/AddChapterPage.jsx deleted file mode 100644 index 8c614818..00000000 --- a/src/ADMIN/pages/chapters/AddChapterPage.jsx +++ /dev/null @@ -1,164 +0,0 @@ -import * as React from "react"; -import { useNavigate } from "react-router-dom"; -import StepIndicator from "../../components/StepIndicator"; -import AddChapterForm from "../../components/AddChapterForm"; -import usePostAddChapter from "../../../hooks/Queries/chapter/usePostAddChapter"; - -function AddChapterPage() { - const { - setChapterData: postChapter, - error: errorPostChapter, - clearError: clearErrorPostChapter, - status: statusPostChapter, - clearStatus: clearStatusPostChapter - } = usePostAddChapter(); - - const [ collectedChapter, setCollectedChapter ] = React.useState(null); - - const initialSteps = [ - { section: "01", title: "GENERAL INFO", status: "active" }, - { section: "02", title: "SOCIAL MEDIA LINKS", status: "inactive" }, - { section: "03", title: "ORGANIZERS", status: "inactive" }, - ]; - - const [steps, setSteps] = React.useState(initialSteps); - - const [currentStep, setCurrentStep] = React.useState(0); - const navigate = useNavigate(); - - const handleNextStep = () => { - if (currentStep < steps.length - 1) { - const updatedSteps = [...steps]; - updatedSteps[currentStep].status = "completed"; - updatedSteps[currentStep + 1].status = "active"; - setSteps(updatedSteps); - setCurrentStep(currentStep + 1); - } - }; - - const handlePreviousStep = () => { - if (currentStep > 0) { - const updatedSteps = [...steps]; - updatedSteps[currentStep].status = "inactive"; - updatedSteps[currentStep - 1].status = "inactive"; - setSteps(updatedSteps); - setCurrentStep(currentStep - 1); - } - }; - - const formComplete = (completeChapterData) => { - statusPostChapter === 'error' && clearStatusPostChapter(); - errorPostChapter && clearErrorPostChapter(); - postChapter({...completeChapterData}); - } - - React.useEffect(() => { - if (statusPostChapter === 'success') { - setSteps(initialSteps); - setCurrentStep(0); - setCollectedChapter(null); - } - }, [statusPostChapter]); - - return ( -
- Chapters -
-- New Chapter -
- {/* Success Display */} - {statusPostChapter==="success" && -- Add Chapter Details -
-