Skip to content

Commit

Permalink
feat: pill and tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hariscs committed Mar 23, 2024
1 parent 345c193 commit 11ec6c1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/frontend/public/assets/icons/icon-remove.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions apps/frontend/src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export function Card({ job }: { job: Job }) {
</div>
</div>
<hr className="md:hidden" />
<div className="text-primary flex flex-wrap items-center gap-4 text-left capitalize">
<Pill>{job.role}</Pill>
<div className="flex flex-wrap items-center gap-4 ">
<Pill tag>{job.role}</Pill>
<Pill>{job.level}</Pill>
{job.languages.map((language) => (
<Pill key={language}>{language}</Pill>
Expand Down
27 changes: 24 additions & 3 deletions apps/frontend/src/components/Pill.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
export function Pill({ children }: { children: React.ReactNode }) {
export function Pill({
children,
tag,
}: {
children: React.ReactNode
tag?: boolean
}) {
return (
<div className="bg-tertiary hover:bg-primary hover:text-tertiary rounded px-2 py-0.5 transition-colors">
{children}
<div className="flex transition-colors">
<div
className={`${tag ? 'rounded-s' : 'hover:bg-primary hover:text-tertiary cursor-pointer rounded'} bg-tertiary text-primary px-2 py-0.5 capitalize`}
>
{children}
</div>
{tag && (
<button className="bg-primary hover:bg-secondary rounded-e px-2">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14">
<path
fill="#FFF"
fill-rule="evenodd"
d="M11.314 0l2.121 2.121-4.596 4.596 4.596 4.597-2.121 2.121-4.597-4.596-4.596 4.596L0 11.314l4.596-4.597L0 2.121 2.121 0l4.596 4.596L11.314 0z"
/>
</svg>
</button>
)}
</div>
)
}

0 comments on commit 11ec6c1

Please sign in to comment.