2022-01-11 06:16:58 +00:00
|
|
|
import Link from 'next/link'
|
|
|
|
import clsx from 'clsx'
|
|
|
|
|
2022-03-17 07:50:45 +00:00
|
|
|
import { useUser } from '../../hooks/use-user'
|
|
|
|
import { ENV_CONFIG } from '../../../common/envs/constants'
|
2022-01-23 00:16:23 +00:00
|
|
|
|
2022-01-18 19:16:35 +00:00
|
|
|
export function ManifoldLogo(props: {
|
|
|
|
className?: string
|
|
|
|
darkBackground?: boolean
|
2022-03-30 23:56:51 +00:00
|
|
|
hideText?: boolean
|
2022-01-18 19:16:35 +00:00
|
|
|
}) {
|
2022-03-30 23:56:51 +00:00
|
|
|
const { darkBackground, className, hideText } = props
|
2022-01-11 06:16:58 +00:00
|
|
|
|
2022-01-23 00:16:23 +00:00
|
|
|
const user = useUser()
|
|
|
|
|
2022-01-11 06:16:58 +00:00
|
|
|
return (
|
2022-01-23 00:16:23 +00:00
|
|
|
<Link href={user ? '/home' : '/'}>
|
2022-03-30 23:56:51 +00:00
|
|
|
<a className={clsx('group flex flex-shrink-0 flex-row gap-4', className)}>
|
2022-01-27 22:50:55 +00:00
|
|
|
<img
|
2022-03-30 23:56:51 +00:00
|
|
|
className="transition-all group-hover:rotate-12"
|
2022-01-11 06:16:58 +00:00
|
|
|
src={darkBackground ? '/logo-white.svg' : '/logo.svg'}
|
|
|
|
width={45}
|
|
|
|
height={45}
|
|
|
|
/>
|
2022-03-30 23:56:51 +00:00
|
|
|
|
|
|
|
{!hideText &&
|
|
|
|
(ENV_CONFIG.navbarLogoPath ? (
|
|
|
|
<img src={ENV_CONFIG.navbarLogoPath} width={245} height={45} />
|
|
|
|
) : (
|
|
|
|
<>
|
|
|
|
<div
|
|
|
|
className={clsx(
|
|
|
|
'font-major-mono mt-1 text-lg lowercase sm:hidden',
|
|
|
|
darkBackground && 'text-white'
|
|
|
|
)}
|
|
|
|
>
|
|
|
|
Manifold
|
|
|
|
<br />
|
|
|
|
Markets
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
className={clsx(
|
|
|
|
'font-major-mono mt-1 hidden lowercase sm:flex sm:text-2xl md:whitespace-nowrap',
|
|
|
|
darkBackground && 'text-white'
|
|
|
|
)}
|
|
|
|
>
|
|
|
|
Manifold Markets
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
))}
|
2022-01-11 06:16:58 +00:00
|
|
|
</a>
|
|
|
|
</Link>
|
|
|
|
)
|
|
|
|
}
|