Connected DB to events/jobs + more
- Modified handlers.js to be the same as on frm.so - Added --trash-src to shared.css - Modified Event and Job cards to include a trash icon for deleting - Deleting works, it just does not smoothly re-render yet - Adjusted visual bug on Events/Jobs where the contents of the AppWindow would overflow vertically. They now scroll and the title/search bar remain fixed. - Refactored part of People.js into PeopleCard.js
This commit is contained in:
@@ -24,20 +24,10 @@ css(`
|
||||
`)
|
||||
|
||||
class Jobs extends Shadow {
|
||||
jobs = [
|
||||
{
|
||||
id: 1,
|
||||
network_id: 2,
|
||||
creator_id: 1,
|
||||
title: "Austin Chapter Lead",
|
||||
description: "This is the description",
|
||||
salary: 50000.00,
|
||||
company: "Hyperia",
|
||||
location: "1234 location",
|
||||
created: "2026-03-12 13:41:41.0722",
|
||||
updated_at: "2026-03-12 13:41:41.0722"
|
||||
}
|
||||
]
|
||||
constructor() {
|
||||
super()
|
||||
this.jobs = global.currentNetwork.data.jobs;
|
||||
}
|
||||
|
||||
render() {
|
||||
VStack(() => {
|
||||
@@ -55,21 +45,24 @@ class Jobs extends Shadow {
|
||||
|
||||
SearchBar()
|
||||
|
||||
if (this.jobs == "" || this.jobs == []) {
|
||||
LoadingCircle()
|
||||
} else if (this.jobs.length > 0) {
|
||||
for (let i = 0; i < this.jobs.length; i++) {
|
||||
JobCard(this.jobs[i])
|
||||
.borderTop(i == 0 ? "1px solid var(--divider)" : "")
|
||||
VStack(() => {
|
||||
if (this.jobs == "" || this.jobs == []) {
|
||||
LoadingCircle()
|
||||
} else if (this.jobs.length > 0) {
|
||||
for (let i = 0; i < this.jobs.length; i++) {
|
||||
JobCard(this.jobs[i])
|
||||
.borderTop(i == 0 ? "1px solid var(--divider)" : "")
|
||||
}
|
||||
} else {
|
||||
h2("No Jobs")
|
||||
.color("var(--brown)")
|
||||
.fontWeight("bold")
|
||||
.marginTop(7.5, em)
|
||||
.marginBottom(0.5, em)
|
||||
.textAlign("center")
|
||||
}
|
||||
} else {
|
||||
h2("No Jobs")
|
||||
.color("var(--brown)")
|
||||
.fontWeight("bold")
|
||||
.marginTop(7.5, em)
|
||||
.marginBottom(0.5, em)
|
||||
.textAlign("center")
|
||||
}
|
||||
})
|
||||
.overflowY("scroll")
|
||||
})
|
||||
.boxSizing("border-box")
|
||||
.paddingVertical(1, em)
|
||||
@@ -79,7 +72,7 @@ class Jobs extends Shadow {
|
||||
|
||||
async getJobs(networkId) {
|
||||
const fetchedJobs = await server.getJobs(networkId)
|
||||
if (this.checkForUpdates(this.jobs, fetchedJobs)) {
|
||||
if (this.checkForUpdates(this.jobs, fetchedJobs.data)) {
|
||||
this.jobs = fetchedJobs
|
||||
this.rerender()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user