feat(org): Better /new page
This commit is contained in:
parent
1c694d7aac
commit
39e013be42
9 changed files with 143 additions and 57 deletions
|
@ -12,21 +12,30 @@ const btnClasses = {
|
|||
'border border-secondary hover:border hover:border-secondary',
|
||||
}
|
||||
|
||||
export const ChoiceLink = ({ title = '', href = '', children, icon = null }) => (
|
||||
<Link
|
||||
className={`
|
||||
flex flex-col flex-nowrap items-start justify-start gap-2 pt-2 pb-4 h-auto w-full mt-3
|
||||
export const ChoiceLink = ({ title = '', href = '', children, icon = null }) => {
|
||||
const linkProps = {
|
||||
href,
|
||||
className: `flex flex-col flex-nowrap items-start justify-start gap-2 pt-2 pb-4 h-auto w-full mt-3
|
||||
btn btn-secondary btn-ghost border border-secondary
|
||||
hover:bg-opacity-20 hover:bg-secondary hover:border hover:border-secondary
|
||||
`}
|
||||
href={href}
|
||||
>
|
||||
<h5 className="flex flex-row items-center justify-between w-full">
|
||||
<span>{title}</span>
|
||||
{icon}
|
||||
</h5>
|
||||
<div className={`normal-case text-base font-medium text-base-content text-left`}>
|
||||
{children}
|
||||
</div>
|
||||
</Link>
|
||||
)
|
||||
hover:bg-opacity-20 hover:bg-secondary hover:border hover:border-secondary`,
|
||||
}
|
||||
|
||||
const content = (
|
||||
<>
|
||||
<h5 className="flex flex-row items-center justify-between w-full">
|
||||
<span>{title}</span>
|
||||
{icon}
|
||||
</h5>
|
||||
<div className={`normal-case text-base font-medium text-base-content text-left`}>
|
||||
{children}
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
// Deal with external links
|
||||
return href.slice(0, 4).toLowerCase() === 'http' ? (
|
||||
<a {...linkProps}>{content}</a>
|
||||
) : (
|
||||
<Link {...linkProps}>{content}</Link>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue