-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use consistent design for card components
This patch removes repeated definitions of card-like components and introduces reusable `Card` and `LinkCard` components instead. There are no longer any cards with a border, however, `LinkCard` shows a border when hovering/focused (like `JobPanel` did previously).
- Loading branch information
Showing
10 changed files
with
96 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { FunctionComponent, PropsWithChildren } from 'react' | ||
import clsx from 'clsx' | ||
|
||
export const Card: FunctionComponent<PropsWithChildren<{ | ||
className?: string | ||
}>> = (props) => { | ||
return ( | ||
<div className={clsx( | ||
'my-2 p-4 rounded bg-[#2b2d30]', | ||
props.className | ||
)} | ||
> | ||
{props.children} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import { FunctionComponent, PropsWithChildren } from 'react' | ||
import { ColoredSkeleton } from './ColoredSkeleton.js' | ||
import { Card } from './Card.js' | ||
|
||
export const InfoCard: FunctionComponent<PropsWithChildren<{ | ||
title?: string | ||
}>> = (props) => { | ||
return ( | ||
<div className='mb-2 px-4 py-2 rounded bg-[#2b2d30]'> | ||
<dt className='text-sm text-gray-200'>{props.title ?? <ColoredSkeleton />}</dt> | ||
<dd className='mt-1 text-white-900 font-semibold'>{props.children ?? <ColoredSkeleton />}</dd> | ||
</div> | ||
<Card> | ||
<div className='text-sm text-gray-200'>{props.title ?? <ColoredSkeleton />}</div> | ||
<div className='mt-2 text-white-900 font-semibold'>{props.children ?? <ColoredSkeleton />}</div> | ||
</Card> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ComponentPropsWithoutRef, FunctionComponent, PropsWithChildren } from 'react' | ||
import { Link } from 'react-router-dom' | ||
import clsx from 'clsx' | ||
|
||
export const LinkCard: FunctionComponent<PropsWithChildren<{ | ||
className?: string | ||
}> & ComponentPropsWithoutRef<typeof Link>> = (props) => { | ||
return ( | ||
<Link | ||
{...props} | ||
className={clsx( | ||
'block my-2 p-4 rounded bg-[#2b2d30] border-2 border-transparent hocus:border-white/25 outline-none', | ||
props.className | ||
)} | ||
> | ||
{props.children} | ||
</Link> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters