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() {
|
export default function Notes() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { data: notes, isLoading, error } = useQuery("notes", GetNotes);
|
const {
|
||||||
|
data: notes,
|
||||||
|
isLoading,
|
||||||
|
error,
|
||||||
|
} = useQuery("notes", GetNotes, { retry: 0 });
|
||||||
if (error) {
|
if (error) {
|
||||||
return (
|
return (
|
||||||
<div style={styles.note}>
|
<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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import styles from "../../styles";
|
import styles from "../../styles";
|
||||||
import Header from "../../Components/Header/Header";
|
import Header from "../../Components/Header/Header";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { UserActivate } from "../../Components/Api/Api";
|
import { UserActivate } from "../../Components/Api/Api";
|
||||||
|
|
||||||
export interface activation {
|
export interface activation {
|
||||||
|
@ -19,9 +19,11 @@ export default function Activation() {
|
||||||
setStatus(2);
|
setStatus(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (uid && token) {
|
useEffect(() => {
|
||||||
verify({ uid, token });
|
if (uid && token) {
|
||||||
}
|
verify({ uid, token });
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
if (status === 1) {
|
if (status === 1) {
|
||||||
return (
|
return (
|
||||||
<div style={styles.background}>
|
<div style={styles.background}>
|
||||||
|
|
|
@ -134,6 +134,12 @@ const styles: { [key: string]: React.CSSProperties } = {
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
},
|
},
|
||||||
|
text_medium_red: {
|
||||||
|
color: "#bc231e",
|
||||||
|
fontSize: "4vh",
|
||||||
|
fontWeight: "bold",
|
||||||
|
textAlign: "center",
|
||||||
|
},
|
||||||
flex_column: {
|
flex_column: {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
|
|
Loading…
Reference in a new issue