From 25ee71d0a9a01d26d11a656f5ddae55760ee555c Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Thu, 27 Jan 2022 13:14:12 +0000 Subject: [PATCH] remove redundant pages --- components/newappeal.js | 34 ------- pages/newappeal/planningappeal.js | 35 -------- pages/newappeal/selectappeal.js | 142 ------------------------------ 3 files changed, 211 deletions(-) delete mode 100644 components/newappeal.js delete mode 100644 pages/newappeal/planningappeal.js delete mode 100644 pages/newappeal/selectappeal.js diff --git a/components/newappeal.js b/components/newappeal.js deleted file mode 100644 index 48befd90..00000000 --- a/components/newappeal.js +++ /dev/null @@ -1,34 +0,0 @@ -import Link from "next/link"; -import { useRouter } from "next/router"; -import { useContext } from "react"; -import useTranslation from "next-translate/useTranslation"; -import PlanningAppeal from "./newappeal/planningappeal"; -import EnforcementNotice from "./newappeal/enforcementnotice"; -import LDC from "./newappeal/ldc"; -import AdvertApplication from "./newappeal/advertapplication"; - -export default function NewAppeal({ children, pages }) { - let { t } = useTranslation(); - - const router = useRouter(); - const { locale } = router; - - return ( -
-
-
-
- - - - -
-
-
-
- ); -} diff --git a/pages/newappeal/planningappeal.js b/pages/newappeal/planningappeal.js deleted file mode 100644 index 773cd811..00000000 --- a/pages/newappeal/planningappeal.js +++ /dev/null @@ -1,35 +0,0 @@ -import useTranslation from "next-translate/useTranslation"; -import Head from "next/head"; -import { useRouter } from "next/router"; -import CookieBanner from "../../components/cookieBanner"; -import Footer from "../../components/footer"; -import Header from "../../components/header"; -import NewAppeal from "../../components/newappeal"; - -const Home = (props) => { - const { footerLinks, pages } = props; - let { t, lang } = useTranslation(); - - const router = useRouter(); - const { locale } = router; - - return ( -
- - - {t("myportal:page-title")} - {t("common:service-name")} - - -
- -
-
- -
-
-
-
- ); -}; - -export default Home; //connect(mapStateToProps)(Home); diff --git a/pages/newappeal/selectappeal.js b/pages/newappeal/selectappeal.js deleted file mode 100644 index 37754f47..00000000 --- a/pages/newappeal/selectappeal.js +++ /dev/null @@ -1,142 +0,0 @@ -import useTranslation from "next-translate/useTranslation"; -import Head from "next/head"; -import { useRouter } from "next/router"; -import { useState } from "react"; -import { connect } from "react-redux"; -import { getAppealsTypes } from "../../actions"; -import Breadcrumbs from "../../components/breadcrumbs"; -import CookieBanner from "../../components/cookieBanner"; -import Footer from "../../components/footer"; -import Header from "../../components/header"; -import { - setAppealType, - setAppealTypeID, - setAppealTypeTitle, -} from "../../store/appealType/action"; -import { wrapper } from "../../store/store"; - -const Home = (props) => { - const { footerLinks, pages, formData } = props; - let { t, lang } = useTranslation(); - - const router = useRouter(); - const { locale } = router; - const { appealtypes } = router.query; - - const { appealType } = props; - - const optionsObj = props.appealType.appealTypeOptions.GlobalOptionSet - .Options || [{}]; - - const appealOptions = Object.keys(optionsObj).map((key, index) => ( - - )); - - const [appealTypeSelect, setAppealTypeSelect] = useState(""); - const handleParam = (setValue) => (e) => setValue(e.target.value); - - const selectAppealType = (event) => { - event.preventDefault(); - router.replace("/newappeal/" + props.appealType.appealTypeID, null, { - shallow: true, - }); - }; - - return ( -
- - - {t("search:page-title")} - {t("common:service-name")} - - -
- -
-
-
-
-
- - -

New Appeal

- -
-
- - -
- -
-
-
-
-
-
-
- ); -}; - -export const getServerSideProps = wrapper.getServerSideProps( - (store) => - async ({ query, req, res }) => { - const appealTypeData = await getAppealsTypes(); - console.log("appeal types", appealTypeData); - store.dispatch(setAppealType(appealTypeData)); - } -); - -const mapStateToProps = (state) => { - return { - search: state.search, - searchResultsObj: state.searchResultsObj, - formData: state.formData, - appealType: state.appealType, - }; -}; - -const mapDispatchToProps = (dispatch) => { - return { - onChangeSelect: (event) => { - dispatch( - setAppealTypeTitle( - event.target.options[event.target.selectedIndex].text - ) - ); - dispatch(setAppealTypeID(event.target.value)); - }, - }; -}; - -export default connect(mapStateToProps, mapDispatchToProps)(Home);