mirror of
https://github.com/lemeow125/Ivy-Frontend.git
synced 2025-05-14 10:31:07 +08:00
Polished margin of all pages and fixed logout not clearing token
This commit is contained in:
parent
48ed8f45c6
commit
18d9fbe1ef
13 changed files with 169 additions and 16 deletions
58
src/Routes/Activation/Activation.tsx
Normal file
58
src/Routes/Activation/Activation.tsx
Normal file
|
@ -0,0 +1,58 @@
|
|||
import styles from "../../styles";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useEffect, useState } from "react";
|
||||
import { UserActivate } from "../../Components/Api/Api";
|
||||
import { ActivationParams } from "../../Interfaces/Interfaces";
|
||||
|
||||
export default function Activation() {
|
||||
let { uid, token } = useParams();
|
||||
const [status, setStatus] = useState(0);
|
||||
async function verify(activation: ActivationParams) {
|
||||
let status = await UserActivate(activation);
|
||||
if (status) {
|
||||
setStatus(1);
|
||||
} else {
|
||||
setStatus(2);
|
||||
}
|
||||
}
|
||||
useEffect(() => {
|
||||
if (uid && token) {
|
||||
verify({ uid, token });
|
||||
}
|
||||
}, [uid, token]);
|
||||
if (status === 1) {
|
||||
return (
|
||||
<div style={{ ...styles.content_column, ...{ alignItems: "center" } }}>
|
||||
<p style={{ ...styles.text_white, ...styles.text_S }}>User ID: {uid}</p>
|
||||
<p style={{ ...styles.text_white, ...styles.text_S }}>
|
||||
Activation Token: {token}
|
||||
</p>
|
||||
<p style={{ ...styles.text_green, ...styles.text_S }}>
|
||||
Activation Successful. Please login
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (status === 2) {
|
||||
return (
|
||||
<div style={{ ...styles.content_column, ...{ alignItems: "center" } }}>
|
||||
<p style={{ ...styles.text_white, ...styles.text_S }}>User ID: {uid}</p>
|
||||
<p style={{ ...styles.text_white, ...styles.text_S }}>
|
||||
Activation Token: {token}
|
||||
</p>
|
||||
<p style={{ ...styles.text_red, ...styles.text_S }}>
|
||||
Invalid Activation Link
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div style={{ ...styles.content_column, ...{ alignItems: "center" } }}>
|
||||
<p style={{ ...styles.text_white, ...styles.text_S }}>User ID: {uid}</p>
|
||||
<p style={{ ...styles.text_white, ...styles.text_S }}>
|
||||
Activation Token: {token}
|
||||
</p>
|
||||
<p style={{ ...styles.text_white, ...styles.text_S }}>Activating...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -11,7 +11,7 @@ import RecentlyAddedIcon from "../../Components/Icons/RecentlyAddedIcon/Recently
|
|||
|
||||
export default function Dashboard() {
|
||||
return (
|
||||
<div style={{ margin: 32, height: "100%" }}>
|
||||
<div>
|
||||
<div style={styles.flex_row}>
|
||||
<HomeIcon size={64} color="white" />
|
||||
<h1 style={{ ...styles.text_white, ...styles.text_XL }}>Dashboard</h1>
|
||||
|
|
|
@ -19,7 +19,7 @@ export default function Login() {
|
|||
});
|
||||
const [error, setError] = useState("");
|
||||
return (
|
||||
<div style={{ margin: 32, height: "100%" }}>
|
||||
<div>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
|
|
|
@ -13,7 +13,7 @@ import { SampleLogData } from "../../Components/SampleData/SampleData";
|
|||
|
||||
export default function Logs() {
|
||||
return (
|
||||
<div style={{ margin: 32, height: "100%" }}>
|
||||
<div>
|
||||
<div style={styles.flex_row}>
|
||||
<LogsIcon size={64} color="white" />
|
||||
<h1 style={{ ...styles.text_white, ...styles.text_XL }}>Logs</h1>
|
||||
|
|
|
@ -6,7 +6,7 @@ import { useParams } from "react-router-dom";
|
|||
export default function Product() {
|
||||
let { id } = useParams();
|
||||
return (
|
||||
<div style={{ margin: 32, height: "100%" }}>
|
||||
<div>
|
||||
<h1 style={{ ...styles.text_white, ...styles.text_XL }}>
|
||||
Individual Product View for id {id}
|
||||
</h1>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState } from "react";
|
||||
import React from "react";
|
||||
import styles from "../../styles";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import ProductsIcon from "../../Components/Icons/ProductsIcon/ProductsIcon";
|
||||
|
@ -10,7 +10,7 @@ import ViewManager from "../../Components/ProductsPage/ViewManager";
|
|||
export default function Products() {
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
<div style={{ margin: 32, height: "100%" }}>
|
||||
<div>
|
||||
<div style={styles.content_row}>
|
||||
<div style={{ ...styles.content_row, ...{ flex: 1 } }}>
|
||||
<div style={{ display: "flex", alignItems: "center", gap: 16 }}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue