|
14 | 14 | from pcweb.pages.hosting.hosting import hosting_landing |
15 | 15 | from pcweb.pages.use_cases.use_cases import use_cases_page |
16 | 16 | 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 |
18 | 18 | from ...link_button import resources_button |
19 | 19 | from ..sidebar import SidebarState |
20 | 20 | from .buttons.discord import discord |
@@ -50,6 +50,33 @@ def resource_item(text: str, url: str, icon: str, index): |
50 | 50 | ) |
51 | 51 |
|
52 | 52 |
|
| 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 | + |
53 | 80 | def link_item(name: str, url: str, active_str: str = ""): |
54 | 81 | router_path = rx.State.router.page.path |
55 | 82 |
|
@@ -406,18 +433,38 @@ def doc_section(): |
406 | 433 |
|
407 | 434 | return nav_menu.content( |
408 | 435 | rx.el.ul( |
409 | | - resource_item( |
| 436 | + resource_item_hi( |
410 | 437 | "AI Builder Docs", |
411 | 438 | 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", |
413 | 446 | 0, |
414 | 447 | ), |
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 |
417 | 450 | ), |
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, |
420 | 465 | ), |
| 466 | + resource_item_hi("Open Source", framework.path, "source-code-circle", 0), |
| 467 | + resource_item_hi("Cloud", hosting_landing.path, "cloud-server", 0), |
421 | 468 | 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", |
422 | 469 | ), |
423 | 470 | ) |
@@ -478,18 +525,9 @@ def new_component_section() -> rx.Component: |
478 | 525 | ), |
479 | 526 | rx.el.div( |
480 | 527 | 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", |
493 | 531 | ), |
494 | 532 | class_name="xl:flex hidden flex-row items-center gap-0 lg:gap-5 2xl:gap-7 m-0 h-full list-none", |
495 | 533 | ), |
@@ -548,7 +586,7 @@ def new_component_section() -> rx.Component: |
548 | 586 | ), |
549 | 587 | rx.box( |
550 | 588 | 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", |
552 | 590 | ), |
553 | 591 | ) |
554 | 592 |
|
|
0 commit comments