mirror of
https://github.com/lemeow125/Borrowing-TrackerFrontend.git
synced 2025-09-16 20:49:36 +08:00
Merge branch 'master' of https://git.keannu1.duckdns.org/keannu125/Borrowing-TrackerFrontend into feature/additional_styles
This commit is contained in:
commit
94d41b3194
11 changed files with 262 additions and 200 deletions
|
@ -27,7 +27,7 @@ const debug = false;
|
|||
let backendURL;
|
||||
|
||||
if (debug) {
|
||||
backendURL = "http://localhost:8000/";
|
||||
backendURL = "http://localhost:8092/";
|
||||
} else {
|
||||
backendURL = "https://csm-backend.keannu1.duckdns.org/";
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import {
|
|||
UserAPI,
|
||||
TransactionsAPI,
|
||||
} from "../../API/API";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import moment from "moment";
|
||||
|
||||
export default function TechnicianWidgets() {
|
||||
|
@ -34,22 +33,6 @@ export default function TechnicianWidgets() {
|
|||
},
|
||||
],
|
||||
});
|
||||
const isLoading = queries.some((result) => result.isLoading);
|
||||
if (isLoading) {
|
||||
return (
|
||||
<>
|
||||
<CircularProgress style={{ height: "128px", width: "128px" }} />
|
||||
<p
|
||||
style={{
|
||||
...styles.text_dark,
|
||||
...styles.text_L,
|
||||
}}
|
||||
>
|
||||
Loading
|
||||
</p>
|
||||
</>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div style={styles.flex_column}>
|
||||
<div
|
||||
|
@ -92,7 +75,7 @@ export default function TechnicianWidgets() {
|
|||
>
|
||||
{queries[1].data?.filter(
|
||||
(equipment) => equipment.status == "Pending"
|
||||
).length || 0}
|
||||
).length || "Loading..."}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
|
@ -123,7 +106,7 @@ export default function TechnicianWidgets() {
|
|||
...styles.text_L,
|
||||
}}
|
||||
>
|
||||
{queries[1].data?.length || 0}
|
||||
{queries[1].data?.length || "Loading..."}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -167,7 +150,7 @@ export default function TechnicianWidgets() {
|
|||
>
|
||||
{queries[1].data?.filter(
|
||||
(equipment) => equipment.status == "Available"
|
||||
).length || 0}
|
||||
).length || "Loading..."}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
|
@ -200,7 +183,7 @@ export default function TechnicianWidgets() {
|
|||
>
|
||||
{queries[1].data?.filter(
|
||||
(equipment) => equipment.status == "Broken"
|
||||
).length || 0}
|
||||
).length || "Loading..."}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -247,7 +230,7 @@ export default function TechnicianWidgets() {
|
|||
todayStartOfDay,
|
||||
todayEndOfDay
|
||||
)
|
||||
).length || 0}
|
||||
).length || "Loading..."}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
|
@ -283,7 +266,7 @@ export default function TechnicianWidgets() {
|
|||
thisMonthStart,
|
||||
thisMonthEnd
|
||||
)
|
||||
).length || 0}
|
||||
).length || "Loading..."}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -72,20 +72,6 @@ export default function TransactionReportPDF(props: props) {
|
|||
).length
|
||||
}
|
||||
</Text>
|
||||
<Text
|
||||
style={{
|
||||
color: colors.font_dark,
|
||||
fontSize: 16,
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
Rejected Transactions:{" "}
|
||||
{
|
||||
transactions_today.filter(
|
||||
(transaction) => transaction.transaction_status == "Rejected"
|
||||
).length
|
||||
}
|
||||
</Text>
|
||||
<Text
|
||||
style={{
|
||||
color: colors.font_dark,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue