Polished and fixed notes error

This commit is contained in:
keannu125 2023-02-27 00:42:31 +08:00
parent 1cc9762d08
commit d2f12bb3b3
3 changed files with 18 additions and 6 deletions

View file

@ -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 (
<div style={styles.note}>
<p style={styles.text_medium}>Error contacting Notes server</p>
<p style={styles.text_medium_red}>Error contacting Notes server</p>
</div>
);
}

View file

@ -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);
}
}
useEffect(() => {
if (uid && token) {
verify({ uid, token });
}
}, []);
if (status === 1) {
return (
<div style={styles.background}>

View file

@ -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",