Skip to content

Commit 8499364

Browse files
committed
ENG-7792: Products dropdown navbar
1 parent 68be0b2 commit 8499364

File tree

4 files changed

+67
-28
lines changed

4 files changed

+67
-28
lines changed

pcweb/components/docpage/navbar/buttons/sidebar.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import reflex as rx
22
from pcweb.components.icons.icons import get_icon
3-
from pcweb.constants import GITHUB_URL, TWITTER_URL, DISCORD_URL
3+
from pcweb.constants import GITHUB_URL, TWITTER_URL, DISCORD_URL, REFLEX_BUILD_URL
44
from pcweb.pages.docs import getting_started
55
from pcweb.pages.hosting.hosting import hosting_landing
66
from pcweb.pages.docs.library import library
@@ -69,13 +69,14 @@ def navbar_sidebar_drawer(trigger) -> rx.Component:
6969
rx.drawer.portal(
7070
rx.drawer.content(
7171
rx.box(
72+
drawer_item("AI Builder", REFLEX_BUILD_URL, "ai-builder"),
73+
drawer_item("Open Source", framework.path, "open-source"),
74+
drawer_item("Cloud", hosting_landing.path, "hosting"),
7275
drawer_item("Docs", getting_started.introduction.path, "docs"),
7376
drawer_item("Templates", gallery.path, "gallery"),
7477
drawer_item("Blog", blogs.path, "blog"),
7578
drawer_item("Case Studies", "/customers", "customers"),
7679
drawer_item("Components", library.path, "library"),
77-
drawer_item("Open Source", framework.path, "open-source"),
78-
drawer_item("Cloud", hosting_landing.path, "hosting"),
7980
drawer_item("Pricing", "/pricing", "pricing"),
8081
drawer_socials(),
8182
rx.el.button(

pcweb/components/docpage/navbar/navbar.py

Lines changed: 58 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from pcweb.pages.hosting.hosting import hosting_landing
1515
from pcweb.pages.use_cases.use_cases import use_cases_page
1616
from reflex_ui.blocks.lemcal import lemcal_dialog, LEMCAL_DEMO_URL
17-
import reflex_ui as ui
17+
from pcweb.components.icons.hugeicons import hi
1818
from ...link_button import resources_button
1919
from ..sidebar import SidebarState
2020
from .buttons.discord import discord
@@ -50,6 +50,33 @@ def resource_item(text: str, url: str, icon: str, index):
5050
)
5151

5252

53+
def resource_item_hi(text: str, url: str, icon: str, index):
54+
return rx.el.li(
55+
rx.link(
56+
rx.box(
57+
hi(icon, size=16, class_name="flex-shrink-0 text-slate-9"),
58+
rx.spacer(),
59+
rx.text(
60+
text,
61+
class_name="font-small text-slate-9 truncate text-start w-[150px]",
62+
),
63+
rx.spacer(),
64+
rx.icon(
65+
tag="chevron_right",
66+
size=14,
67+
class_name="flex-shrink-0 text-slate-12",
68+
),
69+
class_name="flex flex-row flex-nowrap items-center gap-3 hover:bg-slate-3 px-[1.125rem] py-2 rounded-md w-full transition-bg justify-between",
70+
),
71+
class_name="w-full text-slate-9 hover:!text-slate-9",
72+
underline="none",
73+
href=url,
74+
on_click=SidebarState.set_sidebar_index(index),
75+
),
76+
class_name="w-full",
77+
)
78+
79+
5380
def link_item(name: str, url: str, active_str: str = ""):
5481
router_path = rx.State.router.page.path
5582

@@ -406,18 +433,38 @@ def doc_section():
406433

407434
return nav_menu.content(
408435
rx.el.ul(
409-
resource_item(
436+
resource_item_hi(
410437
"AI Builder Docs",
411438
ai_builder.overview.best_practices.path,
412-
"bot",
439+
"magic-wand-01",
440+
0,
441+
),
442+
resource_item_hi(
443+
"Open Source Docs",
444+
getting_started.introduction.path,
445+
"source-code-circle",
413446
0,
414447
),
415-
resource_item(
416-
"Open Source Docs", getting_started.introduction.path, "frame", 0
448+
resource_item_hi(
449+
"Cloud Docs", hosting_page.deploy_quick_start.path, "cloud-server", 0
417450
),
418-
resource_item(
419-
"Cloud Docs", hosting_page.deploy_quick_start.path, "server", 0
451+
class_name="items-start gap-1.5 gap-x-1.5 grid grid-cols-1 m-0 p-1.5 w-[280px] min-w-max",
452+
),
453+
)
454+
455+
456+
def products_section():
457+
458+
return nav_menu.content(
459+
rx.el.ul(
460+
resource_item_hi(
461+
"AI Builder",
462+
REFLEX_BUILD_URL,
463+
"magic-wand-01",
464+
0,
420465
),
466+
resource_item_hi("Open Source", framework.path, "source-code-circle", 0),
467+
resource_item_hi("Cloud", hosting_landing.path, "cloud-server", 0),
421468
class_name="items-start gap-1.5 gap-x-1.5 grid grid-cols-1 m-0 p-1.5 w-[280px] min-w-max",
422469
),
423470
)
@@ -478,18 +525,9 @@ def new_component_section() -> rx.Component:
478525
),
479526
rx.el.div(
480527
nav_menu.item(
481-
link_item(
482-
"AI Builder",
483-
REFLEX_BUILD_URL,
484-
"builder",
485-
),
486-
),
487-
nav_menu.item(
488-
link_item("Open Source", framework.path, "framework"),
489-
class_name="whitespace-nowrap",
490-
),
491-
nav_menu.item(
492-
link_item("Cloud", hosting_landing.path, "hosting"),
528+
new_menu_trigger("Products"),
529+
products_section(),
530+
class_name="cursor-pointer",
493531
),
494532
class_name="xl:flex hidden flex-row items-center gap-0 lg:gap-5 2xl:gap-7 m-0 h-full list-none",
495533
),
@@ -548,7 +586,7 @@ def new_component_section() -> rx.Component:
548586
),
549587
rx.box(
550588
nav_menu.viewport(),
551-
class_name="top-[80%] left-[250px] absolute flex justify-start w-full",
589+
class_name="top-[80%] left-[120px] absolute flex justify-start w-full",
552590
),
553591
)
554592

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies = [
2727
"posthog==6.1.1",
2828
"typesense>=1.1.1",
2929
"fastapi",
30-
"reflex-hosting-cli>=0.1.55",
30+
"reflex-hosting-cli>=0.1.56",
3131
]
3232

3333
[dependency-groups]

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)