a17342e55c
* Show bio, banner, and social links on user page * Minor tweaks * Allow edits to their user page * Fix build; add a white ring around users * From userpage, link to /profile (which is always editable now) * Update userpage SEO * Clean up Profile menu * Fixes according to Stephen's code review
39 lines
913 B
TypeScript
39 lines
913 B
TypeScript
import clsx from 'clsx'
|
|
import Link from 'next/link'
|
|
|
|
export const SiteLink = (props: {
|
|
href: string
|
|
children: any
|
|
className?: string
|
|
}) => {
|
|
const { href, children, className } = props
|
|
|
|
return href.startsWith('http') ? (
|
|
<a
|
|
href={href}
|
|
className={clsx(
|
|
'z-10 break-words hover:underline hover:decoration-indigo-400 hover:decoration-2',
|
|
className
|
|
)}
|
|
style={{ /* For iOS safari */ wordBreak: 'break-word' }}
|
|
target="_blank"
|
|
onClick={(e) => e.stopPropagation()}
|
|
>
|
|
{children}
|
|
</a>
|
|
) : (
|
|
<Link href={href}>
|
|
<a
|
|
className={clsx(
|
|
'z-10 break-words hover:underline hover:decoration-indigo-400 hover:decoration-2',
|
|
className
|
|
)}
|
|
style={{ /* For iOS safari */ wordBreak: 'break-word' }}
|
|
onClick={(e) => e.stopPropagation()}
|
|
>
|
|
{children}
|
|
</a>
|
|
</Link>
|
|
)
|
|
}
|