Skip to content

Commit 27eeaaa

Browse files
authored
Merge branch 'main' into ahmad/navbar-hover
2 parents 99b95c7 + 0b2a820 commit 27eeaaa

File tree

4 files changed

+77
-26
lines changed

4 files changed

+77
-26
lines changed

pcweb/components/docpage/navbar/navbar.py

Lines changed: 64 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -274,32 +274,76 @@ def grid_card_unique(title: str, description: str, url: str, component) -> rx.Co
274274

275275

276276
def new_resource_section():
277-
return nav_menu.content(
278-
rx.box(
279-
# Links
277+
_company_items = [
278+
{"label": "Newsletter", "url": "#newsletter", "icon": "mails"},
279+
{"label": "Blog", "url": "/blog", "icon": "library-big"},
280+
]
281+
282+
_open_source_items = [
283+
{"label": "Templates", "url": "/templates", "icon": "layout-panel-top"},
284+
{"label": "Changelog", "url": changelog.path, "icon": "history"},
285+
{
286+
"label": "Contributing",
287+
"url": "https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md",
288+
"icon": "handshake",
289+
},
290+
{
291+
"label": "Discussions",
292+
"url": "https://github.com/orgs/reflex-dev/discussions",
293+
"icon": "message-square-text",
294+
},
295+
{
296+
"label": "FAQ",
297+
"url": faq.path,
298+
"icon": "table-of-contents",
299+
},
300+
]
301+
302+
def _link_button(label: str, url: str, icon: str) -> rx.Component:
303+
return rx.link(
304+
resources_button(
305+
rx.icon(icon, class_name="size-4"),
306+
label,
307+
size="md",
308+
variant="transparent",
309+
class_name="justify-start w-full items-center",
310+
),
311+
href=url,
312+
is_external=True,
313+
underline="none",
314+
class_name="!w-full",
315+
)
316+
317+
def _resource_section_column(
318+
section_title: str, resource_item: list[dict[str, str]]
319+
):
320+
return rx.box(
280321
rx.box(
281-
link_button("Changelog", changelog.path),
282-
link_button(
283-
"Contributing",
284-
"https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md",
322+
rx.text(
323+
section_title,
324+
class_name="text-sm text-slate-10 font-semibold px-2.5 py-1",
285325
),
286-
link_button(
287-
"Discussions", "https://github.com/orgs/reflex-dev/discussions"
326+
rx.foreach(
327+
resource_item,
328+
lambda item: _link_button(item["label"], item["url"], item["icon"]),
288329
),
289-
link_button("FAQ", faq.path),
290330
class_name="flex flex-col w-full p-2",
291331
),
292-
class_name="flex flex-col w-full max-w-[10.1875rem] border-r border-slate-5",
293-
),
332+
class_name="flex flex-col w-full max-w-[9.1875rem]",
333+
)
334+
335+
return nav_menu.content(
336+
_resource_section_column("Open Source", _open_source_items),
337+
_resource_section_column("Company", _company_items),
294338
# Grid cards
295339
rx.box(
296-
grid_card(
297-
"Blog",
298-
"See what's new in the Reflex ecosystem.",
299-
f"/blog",
300-
"/blog/top_python_web_frameworks.png",
301-
"absolute bottom-0 rounded-tl-md",
302-
),
340+
# grid_card(
341+
# "Blog",
342+
# "See what's new in the Reflex ecosystem.",
343+
# f"/blog",
344+
# "/blog/top_python_web_frameworks.png",
345+
# "absolute bottom-0 rounded-tl-md",
346+
# ),
303347
grid_card(
304348
"Customers",
305349
"Meet the teams who chose Reflex.",
@@ -312,7 +356,7 @@ def new_resource_section():
312356
),
313357
class_name="grid grid-cols-2 gap-3 p-3 bg-slate-1",
314358
),
315-
class_name="flex flex-row shadow-large rounded-xl bg-slate-2 border border-slate-5 w-[41.55rem] font-sans overflow-hidden",
359+
class_name="flex flex-row shadow-large rounded-xl bg-slate-2 border border-slate-5 w-[34.55rem] font-sans overflow-hidden",
316360
)
317361

318362

pcweb/components/docpage/sidebar/sidebar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def sidebar_item_comp(
151151
),
152152
rx.box(class_name="flex-grow"),
153153
rx.accordion.icon(class_name="size-4"),
154-
class_name="flex items-center !bg-transparent !hover:bg-transparent !py-2 !pr-0 !pl-2 w-full text-slate-9 aria-expanded:text-slate-11 hover:text-slate-11 transition-color",
154+
class_name="flex items-center !bg-transparent !hover:bg-transparent !py-2 !pr-0 w-full text-slate-9 aria-expanded:text-slate-11 hover:text-slate-11 transition-color",
155155
),
156156
),
157157
rx.accordion.content(
@@ -168,7 +168,7 @@ def sidebar_item_comp(
168168
type="multiple",
169169
collapsible=True,
170170
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
171-
class_name="!my-2 flex flex-col items-start gap-4 !ml-[15px] list-none [box-shadow:inset_1.25px_0_0_0_var(--c-slate-4)]",
171+
class_name="!my-2 flex flex-col items-start gap-4 !ml-[10px] list-none [box-shadow:inset_1.25px_0_0_0_var(--c-slate-4)]",
172172
),
173173
class_name="!p-0 w-full",
174174
),

pcweb/components/hosting_banner.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@ def hosting_banner() -> rx.Component:
3030
"Reflex Cloud - ",
3131
rx.el.span(
3232
"Fast, secure & scalable hosting. One command to deploy.",
33-
class_name="text-slate-12 font-medium text-sm",
33+
# class_name="text-slate-12 font-medium text-sm",
34+
class_name="hidden md:inline-block text-slate-12 font-medium text-sm",
35+
),
36+
rx.el.span(
37+
"Fast & scalable hosting.",
38+
# class_name="text-slate-12 font-medium text-sm",
39+
class_name="inline-block md:hidden text-slate-12 font-medium text-sm",
3440
),
3541
class_name="text-slate-12 font-semibold text-sm z-[1]",
3642
),
3743
rx.el.button(
3844
"Live Now!",
39-
class_name="text-green-11 h-[1.5rem] rounded-md bg-green-4 px-1.5 text-sm font-semibold z-[1] items-center justify-center shrink-0",
45+
class_name="hidden md:inline-block text-green-11 h-[1.5rem] rounded-md bg-green-4 px-1.5 text-sm font-semibold z-[1] items-center justify-center shrink-0",
4046
),
4147
class_name="flex items-center gap-4",
4248
),
@@ -52,6 +58,6 @@ def hosting_banner() -> rx.Component:
5258
size=16,
5359
class_name="cursor-pointer hover:!text-slate-11 transition-color !text-slate-9 absolute right-4 z-10",
5460
),
55-
class_name="px-4 lg:px-6 w-screen h-auto lg:h-[3.5rem] shadow-[inset_0_-1px_0_0_var(--c-slate-3)] flex items-center justify-center bg-slate-1 flex-row gap-4 overflow-hidden relative lg:py-0 py-2 max-w-full",
61+
class_name="px-4 lg:px-6 w-screen h-auto lg:h-[3.5rem] shadow-[inset_0_-1px_0_0_var(--c-slate-3)] flex items-center justify-between md:justify-center bg-slate-1 flex-row gap-4 overflow-hidden relative lg:py-0 py-2 max-w-full",
5662
),
5763
)

pcweb/pages/index/views/os_newsletter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ def newsletter_card() -> rx.Component:
123123
class_name="flex flex-col gap-2",
124124
),
125125
newletter_input(),
126-
class_name="flex flex-col gap-8 w-full p-10 pb-12 lg:!border-r !border-slate-3 items-center lg:items-start text-center lg:text-start",
126+
id="newsletter",
127+
class_name="flex flex-col gap-8 w-full p-10 pb-12 lg:!border-r !border-slate-3 items-center lg:items-start text-center lg:text-start scroll-mt-72",
127128
)
128129

129130

0 commit comments

Comments
 (0)