Make navbar line up with content

This commit is contained in:
jahooma 2021-12-19 22:37:11 -06:00
parent 4b3b6436a0
commit 918229c6ef
3 changed files with 23 additions and 15 deletions

View File

@ -9,10 +9,11 @@ import { ProfileMenu } from './profile-menu'
export function NavBar(props: { export function NavBar(props: {
darkBackground?: boolean darkBackground?: boolean
wide?: boolean
className?: string className?: string
children?: any children?: any
}) { }) {
const { darkBackground, className, children } = props const { darkBackground, wide, className, children } = props
const user = useUser() const user = useUser()
@ -23,11 +24,17 @@ export function NavBar(props: {
return ( return (
<nav <nav
className={clsx( className={clsx(
'w-full flex flex-row justify-center items-center p-4 shadow-sm mb-4', 'w-full p-4 mb-4 shadow-sm',
!darkBackground && 'bg-white', !darkBackground && 'bg-white',
className className
)} )}
aria-label="Global" aria-label="Global"
>
<Row
className={clsx(
'justify-between items-center mx-auto px-4',
wide ? 'max-w-7xl' : 'max-w-4xl'
)}
> >
<ManticLogo darkBackground={darkBackground} /> <ManticLogo darkBackground={darkBackground} />
@ -40,6 +47,7 @@ export function NavBar(props: {
<SignedOutHeaders themeClasses={themeClasses} /> <SignedOutHeaders themeClasses={themeClasses} />
)} )}
</Row> </Row>
</Row>
</nav> </nav>
) )
} }

View File

@ -6,10 +6,10 @@ export function Page(props: { wide?: boolean; children?: any }) {
return ( return (
<div> <div>
<NavBar /> <NavBar wide={wide} />
<div <div
className={clsx( className={clsx(
'max-w-4xl px-4 pb-8 mx-auto w-full', 'w-full px-4 pb-8 mx-auto',
wide ? 'max-w-7xl' : 'max-w-4xl' wide ? 'max-w-7xl' : 'max-w-4xl'
)} )}
> >

View File

@ -32,7 +32,7 @@ const scrollToAbout = () => {
function Hero() { function Hero() {
return ( return (
<div className="overflow-hidden h-screen bg-world-trading bg-cover bg-gray-900 bg-center lg:bg-left"> <div className="overflow-hidden h-screen bg-world-trading bg-cover bg-gray-900 bg-center lg:bg-left">
<NavBar className="max-w-4xl" darkBackground> <NavBar wide darkBackground>
<div <div
className="text-base font-medium text-white ml-8 cursor-pointer hover:underline hover:decoration-teal-500 hover:decoration-2" className="text-base font-medium text-white ml-8 cursor-pointer hover:underline hover:decoration-teal-500 hover:decoration-2"
onClick={scrollToAbout} onClick={scrollToAbout}
@ -42,7 +42,7 @@ function Hero() {
</NavBar> </NavBar>
<main> <main>
<div className="pt-32 sm:pt-8 lg:pt-0 lg:pb-14 lg:overflow-hidden"> <div className="pt-32 sm:pt-8 lg:pt-0 lg:pb-14 lg:overflow-hidden">
<div className="mx-auto max-w-7xl lg:px-8"> <div className="mx-auto max-w-7xl lg:px-8 xl:px-0">
<div className="lg:grid lg:grid-cols-2 lg:gap-8"> <div className="lg:grid lg:grid-cols-2 lg:gap-8">
<div className="mx-auto max-w-md px-8 sm:max-w-2xl sm:text-center lg:px-0 lg:text-left lg:flex lg:items-center"> <div className="mx-auto max-w-md px-8 sm:max-w-2xl sm:text-center lg:px-0 lg:text-left lg:flex lg:items-center">
<div className="lg:py-24"> <div className="lg:py-24">