From fb41277746dc806d9d3cf76c0cfabcc0359c344d Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 3 Dec 2023 01:15:05 +0800 Subject: [PATCH] Make dashboard widgets more mobile responsive --- src/Components/API/API.tsx | 17 ++++++++++++++++- src/Pages/DashboardPage/DashboardPage.tsx | 12 ++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/Components/API/API.tsx b/src/Components/API/API.tsx index e9ff3b1..3279505 100644 --- a/src/Components/API/API.tsx +++ b/src/Components/API/API.tsx @@ -15,8 +15,17 @@ import { PatchEquipmentType, } from "../Types/Types"; +const debug = false; +let backendURL; + +if (debug) { + backendURL = "http://localhost:8000/"; +} else { + backendURL = "https://equipment-tracker-backend.keannu1.duckdns.org/"; +} + const instance = axios.create({ - baseURL: "http://localhost:8000/", + baseURL: backendURL, }); // Token Handling @@ -136,9 +145,11 @@ export function ActivationAPI(activation: ActivationType) { .post("api/v1/accounts/users/activation/", activation) .then(() => { console.log("Activation Success"); + return true; }) .catch(() => { console.log("Activation failed"); + return false; }); } export function ResetPasswordAPI(email: string) { @@ -146,9 +157,11 @@ export function ResetPasswordAPI(email: string) { .post("api/v1/accounts/users/reset_password/", { email: email }) .then(() => { console.log("Activation Success"); + return true; }) .catch(() => { console.log("Activation failed"); + return false; }); } @@ -157,9 +170,11 @@ export function ResetPasswordConfirmAPI(info: ResetPasswordConfirmType) { .post("api/v1/accounts/users/reset_password_confirm/", info) .then(() => { console.log("Reset Success"); + return true; }) .catch(() => { console.log("Reset failed"); + return false; }); } diff --git a/src/Pages/DashboardPage/DashboardPage.tsx b/src/Pages/DashboardPage/DashboardPage.tsx index d495439..62e3df3 100644 --- a/src/Pages/DashboardPage/DashboardPage.tsx +++ b/src/Pages/DashboardPage/DashboardPage.tsx @@ -87,7 +87,7 @@ export default function Dashboard() { backgroundColor: "#a6a6a6", alignSelf: "center", justifyContent: "center", - width: "32rem", + width: "16rem", }} >