Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-portfolio-url-overflow #55

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FinalCtaSection from './FinalCtaSection'
import FinalCTASection from './FinalCTASection'

export const generated = () => {
return <FinalCtaSection />
return <FinalCTASection />
}

export default { title: 'Components/FinalCtaSection' }
export default { title: 'Components/FinalCTASection' }
14 changes: 11 additions & 3 deletions web/src/components/Jobs/JobProfileDisplay/JobProfileDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ const JobProfileDisplay = ({ profile }) => {
return null
}

const hostname = (url) => {
// try to get the hostname from the url
// if it's not a valid url, return url as is
try {
return new URL(profile.portfolioUrl).hostname
} catch (e) {
return url
}
}

return (
<JobDetailLayout
title={
Expand Down Expand Up @@ -43,9 +53,7 @@ const JobProfileDisplay = ({ profile }) => {
Portfolio/Profile
</h3>
<div className="mt-2 text-center">
<a href={profile.portfolioUrl} className="">
{profile.portfolioUrl}
</a>
<a href={profile.portfolioUrl}>{hostname(profile.portfolioUrl)}</a>
</div>
</div>
<div className="py-8 px-12 md:w-1/3">
Expand Down
22 changes: 11 additions & 11 deletions web/src/pages/Jobs/JobsPage/JobsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,39 @@ export default function () {
description="Want to get paid to write RedwoodJS?"
/>

<section className="mx-auto mt-12 sm:mt-36 max-w-screen-lg">
<section className="mx-auto mt-12 max-w-screen-lg sm:mt-36">
<header className="text-center">
<h1 className="mt-12 font-serif">RedwoodJS Developers</h1>
<h1 className="font-serif font-bold">RedwoodJS Jobs</h1>
<p className="mt-2 text-lg text-gray-500">
Experienced RedwoodJS devs looking for their next role
Companies looking for RedwoodJS devs
</p>
</header>

<div className="mt-4 flex justify-center">
<Link to={routes.newJobProfile()} className="button-sm">
Create Profile
<Link to={routes.newJob()} className="button-sm">
Post a Job
</Link>
</div>
<div className="mt-8">
<JobProfilesCell limit={5} showAll={true} />
<JobsCell limit={5} showAll={true} />
</div>
</section>

<section className="mx-auto mt-24 mb-24 max-w-screen-lg">
<header className="text-center">
<h1 className="font-serif font-bold">RedwoodJS Jobs</h1>
<h1 className="mt-12 font-serif">RedwoodJS Developers</h1>
<p className="mt-2 text-lg text-gray-500">
Companies looking for RedwoodJS devs
Experienced RedwoodJS devs looking for their next role
</p>
</header>

<div className="mt-4 flex justify-center">
<Link to={routes.newJob()} className="button-sm">
Post a Job
<Link to={routes.newJobProfile()} className="button-sm">
Create Profile
</Link>
</div>
<div className="mt-8">
<JobsCell limit={5} showAll={true} />
<JobProfilesCell limit={5} showAll={true} />
</div>
</section>
</>
Expand Down