diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..201f3e1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +name: CI/CD check + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + +defaults: + run: + working-directory: portal + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run eslint test + run: yarn lint + + - name: Build + run: yarn build 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{" "} +