Skip to content

Commit

Permalink
small touchups to github source display
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinGreenwood committed Jan 8, 2025
1 parent 9a3dc09 commit 05b5e61
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 21 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/opportunities/OpportunityFull.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export function OpportunityFull({ opportunityId }: OpportunityFullProps) {
</div>
<div className="flex flex-col justify-start items-start border-t border-border bg-popover/30 dark:bg-popover">
<OpportunityHighlights opportunity={opportunity} />

<OpportunityMentions opportunity={opportunity} size={"large"} />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export function OpportunityMentions({
<div key={index}>
<ul className="">
<li className="col-span-1 border-l-2 px-3 border-secondary-foreground/50">
{/* <span className="min-w-1 h-auto bg-primary rounded-lg"></span> */}
<p className="text-base dark:text-secondary font-light">
{jobPostContext.sentence}
</p>
Expand Down
77 changes: 57 additions & 20 deletions frontend/src/components/opportunities/OpportunitySources.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExternalLink, Download, Github } from "lucide-react"
import { ExternalLink, Download, Github, UserRoundSearch } from "lucide-react"
import { toast } from "sonner"
import { Button } from "@/components/ui/button"
import { timeAgo } from "@/utils/misc"
Expand Down Expand Up @@ -92,7 +92,7 @@ export function OpportunitySources({ opportunity }: OpportunityDrawerProps) {

{opportunity.jobPosts && opportunity.jobPosts?.length > 0 && (
<Dialog open={!!jobPostPdfUrl} onOpenChange={closeJobPostModal}>
<div className="flex flex-row justify-between rounded-lg p-6 items-center gap-x-3 border border-border bg-card dark:bg-popover w-full">
<div className="flex flex-row justify-between rounded-lg p-4 items-center gap-x-3 border border-border bg-card dark:bg-popover w-full">
<DialogContent className="h-[800px] min-w-[900px] min-h-[900px] p-0 flex flex-col space-y-0 gap-0">
<DialogHeader className="p-5 justify-center h-16 align-center">
<DialogTitle>{opportunity?.jobPosts?.[0]?.title}</DialogTitle>
Expand All @@ -107,15 +107,20 @@ export function OpportunitySources({ opportunity }: OpportunityDrawerProps) {
/>
)}
</DialogContent>
<div className="flex flex-col flex-1 overflow-hidden">
<p className="text-base font-medium truncate text-ellipsis ">
{opportunity?.jobPosts?.[0]?.title}
</p>
<p className="flex text-sm text-muted-foreground text-zinc-500 dark:text-zinc-400">
Added{" "}
{opportunity?.jobPosts?.[0]?.createdAt &&
timeAgo(new Date(opportunity.jobPosts[0].createdAt))}{" "}
</p>
<div className="flex flex-row gap-3">
<span className="w-6 rounded-lg h-6 bg-green-600 flex place-items-center justify-center">
<UserRoundSearch size={15} />
</span>
<div className="flex flex-col flex-1 overflow-hidden">
<p className="text-base font-medium truncate text-ellipsis ">
{opportunity?.jobPosts?.[0]?.title}
</p>
<p className="flex text-sm text-muted-foreground text-zinc-500 dark:text-zinc-400">
Added{" "}
{opportunity?.jobPosts?.[0]?.createdAt &&
timeAgo(new Date(opportunity.jobPosts[0].createdAt))}{" "}
</p>
</div>
</div>
<div className="flex flex-row justify-end gap-x-2 items-center min-w-48">
<DialogTrigger asChild>
Expand Down Expand Up @@ -145,16 +150,48 @@ export function OpportunitySources({ opportunity }: OpportunityDrawerProps) {
)}
{opportunity.repos && opportunity.repos?.length > 0 && (
<div className="flex flex-row justify-between rounded-lg p-6 items-center gap-x-3 border border-border bg-card dark:bg-popover w-full">
<div className="flex flex-col flex-1 overflow-hidden">
<p className="text-base font-medium truncate text-ellipsis ">
<Github className="h-3 w-3" />
{opportunity.repos[0].name}
</p>
{repo && repo.updatedAt && (
<p className="flex text-sm text-muted-foreground text-zinc-500 dark:text-zinc-400">
Last updated {timeAgo(new Date(repo.updatedAt))}{" "}
<div className="flex flex-row gap-3">
<span className="w-6 rounded-lg h-6 bg-yellow-600 flex place-items-center justify-center">
<Github size={15} />
</span>
<div className="flex flex-col flex-1 overflow-hidden gap-2">
<p className="text-base font-medium truncate text-ellipsis ">
{opportunity.repos[0].name}
</p>
)}
<div className="flex flex-row gap-2">
{repo && repo.topics && (
<>
{repo.topics.map((topic, index) => (
<p
key={index}
className="flex text-sm rounded-lg bg-popover dark:bg-muted py-0.5 px-1.5"
>
{topic}{" "}
</p>
))}
</>
)}
</div>
<div className="flex flex-row gap-1 items-center">
{repo && repo.updatedAt && (
<>
<p className="flex text-xs text-muted-foreground text-zinc-500 dark:text-zinc-400">
Last updated {timeAgo(new Date(repo.updatedAt))}{" "}
</p>
<span className="dark:text-secondary-foreground text-muted text-xs">
|
</span>
</>
)}
{repo && repo.watchersCount && (
<>
<p className="flex text-xs text-muted-foreground text-zinc-500 dark:text-zinc-400">
{repo.watchersCount} watchers{" "}
</p>
</>
)}
</div>
</div>
</div>
<div className="flex flex-row justify-end gap-x-2 items-center min-w-48">
<a
Expand Down

0 comments on commit 05b5e61

Please sign in to comment.