Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small design adjustments #102

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export default function Index({
as={Link}
href="/contact-sales"
>
Book a demo today
Book a demo
</Button>
</div>
}
Expand Down
2 changes: 1 addition & 1 deletion pages/pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default function Pricing({
href="/contact-sales"
className="mt-xlarge w-fit"
>
Book a demo today
Book a demo
</Button>
</StandardPageWidth>
</div>
Expand Down
2 changes: 1 addition & 1 deletion pages/products/[product].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function Product({
href="/contact-sales"
className=" w-fit"
>
Book a demo today
Book a demo
</Button>
}
/>
Expand Down
34 changes: 13 additions & 21 deletions src/components/NavigationDesktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { ColorModeProvider } from '@pluralsh/design-system'

import { type NavData, useNavData } from '@src/contexts/NavDataContext'

import { ProductTopNavMenu } from './menu/ProductNav'
import { SolutionTopNavMenu } from './menu/SolutionNav'
import { TopNavMenu } from './menu/TopNavMenu'
import { MainLink } from './Navigation'

Expand Down Expand Up @@ -37,34 +35,28 @@ export function NavigationDesktop({ logoRef }) {
return (
<ColorModeProvider mode="dark">
<div className="hidden gap-xsmall lg:flex">
{flatNav?.map((navItem, i) => {
{flatNav?.map((navItem) => {
if (navItem?.mobile_only) {
return null
}
if (navItem?.subnav) {
if (!i) {
return (
<ProductTopNavMenu
key={navItem.id}
navItem={navItem}
left={logoLeft}
/>
)
}
if (i === 1) {
return (
<SolutionTopNavMenu
key={navItem.id}
navItem={navItem}
left={logoLeft}
/>
)
}
const kind =
navItem.link?.title === 'Product'
? 'product'
: navItem.link?.title === 'Solutions'
? 'solution'
: 'default'

return (
<TopNavMenu
key={navItem.id}
kind={kind}
navItem={navItem}
left={
kind === 'product' || kind === 'solution'
? logoLeft
: undefined
}
/>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function PageHeader({
primary
fontFamily={theme.fontFamilies.sans}
>
Book a demo today
Book a demo
</Button>
</div>
{/* <SearchButton /> */}
Expand Down
32 changes: 18 additions & 14 deletions src/components/menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
import styled from 'styled-components'

import { MainLinkBase } from '../Navigation'
import { ResponsiveText } from '../Typography'

import { PopoverMenu } from './PopoverMenu'

Expand All @@ -37,11 +36,12 @@ type Placement = 'left' | 'right'
export type ItemRendererProps<T extends object> = {
item: Node<T>
state: TreeState<T>
kind?: MenuButtonProps<T>['kind']
}

type ItemRenderer<T extends object> = (p: ItemRendererProps<T>) => JSX.Element

interface MenuButtonProps<T extends { render?: FunctionComponent }>
export interface MenuButtonProps<T extends { render?: FunctionComponent }>
extends AriaMenuProps<T>,
MenuTriggerProps {
itemRenderer?: ItemRenderer<T>
Expand All @@ -51,6 +51,8 @@ interface MenuButtonProps<T extends { render?: FunctionComponent }>
maxHeight?: number | string
className?: string
dropdownProps?: Parameters<typeof useFloatingDropdown>[0]
kind?: 'product' | 'default' | 'solution'
left?: number
}

function MainLinkTriggerUnstyled({
Expand Down Expand Up @@ -107,10 +109,7 @@ export function MenuButton<T extends object>({
kind = 'default',
left,
...props
}: MenuButtonProps<T> & {
kind?: 'product' | 'default' | 'solution'
left?: number
}) {
}: MenuButtonProps<T>) {
// Create state based on the incoming props
const triggerState = useMenuTriggerState(props)

Expand Down Expand Up @@ -198,10 +197,14 @@ function MenuDropdown<T extends object>({
>
<DropdownCard>
<div className={kind === 'product' ? 'p-xlarge' : ''}>
{kind === 'product' && (
<MenuCategoryLabel>Platform features</MenuCategoryLabel>
)}
<ul className={kind === 'product' ? 'grid grid-cols-2' : ''}>
{[...state.collection].map((item) => (
<ItemRenderer
key={item.key}
kind={kind}
item={item}
state={state}
/>
Expand Down Expand Up @@ -254,18 +257,12 @@ function SolutionNavDropdown<T extends object>({
<div className="p-xlarge">
{Object.keys(itemByCategory).map((category) => (
<div key={category}>
<ResponsiveText
as="h2"
textStyles={{ '': 'mLabel' }}
color="text-light"
className="mb-xsmall ml-xxsmall uppercase"
>
{category}
</ResponsiveText>
<MenuCategoryLabel>{category}</MenuCategoryLabel>
<ul>
{itemByCategory[category].map((item) => (
<ItemRenderer
key={item.key}
kind="solution"
item={item}
state={state}
/>
Expand Down Expand Up @@ -316,3 +313,10 @@ export function MenuItem<T extends object>({
</li>
)
}

const MenuCategoryLabel = styled.h2(({ theme }) => ({
...theme.partials.marketingText.label,
color: theme.colors['text-light'],
marginBottom: theme.spacing.xsmall,
marginLeft: theme.spacing.xxsmall,
}))
84 changes: 0 additions & 84 deletions src/components/menu/ProductNav.tsx

This file was deleted.

84 changes: 0 additions & 84 deletions src/components/menu/SolutionNav.tsx

This file was deleted.

Loading
Loading