Make dashboard widgets more mobile responsive

This commit is contained in:
Keannu Bernasol 2023-12-03 01:15:05 +08:00
parent 6783b02163
commit fb41277746
2 changed files with 22 additions and 7 deletions

View file

@ -15,8 +15,17 @@ import {
PatchEquipmentType, PatchEquipmentType,
} from "../Types/Types"; } 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({ const instance = axios.create({
baseURL: "http://localhost:8000/", baseURL: backendURL,
}); });
// Token Handling // Token Handling
@ -136,9 +145,11 @@ export function ActivationAPI(activation: ActivationType) {
.post("api/v1/accounts/users/activation/", activation) .post("api/v1/accounts/users/activation/", activation)
.then(() => { .then(() => {
console.log("Activation Success"); console.log("Activation Success");
return true;
}) })
.catch(() => { .catch(() => {
console.log("Activation failed"); console.log("Activation failed");
return false;
}); });
} }
export function ResetPasswordAPI(email: string) { export function ResetPasswordAPI(email: string) {
@ -146,9 +157,11 @@ export function ResetPasswordAPI(email: string) {
.post("api/v1/accounts/users/reset_password/", { email: email }) .post("api/v1/accounts/users/reset_password/", { email: email })
.then(() => { .then(() => {
console.log("Activation Success"); console.log("Activation Success");
return true;
}) })
.catch(() => { .catch(() => {
console.log("Activation failed"); console.log("Activation failed");
return false;
}); });
} }
@ -157,9 +170,11 @@ export function ResetPasswordConfirmAPI(info: ResetPasswordConfirmType) {
.post("api/v1/accounts/users/reset_password_confirm/", info) .post("api/v1/accounts/users/reset_password_confirm/", info)
.then(() => { .then(() => {
console.log("Reset Success"); console.log("Reset Success");
return true;
}) })
.catch(() => { .catch(() => {
console.log("Reset failed"); console.log("Reset failed");
return false;
}); });
} }

View file

@ -87,7 +87,7 @@ export default function Dashboard() {
backgroundColor: "#a6a6a6", backgroundColor: "#a6a6a6",
alignSelf: "center", alignSelf: "center",
justifyContent: "center", justifyContent: "center",
width: "32rem", width: "16rem",
}} }}
> >
<p <p
@ -118,7 +118,7 @@ export default function Dashboard() {
backgroundColor: "#a6a6a6", backgroundColor: "#a6a6a6",
alignSelf: "center", alignSelf: "center",
justifyContent: "center", justifyContent: "center",
width: "32rem", width: "16rem",
}} }}
> >
<p <p
@ -160,7 +160,7 @@ export default function Dashboard() {
backgroundColor: "#a6a6a6", backgroundColor: "#a6a6a6",
alignSelf: "center", alignSelf: "center",
justifyContent: "center", justifyContent: "center",
width: "32rem", width: "16rem",
}} }}
> >
<p <p
@ -195,7 +195,7 @@ export default function Dashboard() {
backgroundColor: "#a6a6a6", backgroundColor: "#a6a6a6",
alignSelf: "center", alignSelf: "center",
justifyContent: "center", justifyContent: "center",
width: "32rem", width: "16rem",
}} }}
> >
<p <p
@ -497,7 +497,7 @@ export default function Dashboard() {
modal modal
position={"top center"} position={"top center"}
contentStyle={{ contentStyle={{
width: "512px", width: "32rem",
borderRadius: 16, borderRadius: 16,
borderColor: "grey", borderColor: "grey",
borderStyle: "solid", borderStyle: "solid",
@ -516,7 +516,7 @@ export default function Dashboard() {
modal modal
position={"top center"} position={"top center"}
contentStyle={{ contentStyle={{
width: "512px", width: "32rem",
borderRadius: 16, borderRadius: 16,
borderColor: "grey", borderColor: "grey",
borderStyle: "solid", borderStyle: "solid",