From c08ca4df166adf5c4c2eac4a683eae332a6517b3 Mon Sep 17 00:00:00 2001 From: snehar-nd Date: Tue, 17 May 2022 11:05:00 +0530 Subject: [PATCH 1/3] fix: Added prettier package, eslint, and aribnb guide Signed-off-by: snehar-nd --- portal/.eslintrc.json | 23 + portal/components/config.js | 72 +- portal/components/layout.js | 13 +- portal/components/login/login.js | 29 +- portal/components/react-admin/app.js | 13 +- .../react-admin/base/components/BackButton.js | 5 + .../base/components/EditNoDeleteToolbar.js | 11 +- .../candidateProfile/candidate-profile.js | 48 +- .../candidateProfile/candidate-show.js | 312 +- .../base/resources/candidateProfile/index.js | 9 +- .../base/resources/donate-device.js | 29 +- .../base/resources/recruiterData/Recruiter.js | 61 +- .../base/resources/request-device.js | 18 +- .../react-admin/customHasura/customFields.js | 4 +- .../components/react-admin/layout/config.js | 13 +- .../react-admin/layout/customBreadcrumbs.js | 70 +- .../react-admin/layout/customSidebar.js | 13 +- .../react-admin/layout/customUserMenu.js | 11 +- portal/components/react-admin/layout/index.js | 10 + .../react-admin/layout/verticalCollapse.js | 8 + .../react-admin/layout/verticalItem.js | 15 +- portal/components/track/track.js | 2 +- portal/package-lock.json | 5916 ----------------- portal/package.json | 14 +- portal/pages/_app.js | 11 +- portal/pages/_document.js | 1 + portal/pages/admin.js | 1 + portal/pages/api/graphql.js | 5 +- portal/pages/api/track.js | 2 +- portal/pages/index.js | 16 +- portal/pages/login.js | 17 +- portal/pages/school.js | 1 + portal/pages/track.js | 3 +- portal/styles/Home.module.css | 2 +- portal/yarn.lock | 4623 +++++++++++++ 35 files changed, 5139 insertions(+), 6262 deletions(-) create mode 100644 portal/.eslintrc.json delete mode 100644 portal/package-lock.json create mode 100644 portal/yarn.lock diff --git a/portal/.eslintrc.json b/portal/.eslintrc.json new file mode 100644 index 0000000..91208d0 --- /dev/null +++ b/portal/.eslintrc.json @@ -0,0 +1,23 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true + }, + "extends": ["plugin:react/recommended"], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 12, + "sourceType": "module" + }, + "plugins": ["react"], + "rules": { + "react/no-unescaped-entities": ["error", { "forbid": [">", "}"] }], + "prefer-destructuring": ["error", { "object": true, "array": false }] + }, + "globals": { + "window": true + } +} diff --git a/portal/components/config.js b/portal/components/config.js index acc991a..043ab25 100644 --- a/portal/components/config.js +++ b/portal/components/config.js @@ -19,41 +19,41 @@ const resourceConfig = { ], homepageCards: [ { - // title: { - // en: "Donate your smartphone", - // hi: "अपना स्मार्टफ़ोन दान करें", - // }, - // target: "/donate", - // icon: "volunteer_activism", - // colour: "primary", - // },{ - // title: { - // en: "Donate a Smartphone as an Individual Donor", - // hi: "व्यक्तिगत दाता", - // }, - // target: process.env.NEXT_PUBLIC_DONATE_DEVICE_INDIV_FORM_URL, - // icon: "volunteer_activism", - // colour: "primary", - // }, - // { - // title: { - // en: "Donate a smartphone as a Corporate Donor", - // hi: "कॉर्पोरेट दाता", - // }, - // target: process.env.NEXT_PUBLIC_DONATE_DEVICE_CORP_FORM_URL, - // icon: "corporate_fare", - // colour: "primary", - // }, - // { - // title: { - // en: "Frequently Asked Questions", - // hi: "जानकारी", - // }, - // target: process.env.NEXT_PUBLIC_FAQ_DOCUMENT_URL, - // icon: "quiz", - // colour: "primary", - // }, - // { + // title: { + // en: "Donate your smartphone", + // hi: "अपना स्मार्टफ़ोन दान करें", + // }, + // target: "/donate", + // icon: "volunteer_activism", + // colour: "primary", + // },{ + // title: { + // en: "Donate a Smartphone as an Individual Donor", + // hi: "व्यक्तिगत दाता", + // }, + // target: process.env.NEXT_PUBLIC_DONATE_DEVICE_INDIV_FORM_URL, + // icon: "volunteer_activism", + // colour: "primary", + // }, + // { + // title: { + // en: "Donate a smartphone as a Corporate Donor", + // hi: "कॉर्पोरेट दाता", + // }, + // target: process.env.NEXT_PUBLIC_DONATE_DEVICE_CORP_FORM_URL, + // icon: "corporate_fare", + // colour: "primary", + // }, + // { + // title: { + // en: "Frequently Asked Questions", + // hi: "जानकारी", + // }, + // target: process.env.NEXT_PUBLIC_FAQ_DOCUMENT_URL, + // icon: "quiz", + // colour: "primary", + // }, + // { title: { en: "Login for state officials", hi: "राज्य के अधिकारियों के लिए लॉग इन", @@ -115,7 +115,7 @@ const resourceConfig = { statusChoices: [ { id: "no-action-taken", - name: "Donation in Progress",//No Action Taken + name: "Donation in Progress", //No Action Taken icon: "warning", style: "error", }, diff --git a/portal/components/layout.js b/portal/components/layout.js index 6e59c2f..c508366 100644 --- a/portal/components/layout.js +++ b/portal/components/layout.js @@ -1,9 +1,10 @@ import Head from "next/head"; import Image from "next/image"; -import { useState, useEffect } from "react"; +import React, { useState, useEffect } from "react"; import styles from "../styles/layout.module.css"; +import PropTypes from "prop-types"; -const Layout = ({ children, home }) => { +const Layout = ({ children }) => { const transitionStages = { FADE_OUT: "fadeOut", FADE_IN: "fadeIn", @@ -56,7 +57,9 @@ const Layout = ({ children, home }) => { > {activeChildren} - For more details, contact 1800-180-8190 + + For more details, contact 1800-180-8190{" "} +