Skip to content

Commit 34e8b68

Browse files
authored
fixed hosting banner close function (#1161)
* fixed hosting banner close function * Removed whitespace --------- Co-authored-by: pourhakimi <[email protected]>
1 parent 02ee94c commit 34e8b68

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

pcweb/components/hosting_banner.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,36 @@ def hide_banner(self):
2121
def hosting_banner() -> rx.Component:
2222
return rx.cond(
2323
HostingBannerState.show_banner,
24-
rx.link(
25-
rx.box(
24+
rx.hstack(
25+
rx.link(
2626
rx.box(
27-
rx.text(
28-
"Reflex Cloud - ",
29-
rx.el.span(
30-
"Fast, secure & scalable hosting. One command to deploy.",
31-
class_name="text-slate-12 font-medium text-sm",
27+
rx.box(
28+
rx.text(
29+
"Reflex Cloud - ",
30+
rx.el.span(
31+
"Fast, secure & scalable hosting. One command to deploy.",
32+
class_name="text-slate-12 font-medium text-sm",
33+
),
34+
class_name="text-slate-12 font-semibold text-sm z-[1]",
3235
),
33-
class_name="text-slate-12 font-semibold text-sm z-[1]",
34-
),
35-
rx.el.button(
36-
"Live Now!",
37-
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",
36+
rx.el.button(
37+
"Live Now!",
38+
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",
39+
),
40+
class_name="flex items-center gap-4",
3841
),
39-
class_name="flex items-center gap-4",
4042
),
43+
glow(),
44+
href=REFLEX_CLOUD_URL,
45+
underline="none",
46+
is_external=True,
4147
),
4248
rx.icon(
4349
"x",
4450
on_click=HostingBannerState.hide_banner,
4551
size=16,
46-
class_name="z-[1] cursor-pointer hover:!text-slate-11 transition-color !text-slate-9 absolute right-4",
52+
class_name="cursor-pointer hover:!text-slate-11 transition-color !text-slate-9 absolute right-4 z-10",
4753
),
48-
glow(),
49-
href=REFLEX_CLOUD_URL,
50-
underline="none",
51-
is_external=True,
5254
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",
5355
),
5456
)

pcweb/pcweb.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# higher and the prod build fails with EMFILE error.
1717
WINDOWS_MAX_ROUTES = int(os.environ.get("REFLEX_WEB_WINDOWS_MAX_ROUTES", "100"))
1818

19-
2019
# Execute all the exec blocks in the documents.
2120
for doc, href in outblocks:
2221
exec_blocks(doc, href)
@@ -49,7 +48,6 @@
4948
],
5049
)
5150

52-
5351
# XXX: The app is TOO BIG to build on Windows, so explicitly disallow it except for testing
5452
if sys.platform == "win32":
5553
if not os.environ.get("REFLEX_WEB_WINDOWS_OVERRIDE"):
@@ -59,7 +57,6 @@
5957
)
6058
routes = routes[:WINDOWS_MAX_ROUTES]
6159

62-
6360
# Add the pages to the app.
6461
for route in routes:
6562
# print(f"Adding route: {route}")

pcweb/whitelist.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
# A list of whitelist paths that should be built.
2-
# If the list is empty, all pages will be built.
3-
1+
# A list of whitelist paths that should be built.
2+
# If the list is empty, all pages will be built.
3+
44
# Tips:
5-
# - Ensure that the path starts with a forward slash '/'.
5+
# - Ensure that the path starts with a forward slash '/'.
66
# - Do not include a trailing slash '/' at the end of the path.
77

88
# Examples:
9-
# - Correct: WHITELISTED_PAGES = ["/docs/getting-started/introduction"]
9+
# - Correct: WHITELISTED_PAGES = ["/docs/getting-started/introduction"]
1010
# - Incorrect: WHITELISTED_PAGES = ["/docs/getting-started/introduction/"]
1111

12-
WHITELISTED_PAGES = []
12+
WHITELISTED_PAGES = []
13+
1314

1415
def _check_whitelisted_path(path):
1516
if len(WHITELISTED_PAGES) == 0:
16-
return True
17+
return True
1718

1819
# If the path is the root, always build it.
1920
if path == "/":
2021
return True
2122

2223
if len(WHITELISTED_PAGES) == 1 and WHITELISTED_PAGES[0] == "/":
2324
return False
24-
25+
2526
for whitelisted_path in WHITELISTED_PAGES:
2627
if path.startswith(whitelisted_path):
2728
return True

0 commit comments

Comments
 (0)