From 42852c9d43e87c41e0b62e6d9b53884c542818a7 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Jan 2022 17:10:45 +0100 Subject: [PATCH] Clean code WIP --- components/CardsLanding.tsx | 14 +++++++------- components/Dashboard.tsx | 4 ++-- components/Landing.tsx | 9 ++++++--- components/MailingList.tsx | 12 ++++++------ components/Nav.tsx | 5 +++-- pages/api/stripe/customer-portal.ts | 6 +++--- utils/AuthContext.tsx | 12 ++++++++---- 7 files changed, 35 insertions(+), 27 deletions(-) diff --git a/components/CardsLanding.tsx b/components/CardsLanding.tsx index 97a7bb6..7de939f 100644 --- a/components/CardsLanding.tsx +++ b/components/CardsLanding.tsx @@ -19,37 +19,37 @@ const CardsLanding = (): JSX.Element => (

diff --git a/components/Dashboard.tsx b/components/Dashboard.tsx index 430be47..479c86a 100644 --- a/components/Dashboard.tsx +++ b/components/Dashboard.tsx @@ -113,7 +113,7 @@ const Dashboard = ({ id="username" type="text" value={username || ''} - onChange={(e) => setUsername(e.target.value)} + onChange={(event) => setUsername(event.target.value)} />
@@ -140,7 +140,7 @@ const Dashboard = ({
- credit card + credit card

Your current plan

{planName}

diff --git a/components/Landing.tsx b/components/Landing.tsx index b0b25f1..50a7a1b 100644 --- a/components/Landing.tsx +++ b/components/Landing.tsx @@ -20,7 +20,7 @@ const Landing = (): JSX.Element => (
Construction of a website (

- screenshot of the website + screenshot of the website
@@ -60,7 +60,10 @@ const Landing = (): JSX.Element => (

- screenshot of the Supabase website + screenshot of the Supabase website
diff --git a/components/MailingList.tsx b/components/MailingList.tsx index b196ee4..318a6f4 100644 --- a/components/MailingList.tsx +++ b/components/MailingList.tsx @@ -14,7 +14,7 @@ const MailingList = (): JSX.Element => { const [loading, setLoading] = useState(false); const [valid, setValid] = useState(true); - const validateEmail = () => { + const validateEmail = (): void => { // Regex patern for email validation const regex = /^(([^\s"(),.:;<>@[\\\]]+(\.[^\s"(),.:;<>@[\\\]]+)*)|(".+"))@((\[(?:\d{1,3}\.){3}\d{1,3}])|(([\dA-Za-z\-]+\.)+[A-Za-z]{2,}))$/; @@ -30,7 +30,7 @@ const MailingList = (): JSX.Element => { } }; - const subscribe = () => { + const subscribe = (): void => { setLoading(true); axios .put('api/mailingList', { @@ -52,7 +52,7 @@ const MailingList = (): JSX.Element => {

Stay Tuned

- Mail + Mail