Start2Panic
WWasp-lang
•Created by Start2Panic on 5/17/2024 in #đŸ™‹questions
white screen, how to debug?
Just to be sure I recreated the issue. When having the const jobs hook before the export I get an all white page:
The browser console hints the error:
14 replies
WWasp-lang
•Created by Start2Panic on 5/14/2024 in #đŸ™‹questions
Context entities in a query
Thanks all for the advice.
After some hours of đŸ¤” I finally found that my query was missing the void part...
13 replies
WWasp-lang
•Created by Start2Panic on 5/17/2024 in #đŸ™‹questions
white screen, how to debug?
I had a const outside the export function đŸ¤«
14 replies
WWasp-lang
•Created by Start2Panic on 5/17/2024 in #đŸ™‹questions
white screen, how to debug?
Found it via Development Tools Console Log!
14 replies
WWasp-lang
•Created by Start2Panic on 5/14/2024 in #đŸ™‹questions
Context entities in a query
Hey @kapa.ai ,
These are my JobsView and JobsList, how do I pass the user data to the JobsView from the JobsList?
const JobsView = ({ job }: { job: Job }) => {
var formattedCreatedAt = job.createdAt.toISOString(); // Example format: "2024-05-10T09:55:24.000Z"
var Urgent = job.isUrgent ? 'Yes' : 'No'; var Status = job.isDone ? 'Done' : 'Open'; return ( <tr className={Urgent === 'Yes' ? 'border-b border-red-200 bg-red-100' : 'text-neutral-800 border-b dark:border-neutral-500'}> <td className="whitespace-nowrap px-6 py-4 font-medium">{job.id}</td> <td className="whitespace-nowrap px-6 py-4">{job.description}</td> <td className="whitespace-nowrap px-6 py-4">{formattedCreatedAt}</td> <td className="whitespace-nowrap px-6 py-4">{job.userId}</td> <td className="whitespace-nowrap px-6 py-4">{Status}</td> <td className={Urgent === 'Yes' ? 'bg-red-500 whitespace-nowrap px-6 py-4"' : 'whitespace-nowrap px-6 py-4"'} >{Urgent}</td> <td className="whitespace-nowrap px-6 py-4"> </td>
</tr> ); }; const JobsList = ({ jobs }: { jobs: Job[] }) => { if (!jobs?.length) return <div>No Jobs</div> return ( <tbody> {jobs.map((job, idx) => ( <JobsView job={job} key={idx} /> ))} </tbody> ) }
var Urgent = job.isUrgent ? 'Yes' : 'No'; var Status = job.isDone ? 'Done' : 'Open'; return ( <tr className={Urgent === 'Yes' ? 'border-b border-red-200 bg-red-100' : 'text-neutral-800 border-b dark:border-neutral-500'}> <td className="whitespace-nowrap px-6 py-4 font-medium">{job.id}</td> <td className="whitespace-nowrap px-6 py-4">{job.description}</td> <td className="whitespace-nowrap px-6 py-4">{formattedCreatedAt}</td> <td className="whitespace-nowrap px-6 py-4">{job.userId}</td> <td className="whitespace-nowrap px-6 py-4">{Status}</td> <td className={Urgent === 'Yes' ? 'bg-red-500 whitespace-nowrap px-6 py-4"' : 'whitespace-nowrap px-6 py-4"'} >{Urgent}</td> <td className="whitespace-nowrap px-6 py-4"> </td>
</tr> ); }; const JobsList = ({ jobs }: { jobs: Job[] }) => { if (!jobs?.length) return <div>No Jobs</div> return ( <tbody> {jobs.map((job, idx) => ( <JobsView job={job} key={idx} /> ))} </tbody> ) }
13 replies
WWasp-lang
•Created by Start2Panic on 5/14/2024 in #đŸ™‹questions
Context entities in a query
Hey @kapa.ai
In the frontend I call JobList in a table:
<table className="min-w-full text-left text-sm font-light">
<thead className="border-b font-medium dark:border-neutral-500">
<tr>
<th scope="col" className="px-6 py-4">#</th>
<th scope="col" className="px-6 py-4">Descrption</th>
<th scope="col" className="px-6 py-4">Created on</th>
<th scope="col" className="px-6 py-4">Created by</th>
<th scope="col" className="px-6 py-4">Status</th>
<th scope="col" className="px-6 py-4">Urgent</th>
<th></th>
</tr>
</thead>
{jobs && <JobsList jobs={jobs} />}
{isLoading && 'Loading...'}
{error && 'Error: ' + error}
</table>
This JobList returns the table body of jobs :
const JobsList = ({ jobs }: { jobs: Job[] }) => {
if (!jobs?.length) return <div>No Jobs</div>
return (
<tbody>
{jobs.map((job, idx) => (
<JobsView job={job} key={idx} />
))}
</tbody>
)
}
13 replies