2022-01-11 06:16:58 +00:00
|
|
|
import Link from 'next/link'
|
|
|
|
import clsx from 'clsx'
|
|
|
|
|
2022-05-09 13:04:36 +00:00
|
|
|
import { useUser } from 'web/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-31 05:35:20 +00:00
|
|
|
hideText?: boolean
|
2022-04-04 05:45:23 +00:00
|
|
|
twoLine?: boolean
|
2022-01-18 19:16:35 +00:00
|
|
|
}) {
|
2022-04-04 05:45:23 +00:00
|
|
|
const { darkBackground, className, hideText, twoLine } = 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-31 05:35:20 +00:00
|
|
|
<a className={clsx('group flex flex-shrink-0 flex-row gap-4', className)}>
|
2022-07-19 06:24:40 +00:00
|
|
|
{!ENV_CONFIG.navbarLogoPath && (
|
|
|
|
<img
|
|
|
|
className="transition-all group-hover:rotate-12"
|
|
|
|
src={darkBackground ? '/logo-white.svg' : '/logo.svg'}
|
|
|
|
width={45}
|
|
|
|
height={45}
|
|
|
|
/>
|
|
|
|
)}
|
2022-03-31 05:35:20 +00:00
|
|
|
|
|
|
|
{!hideText &&
|
|
|
|
(ENV_CONFIG.navbarLogoPath ? (
|
2022-07-19 06:24:40 +00:00
|
|
|
<img
|
|
|
|
className="rounded-md bg-gradient-to-r from-cyan-500 to-sky-600 p-2"
|
|
|
|
src={ENV_CONFIG.navbarLogoPath}
|
|
|
|
width={350}
|
|
|
|
height={80}
|
|
|
|
/>
|
2022-04-04 05:45:23 +00:00
|
|
|
) : twoLine ? (
|
|
|
|
<div
|
|
|
|
className={clsx(
|
|
|
|
'font-major-mono mt-1 text-lg lowercase text-gray-900',
|
|
|
|
darkBackground && 'text-white'
|
|
|
|
)}
|
|
|
|
>
|
|
|
|
Manifold
|
|
|
|
<br />
|
|
|
|
Markets
|
|
|
|
</div>
|
2022-03-31 05:35:20 +00:00
|
|
|
) : (
|
2022-04-04 05:45:23 +00:00
|
|
|
<div
|
|
|
|
className={clsx(
|
|
|
|
'font-major-mono mt-2 text-2xl lowercase text-gray-900 md:whitespace-nowrap',
|
|
|
|
darkBackground && 'text-white'
|
|
|
|
)}
|
|
|
|
>
|
|
|
|
Manifold Markets
|
|
|
|
</div>
|
2022-03-31 05:35:20 +00:00
|
|
|
))}
|
2022-01-11 06:16:58 +00:00
|
|
|
</a>
|
|
|
|
</Link>
|
|
|
|
)
|
|
|
|
}
|