From d664ddc9b84b25922239e3bbc253b35ea54f2533 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> Date: Sun, 3 Jan 2021 05:47:07 +0300 Subject: Fixes Preexisting Linting Issues Fixes all errors, and most warnings generated by eslint. Most were fixed by eslint automatically such as indentation and quotes. Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> --- src/pages/CallbackPage.tsx | 2 +- src/pages/FormPage.tsx | 10 +++++----- src/pages/LandingPage.tsx | 48 +++++++++++++++++++++++----------------------- 3 files changed, 30 insertions(+), 30 deletions(-) (limited to 'src/pages') diff --git a/src/pages/CallbackPage.tsx b/src/pages/CallbackPage.tsx index 691a3e4..fab2086 100644 --- a/src/pages/CallbackPage.tsx +++ b/src/pages/CallbackPage.tsx @@ -2,7 +2,7 @@ import { jsx } from "@emotion/react"; import { useState } from "react"; -export default function CallbackPage() { +export default function CallbackPage(): JSX.Element { const [hasSent, setHasSent] = useState(false); const params = new URLSearchParams(location.search); diff --git a/src/pages/FormPage.tsx b/src/pages/FormPage.tsx index 97ff24d..1805897 100644 --- a/src/pages/FormPage.tsx +++ b/src/pages/FormPage.tsx @@ -12,7 +12,7 @@ interface PathParams { id: string } -function FormPage() { +function FormPage(): JSX.Element { const { id } = useParams(); const [form, setForm] = useState
(); @@ -20,11 +20,11 @@ function FormPage() { useEffect(() => { getForm(id).then(form => { setForm(form); - }) - }) + }); + }); if (!form) { - return + return ; } return
@@ -33,7 +33,7 @@ function FormPage() {

{form.description}

Return home
- + ; } export default FormPage; diff --git a/src/pages/LandingPage.tsx b/src/pages/LandingPage.tsx index 1320c14..124bbcf 100644 --- a/src/pages/LandingPage.tsx +++ b/src/pages/LandingPage.tsx @@ -9,40 +9,40 @@ import { getForms, Form } from "../api/forms"; import OAuth2Button from "../components/OAuth2Button"; import Loading from "../components/Loading"; -function LandingPage() { - const [forms, setForms] = useState(); - - useEffect(() => { - const fetchForms = async () => { - setForms(await getForms()); +function LandingPage(): JSX.Element { + const [forms, setForms] = useState(); + + useEffect(() => { + const fetchForms = async () => { + setForms(await getForms()); + }; + fetchForms(); + }, []); + + if (!forms) { + return ; } - fetchForms(); - }, []); - - if (!forms) { - return ; - } - return
- -
+ return
+ +
-
-

Available Forms

+

Available Forms

- + - {forms.map(form => ( - - ))} -
-
-
+ {forms.map(form => ( + + ))} +
+
+ ; } export default LandingPage; -- cgit v1.2.3