Skip to content

Commit 409bacc

Browse files
committed
Format code with ruff
1 parent 0a2621b commit 409bacc

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

pcweb/components/docpage/navbar/navbar.py

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from pcweb.pages.faq import faq
1212
from pcweb.pages.framework.framework import framework
1313
from pcweb.pages.hosting.hosting import hosting_landing
14-
from pcweb.pages.use_cases.use_cases import use_cases_page
1514
from pcweb.pages.use_cases.finance_use_case import finance_use_case_page
15+
from pcweb.pages.use_cases.use_cases import use_cases_page
1616

1717
from ...link_button import resources_button
1818
from ..sidebar import SidebarState
@@ -71,7 +71,12 @@ def link_item(name: str, url: str, active_str: str = ""):
7171
not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting"))
7272
not_ai_builder = ~router_path.contains("ai-builder")
7373
is_framework = (is_docs & not_cloud & not_ai_builder) | is_open_source_page
74-
active = router_path.contains("ai-builder") | router_path.contains("cloud") | router_path.contains("hosting") | is_framework
74+
active = (
75+
router_path.contains("ai-builder")
76+
| router_path.contains("cloud")
77+
| router_path.contains("hosting")
78+
| is_framework
79+
)
7580

7681
elif active_str == "pricing":
7782
active = router_path.contains("pricing")
@@ -365,7 +370,6 @@ def solutions_section():
365370
"url": use_cases_page.path,
366371
"icon": "Database02Icon",
367372
},
368-
369373
{
370374
"label": "External Apps",
371375
"url": use_cases_page.path,
@@ -384,7 +388,6 @@ def solutions_section():
384388
"url": use_cases_page.path,
385389
"icon": "HealthIcon",
386390
},
387-
388391
{
389392
"label": "Consulting",
390393
"url": use_cases_page.path,
@@ -467,24 +470,29 @@ def new_menu_trigger(
467470
) -> rx.Component:
468471
if url:
469472
return ui.navigation_menu.trigger(link_item(title, url, active_str))
470-
473+
471474
router_path = rx.State.router.page.path
472475
active = False
473-
476+
474477
if active_str == "products":
475478
is_docs = router_path.contains("docs")
476479
is_open_source_page = router_path.contains("open-source")
477480
not_cloud = ~(router_path.contains("cloud") | router_path.contains("hosting"))
478481
not_ai_builder = ~router_path.contains("ai-builder")
479482
is_framework = (is_docs & not_cloud & not_ai_builder) | is_open_source_page
480-
active = router_path.contains("ai-builder") | router_path.contains("cloud") | router_path.contains("hosting") | is_framework
483+
active = (
484+
router_path.contains("ai-builder")
485+
| router_path.contains("cloud")
486+
| router_path.contains("hosting")
487+
| is_framework
488+
)
481489
elif active_str:
482490
active = router_path.contains(active_str)
483-
491+
484492
common_cn = "p-[1.406rem_0px] font-medium text-sm transition-colors"
485493
active_cn = "shadow-[inset_0_-0.5px_0_0_var(--c-violet-9)] text-violet-9 group-hover:text-violet-9"
486494
unactive_cn = "shadow-none text-secondary-11 group-hover:text-secondary-12"
487-
495+
488496
return ui.navigation_menu.trigger(
489497
rx.box(
490498
rx.text(
@@ -595,7 +603,11 @@ def products_section():
595603
ui.navigation_menu.content(
596604
rx.el.a(
597605
rx.box(
598-
ui.icon("MagicWand01Icon", size=16, class_name="flex-shrink-0 text-secondary-11"),
606+
ui.icon(
607+
"MagicWand01Icon",
608+
size=16,
609+
class_name="flex-shrink-0 text-secondary-11",
610+
),
599611
rx.text(
600612
"AI Builder",
601613
class_name="font-small text-secondary-11 truncate text-start w-[150px]",
@@ -634,9 +646,6 @@ def products_section():
634646

635647

636648
def new_component_section() -> rx.Component:
637-
from pcweb.pages.docs import ai_builder as ai_builder_pages
638-
from pcweb.pages.docs import hosting as hosting_page
639-
640649
return ui.navigation_menu.root(
641650
ui.navigation_menu.list(
642651
ui.navigation_menu.item(

pcweb/whitelist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- Incorrect: WHITELISTED_PAGES = ["/docs/getting-started/introduction/"]
1111
"""
1212

13-
WHITELISTED_PAGES = []
13+
WHITELISTED_PAGES = ["/blog"]
1414

1515

1616
def _check_whitelisted_path(path: str):

0 commit comments

Comments
 (0)