Skip to content

Commit 1cac2f8

Browse files
10 - Full Width Navbar and Content
1 parent 6636841 commit 1cac2f8

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

full_stack_python/full_stack_python.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ def did_click(self):
1818

1919
def index() -> rx.Component:
2020
# Welcome Page (Index)
21-
return base_page(
22-
rx.vstack(
21+
my_child = rx.vstack(
2322
rx.heading(State.label, size="9"),
2423
rx.text(
2524
"Get started by editing ",
@@ -30,7 +29,7 @@ def index() -> rx.Component:
3029
rx.input(
3130
default_value=State.label,
3231
on_click=State.did_click,
33-
on_change=State.handle_title_input_change
32+
on_change=State.handle_title_input_change,
3433
),
3534
rx.link(
3635
rx.button("Check out our docs!"),
@@ -39,9 +38,12 @@ def index() -> rx.Component:
3938
),
4039
spacing="5",
4140
justify="center",
41+
align="center",
42+
# text_align="center",
4243
min_height="85vh",
44+
id='my-child'
4345
)
44-
)
46+
return base_page(my_child)
4547

4648

4749
app = rx.App()

full_stack_python/ui/base.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ def base_page(child: rx.Component, hide_navbar=False, *args, **kwargs) -> rx.Com
1212
rx.logo(),
1313
rx.color_mode.button(position="bottom-left"),
1414
)
15-
return rx.container(
15+
return rx.fragment( # renders nada
1616
navbar(),
17-
child,
17+
rx.box(
18+
child,
19+
# bg=rx.color("accent", 3),
20+
padding="1em",
21+
width="100%",
22+
id="my-content-area-el"
23+
),
1824
rx.logo(),
19-
rx.color_mode.button(position="bottom-left", id='my-light-mode-btn'),
25+
rx.color_mode.button(position="bottom-left"),
26+
padding='10em',
2027
id="my-base-container"
2128
)

0 commit comments

Comments
 (0)