From d2f12bb3b3aab7f8ca583ec326668810f24e2853 Mon Sep 17 00:00:00 2001 From: keannu125 Date: Mon, 27 Feb 2023 00:42:31 +0800 Subject: [PATCH] Polished and fixed notes error --- src/Components/Notes/Notes.tsx | 8 ++++++-- src/Routes/Activation/Activation.tsx | 10 ++++++---- src/styles.tsx | 6 ++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/Components/Notes/Notes.tsx b/src/Components/Notes/Notes.tsx index 2117232..630a34a 100644 --- a/src/Components/Notes/Notes.tsx +++ b/src/Components/Notes/Notes.tsx @@ -8,11 +8,15 @@ import { GetNotes } from "../Api/Api"; export default function Notes() { const navigate = useNavigate(); - const { data: notes, isLoading, error } = useQuery("notes", GetNotes); + const { + data: notes, + isLoading, + error, + } = useQuery("notes", GetNotes, { retry: 0 }); if (error) { return (
-

Error contacting Notes server

+

Error contacting Notes server

); } diff --git a/src/Routes/Activation/Activation.tsx b/src/Routes/Activation/Activation.tsx index 02dd175..972baf5 100644 --- a/src/Routes/Activation/Activation.tsx +++ b/src/Routes/Activation/Activation.tsx @@ -1,7 +1,7 @@ import styles from "../../styles"; import Header from "../../Components/Header/Header"; import { useParams } from "react-router-dom"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { UserActivate } from "../../Components/Api/Api"; export interface activation { @@ -19,9 +19,11 @@ export default function Activation() { setStatus(2); } } - if (uid && token) { - verify({ uid, token }); - } + useEffect(() => { + if (uid && token) { + verify({ uid, token }); + } + }, []); if (status === 1) { return (
diff --git a/src/styles.tsx b/src/styles.tsx index 9489746..05d35df 100644 --- a/src/styles.tsx +++ b/src/styles.tsx @@ -134,6 +134,12 @@ const styles: { [key: string]: React.CSSProperties } = { fontWeight: "bold", textAlign: "center", }, + text_medium_red: { + color: "#bc231e", + fontSize: "4vh", + fontWeight: "bold", + textAlign: "center", + }, flex_column: { display: "flex", flexDirection: "column",