Skip to content

Commit

Permalink
fix: show delete job button
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-eof committed Apr 30, 2023
1 parent c0a7c71 commit 72b9b53
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/JobOffersRequests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ function JobComponent({ job, deleteItem }: JobProps) {
deleteItem(jobId);
}
};
function showUserButtons(job: Job) {
return job.author?.username === localStorage.getItem('username');
}

return (
<Card
direction={{ base: 'column', sm: 'row' }}
Expand Down Expand Up @@ -163,6 +167,7 @@ function JobComponent({ job, deleteItem }: JobProps) {
<Button
variant={'solid'}
colorScheme="red"
display={showUserButtons(job) ? '' : 'none'}
onClick={() => deleteJobOfferRequest(job.id)}
>
Delete
Expand Down

0 comments on commit 72b9b53

Please sign in to comment.