Skip to content

Commit 42995b1

Browse files
authored
Add compare section to navbar & update styles (#203)
1 parent 6f51fc0 commit 42995b1

File tree

8 files changed

+282
-104
lines changed

8 files changed

+282
-104
lines changed

src/components/MainCTA/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const MainCTA = ({ className }: Props) => {
2424

2525
return (
2626
<Button
27-
className={clsx(styles.ctaButton, styles.getQuestdb, className)}
27+
className={clsx(styles.ctaButton, className)}
2828
size="xsmall"
2929
variant="secondary"
3030
to={url}
Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
.ctaButton {
2-
margin-left: 10px;
3-
font-size: var(--font-size-small);
4-
padding: 0 2rem;
5-
}
6-
7-
.getQuestdb {
82
background: var(--palette-pink);
93
color: #ffffff;
4+
padding: 0 1rem;
5+
flex-shrink: 0;
6+
font-weight: 600;
7+
}
8+
9+
.ctaButton:hover {
10+
background: var(--palette-pink-darker);
11+
color: #fff;
12+
}
13+
14+
@media (min-width: 1100px) {
15+
.ctaButton {
16+
margin-left: 0.75rem;
17+
min-width: 140px;
18+
padding: 0 2rem;
19+
}
1020
}

src/components/Tailwind/WideNav/MobileNav/index.tsx

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,31 @@ import { XMarkIcon, ChevronDownIcon } from "@heroicons/react/20/solid"
99
import { useNavbarSecondaryMenu } from "@docusaurus/theme-common/internal"
1010
import SearchBar from "@theme/SearchBar"
1111

12-
type Feature = {
12+
type NavLink = {
1313
name: string
1414
href: string
1515
}
1616

17-
type NavLink = {
17+
type Feature = {
1818
name: string
1919
href: string
20+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>
21+
svg?: React.ComponentType<React.SVGProps<SVGSVGElement>>
2022
}
2123

2224
type MobileNavProps = {
2325
mobileMenuOpen: boolean
2426
setMobileMenuOpen: (open: boolean) => void
25-
features: Feature[]
27+
productFeatures: Feature[]
28+
compareFeatures: Feature[]
2629
navLinks: NavLink[]
2730
}
2831

2932
export default function MobileNav({
3033
mobileMenuOpen,
3134
setMobileMenuOpen,
32-
features,
35+
productFeatures,
36+
compareFeatures,
3337
navLinks,
3438
}: MobileNavProps) {
3539
const secondaryMenu = useNavbarSecondaryMenu()
@@ -61,7 +65,7 @@ export default function MobileNav({
6165
<SearchBar />
6266
</div>
6367
<div className="flow-root">
64-
<div className="-my-6 divide-y mt-4 divide-gray-500/10 dark:divide-gray-700">
68+
<div className="divide-y my-4 divide-gray-500/10 dark:divide-gray-700">
6569
<div className="space-y-2">
6670
{secondaryMenu.content ? (
6771
<Disclosure as="div" className="-mx-3 mb-4">
@@ -70,37 +74,81 @@ export default function MobileNav({
7074
<hr />
7175
<a
7276
href="/"
73-
className="-mx-3 block rounded-lg px-3 py-2.5 text-base font-semibold leading-7 text-gray-900 dark:text-white hover:bg-gray-50 dark:hover:bg-[rgb(33,34,44)]"
77+
className="-mx-3 block rounded-lg px-3 py-2.5 text-base font-semibold text-gray-900 dark:text-white hover:bg-gray-50 dark:hover:bg-[rgb(33,34,44)]"
7478
>
7579
← Return to homepage
7680
</a>
7781
</div>
7882
</Disclosure>
7983
) : (
8084
<>
81-
<Disclosure as="div" className="-mx-3 pt-4">
82-
<DisclosureButton className="group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold leading-7 bg-white text-gray-700 dark:bg-[rgb(38,40,51)] dark:text-white hover:bg-gray-50 dark:hover:bg-[rgb(33,34,44)]">
85+
<Disclosure as="div" className="-mx-3 pt-4" defaultOpen>
86+
<DisclosureButton className="group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold bg-white text-gray-700 dark:bg-[rgb(38,40,51)] dark:text-white hover:bg-gray-50 dark:hover:bg-[rgb(33,34,44)]">
87+
Product
88+
<ChevronDownIcon
89+
aria-hidden="true"
90+
className="h-5 w-5 flex-none group-data-[open]:rotate-180"
91+
/>
92+
</DisclosureButton>
93+
<DisclosurePanel className="mt-2 space-y-2">
94+
{productFeatures.map((item) => (
95+
<DisclosureButton
96+
key={item.name}
97+
as="a"
98+
href={item.href}
99+
className="group flex items-center gap-x-3 rounded-lg text-white py-2 pl-8 pr-3 text-sm font-semibold hover:bg-[rgb(43,45,56)]"
100+
>
101+
{item.icon ? (
102+
<item.icon
103+
aria-hidden="true"
104+
className="h-5 w-5 text-gray-300 group-hover:text-primary group-hover:fill-primary"
105+
/>
106+
) : item.svg ? (
107+
<item.svg
108+
aria-hidden="true"
109+
className="h-5 w-5 fill-current text-gray-300 group-hover:text-primary group-hover:fill-primary"
110+
/>
111+
) : null}
112+
{item.name}
113+
</DisclosureButton>
114+
))}
115+
</DisclosurePanel>
116+
</Disclosure>
117+
118+
<Disclosure as="div" className="-mx-3 pt-4" defaultOpen>
119+
<DisclosureButton className="group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold bg-white text-gray-700 dark:bg-[rgb(38,40,51)] dark:text-white hover:bg-gray-50 dark:hover:bg-[rgb(33,34,44)]">
83120
Compare
84121
<ChevronDownIcon
85122
aria-hidden="true"
86123
className="h-5 w-5 flex-none group-data-[open]:rotate-180"
87124
/>
88125
</DisclosureButton>
89126
<DisclosurePanel className="mt-2 space-y-2">
90-
{features.map((item) => (
127+
{compareFeatures.map((item) => (
91128
<DisclosureButton
92129
key={item.name}
93130
as="a"
94131
href={item.href}
95-
className="block rounded-lg text-black dark:text-white py-2 pl-6 pr-3 text-sm font-semibold leading-7 hover:bg-gray-50 dark:hover:bg-[rgb(33,34,44)]"
132+
className="group flex items-center gap-x-3 rounded-lg text-white py-2 pl-8 pr-3 text-sm font-semibold hover:bg-[rgb(43,45,56)]"
96133
>
134+
{item.icon ? (
135+
<item.icon
136+
aria-hidden="true"
137+
className="h-5 w-5 text-gray-300 group-hover:text-primary group-hover:fill-primary"
138+
/>
139+
) : item.svg ? (
140+
<item.svg
141+
aria-hidden="true"
142+
className="h-5 w-5 fill-current text-gray-300 group-hover:text-primary group-hover:fill-primary"
143+
/>
144+
) : null}
97145
{item.name}
98146
</DisclosureButton>
99147
))}
100148
</DisclosurePanel>
101149
</Disclosure>
102150

103-
<div className="flex flex-col space-y-1">
151+
<div className="flex flex-col space-y-2">
104152
{navLinks.map((link) => (
105153
<a
106154
key={link.name}

0 commit comments

Comments
 (0)