Skip to content

Commit

Permalink
chore: Add conditional images & links
Browse files Browse the repository at this point in the history
  • Loading branch information
iamhiman committed Jan 24, 2024
1 parent 19ff8c9 commit 8153858
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/Jobs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const Jobs: NextPage<IJobsProps> = ({ jobs }) => {
<div className="job" key={job?.id}>
<h2>{job?.company}</h2>
<h3>{job?.designation}</h3>
<img src={job?.logo?.url} alt="" className="job_companyLogo" />
{job?.logo?.url && <img src={job?.logo?.url} alt="" className="job_companyLogo" />}
<div className="job_date_beforeLine">
{`${Months[parseInt(job?.from?.split("-")[1])]}, ${job?.from?.split("-")[0]}`}
</div>
Expand All @@ -26,8 +26,10 @@ export const Jobs: NextPage<IJobsProps> = ({ jobs }) => {
{job?.to ? `${Months[parseInt(job?.to?.split("-")[1])]}, ${job?.to?.split("-")[0]}` : "Present"}
</div>
<div className="job_companyLinks">
<img src={linkedin?.src} alt="" onClick={() => window.open(job?.companyLinkedin, "_blank")} />
<img src={www?.src} alt="" onClick={() => window.open(job?.companyUrl, "_blank")} />
{job?.companyLinkedin && (
<img src={linkedin?.src} alt="" onClick={() => window.open(job?.companyLinkedin, "_blank")} />
)}
{job?.companyUrl && <img src={www?.src} alt="" onClick={() => window.open(job?.companyUrl, "_blank")} />}
</div>
</div>
))}
Expand Down

1 comment on commit 8153858

@vercel
Copy link

@vercel vercel bot commented on 8153858 Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.