66from reflex_site_shared .constants import DISCORD_URL , GITHUB_URL , TWITTER_URL
77from reflex_site_shared .views .hosting_banner import HostingBannerState
88
9- _DRAWER_LINKS_DOCS = "/docs"
10- _DRAWER_LINKS_TEMPLATES = "/templates"
11- _DRAWER_LINKS_BLOG = "/blog"
12- _DRAWER_LINKS_CUSTOMERS = "/customers"
13- _DRAWER_LINKS_LIBRARY = "/docs/library"
14- _DRAWER_LINKS_OPEN_SOURCE = "/open-source"
15- _DRAWER_LINKS_HOSTING = "/hosting"
16- _DRAWER_LINKS_PRICING = "/pricing"
17-
189
1910def social_menu_item (
2011 icon : str ,
@@ -49,29 +40,14 @@ def drawer_socials() -> rx.Component:
4940 )
5041
5142
52- def drawer_item (text : str , url : str , active_str : str = "" ) -> rx .Component :
53- router_path = rx .State .router .page .path
43+ def drawer_item (text : str , url : str ) -> rx .Component :
5444 if not url .endswith ("/" ):
5545 url += "/"
56- active = router_path .contains (active_str )
57- if active_str == "docs" :
58- is_docs_home = (router_path == "/" ) | (router_path == "/index" )
59- active = rx .cond (
60- is_docs_home ,
61- False ,
62- ~ router_path .contains ("hosting" )
63- & ~ router_path .contains ("library" )
64- & ~ router_path .contains ("gallery" )
65- & ~ router_path .startswith ("/ai/" )
66- & ~ router_path .startswith ("/docs/ai/" ),
67- )
68- if active_str == "" :
69- active = False
7046 return rx .el .elements .a (
7147 text ,
7248 href = url ,
7349 underline = "none" ,
74- color = rx . cond ( active , "var(--c-violet-9)" , "var(--c- slate-9)") ,
50+ color = "var(--c-slate-9)" ,
7551 class_name = "flex justify-center items-center border-slate-4 px-4 py-[0.875rem] border-t-0 border-b border-solid w-full font-small hover:!text-violet-9 border-x-0" ,
7652 )
7753
@@ -84,16 +60,14 @@ def navbar_sidebar_drawer(trigger) -> rx.Component:
8460 rx .drawer .portal (
8561 rx .drawer .content (
8662 rx .box (
87- drawer_item ("Docs" , _DRAWER_LINKS_DOCS , "docs" ),
88- drawer_item ("Templates" , _DRAWER_LINKS_TEMPLATES , "templates" ),
89- drawer_item ("Blog" , _DRAWER_LINKS_BLOG , "blog" ),
90- drawer_item ("Case Studies" , _DRAWER_LINKS_CUSTOMERS , "customers" ),
91- drawer_item ("Components" , _DRAWER_LINKS_LIBRARY , "library" ),
92- drawer_item (
93- "Open Source" , _DRAWER_LINKS_OPEN_SOURCE , "open-source"
94- ),
95- drawer_item ("Cloud" , _DRAWER_LINKS_HOSTING , "hosting" ),
96- drawer_item ("Pricing" , _DRAWER_LINKS_PRICING , "pricing" ),
63+ drawer_item ("Docs" , "/docs" ),
64+ drawer_item ("Templates" , "/templates" ),
65+ drawer_item ("Blog" , "/blog" ),
66+ drawer_item ("Case Studies" , "/customers" ),
67+ drawer_item ("Components" , "/docs/library" ),
68+ drawer_item ("Open Source" , "/open-source" ),
69+ drawer_item ("Cloud" , "/hosting" ),
70+ drawer_item ("Pricing" , "/pricing" ),
9771 drawer_socials (),
9872 rx .el .button (
9973 rx .color_mode .icon (
0 commit comments