mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
37 lines
878 B
TypeScript
37 lines
878 B
TypeScript
import Link from 'next/link'
|
|
import { useRouter } from 'next/router'
|
|
import { ReactChildren } from 'react'
|
|
import { config } from '../../tokens/stitches.config'
|
|
|
|
export type OmnivoreLogoBaseProps = {
|
|
color?: string
|
|
href?: string
|
|
showTitle?: boolean
|
|
children: React.ReactNode
|
|
}
|
|
|
|
export function OmnivoreLogoBase(props: OmnivoreLogoBaseProps): JSX.Element {
|
|
const href = props.href || '/home'
|
|
const router = useRouter()
|
|
|
|
return (
|
|
<Link passHref href={href}>
|
|
<a
|
|
style={{
|
|
textDecoration: 'none',
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
}}
|
|
onClick={(event) => {
|
|
const query = window.sessionStorage.getItem('q')
|
|
if (query) {
|
|
router.push(`/home?${query}`)
|
|
event.preventDefault()
|
|
}
|
|
}}
|
|
>
|
|
{props.children}
|
|
</a>
|
|
</Link>
|
|
)
|
|
}
|