Skip to content

Commit 1358e00

Browse files
authored
Update marketing navbar (#6805)
1 parent 416eb34 commit 1358e00

6 files changed

Lines changed: 265 additions & 286 deletions

File tree

docs/app/reflex_docs/views/docs_navbar.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,17 @@ def menu_item(text: str, href: str, active_str: str = "") -> rx.Component:
8383
"/docs/ai/"
8484
)
8585
is_hosting = router_path.contains("hosting")
86-
active = ~is_overview & ~is_ai_builder & ~is_hosting
86+
is_xy = router_path.startswith("/xy/") | router_path.startswith("/docs/xy/")
87+
active = ~is_overview & ~is_ai_builder & ~is_hosting & ~is_xy
8788
elif active_str == "ai":
8889
active = router_path.startswith("/ai/") | router_path.startswith("/docs/ai/")
90+
elif active_str == "xy":
91+
active = router_path.startswith("/xy/") | router_path.startswith("/docs/xy/")
8992
else:
9093
active = router_path.contains(active_str)
9194

9295
return ui.navigation_menu.item(
93-
rx.el.a(
96+
rx.el.elements.a(
9497
button(
9598
text,
9699
size="sm",
@@ -114,6 +117,7 @@ def navigation_menu() -> rx.Component:
114117
menu_item("Build with AI", ai_builder.overview.best_practices.path, "ai"),
115118
menu_item("Framework", getting_started.introduction.path, "framework"),
116119
menu_item("Cloud", hosting.deploy_quick_start.path, "hosting"),
120+
menu_item("XY", "/docs/xy/", "xy"),
117121
class_name="flex flex-row items-center gap-2 m-0 h-full list-none",
118122
custom_attrs={"role": "menubar"},
119123
),

packages/reflex-site-shared/src/reflex_site_shared/pages/page404.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
from reflex_site_shared.templates.webpage import webpage
66

77

8-
@webpage(path="/404", title="Page Not Found · Reflex.dev", add_as_page=False)
8+
@webpage(
9+
path="/404",
10+
title="Page Not Found · Reflex.dev",
11+
add_as_page=False,
12+
show_banner=False,
13+
)
914
def page404():
1015
"""Page404.
1116

packages/reflex-site-shared/src/reflex_site_shared/styles/assets/tailwind-theme.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,9 @@
11521152
--shadow-card-xs-no-left: var(--shadow-card-xs-no-left-adaptive);
11531153
--shadow-card-small: var(--shadow-card-small-adaptive);
11541154
--shadow-card-dark: 0 0 0 1px var(--secondary-4);
1155+
--spacing-gutter: clamp(1.5rem, 0.5rem + 5.2vw, 6rem);
1156+
--text-caption: 0.75rem;
1157+
--text-caption--line-height: 1rem;
11551158
--text-xs: 0.8125rem;
11561159
--text-xs--line-height: 1.25rem;
11571160
--text-sm: 0.875rem;
@@ -1669,6 +1672,15 @@
16691672
}
16701673

16711674
@layer utilities {
1675+
.rule-dashed-b {
1676+
background-image: repeating-linear-gradient(to right,
1677+
var(--color-secondary-8) 0 1px,
1678+
transparent 1px 4px);
1679+
background-repeat: no-repeat;
1680+
background-size: 100% 1px;
1681+
background-position: left bottom;
1682+
}
1683+
16721684
.font-instrument-sans {
16731685
font-family: var(--font-instrument-sans);
16741686
}

packages/reflex-site-shared/src/reflex_site_shared/templates/webpage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def webpage(
1818
meta: list[dict[str, str]] | None = None,
1919
props: dict | None = None,
2020
add_as_page: bool = True,
21+
show_banner: bool = True,
2122
) -> Callable:
2223
"""A template that most pages on the reflex.dev site should use.
2324
@@ -31,6 +32,7 @@ def webpage(
3132
meta: Additional meta tags to add to the page.
3233
props: Props to apply to the template.
3334
add_as_page: whether to add the route to the app pages.
35+
show_banner: Whether to show the hosting banner above the navbar.
3436
3537
Returns:
3638
A wrapper function that returns the full webpage.
@@ -67,7 +69,7 @@ def wrapper(*children, **props) -> rx.Component:
6769
# Wrap the component in the template.
6870
return rx.box(
6971
*default_patterns(),
70-
marketing_navbar(),
72+
marketing_navbar(show_banner=show_banner),
7173
rx.el.main(
7274
contents(*children, **props),
7375
rx.box(class_name="flex-grow"),

0 commit comments

Comments
 (0)