mirror of
https://github.com/lemeow125/React-NotesApp.git
synced 2024-11-17 06:29:28 +08:00
Polished and fixed notes error
This commit is contained in:
parent
1cc9762d08
commit
d2f12bb3b3
3 changed files with 18 additions and 6 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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}>
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue