BLUR-32 sidebar modification

This commit is contained in:
markrz12 2023-11-22 15:54:26 +01:00
parent 1b7d6c6459
commit d3a1c28d94
8 changed files with 15 additions and 40 deletions

BIN
assets/about-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

BIN
assets/contact-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

BIN
assets/home-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

BIN
assets/image-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

View File

@ -7,9 +7,7 @@ import reflex as rx
def sidebar_header() -> rx.Component: def sidebar_header() -> rx.Component:
"""Sidebar header. """Returns:
Returns:
The sidebar header component. The sidebar header component.
""" """
return rx.hstack( return rx.hstack(
@ -19,36 +17,12 @@ def sidebar_header() -> rx.Component:
height="4.5em", height="4.5em",
), ),
rx.spacer(), rx.spacer(),
# Link to Reflex GitHub repo.
width="100%", width="100%",
border_bottom=styles.border, border_bottom=styles.border,
padding="1em", padding="1em",
) )
def sidebar_item(text: str, icon: str, url: str, ) -> rx.Component:
#def sidebar_footer() -> rx.Component:
"""Sidebar footer.
Returns:
The sidebar footer component.
"""
# return rx.hstack(
# rx.spacer(),
# rx.link(
# rx.text("Docs"),
# href="https://reflex.dev/docs/getting-started/introduction/",
# ),
# rx.link(
# rx.text("Blog"),
# href="https://reflex.dev/blog/",
# ),
# width="100%",
# border_top=styles.border,
# padding="1em",
# )
def sidebar_item(text: str, url: str) -> rx.Component:
#icon: str,
"""Sidebar item. """Sidebar item.
Args: Args:
@ -66,11 +40,11 @@ def sidebar_item(text: str, url: str) -> rx.Component:
return rx.link( return rx.link(
rx.hstack( rx.hstack(
#rx.image( rx.image(
# src=icon, src=icon,
# height="2.5em", height="2.5em",
# padding="0.5em", padding="0.5em",
#), ),
rx.text( rx.text(
text, text,
), ),
@ -87,11 +61,12 @@ def sidebar_item(text: str, url: str) -> rx.Component:
border_radius=styles.border_radius, border_radius=styles.border_radius,
box_shadow=styles.box_shadow, box_shadow=styles.box_shadow,
width="100%", width="100%",
padding_x="1em", padding_x="1.3em",
height = "2em" height = "2.5em"
), ),
href=url, href=url,
width="100%", width="100%",
) )
@ -111,7 +86,7 @@ def sidebar() -> rx.Component:
*[ *[
sidebar_item( sidebar_item(
text=page.get("title", page["route"].strip("/").capitalize()), text=page.get("title", page["route"].strip("/").capitalize()),
#icon=page.get("image", "/github.svg"), icon=page.get("image",page["route"].strip("/").capitalize()),
url=page["route"], url=page["route"],
) )
for page in get_decorated_pages() for page in get_decorated_pages()
@ -123,7 +98,7 @@ def sidebar() -> rx.Component:
), ),
rx.spacer(), rx.spacer(),
#sidebar_footer(), #sidebar_footer(),
height="100dvh", height="100em",
), ),
display=["none", "none", "block"], display=["none", "none", "block"],
min_width=styles.sidebar_width, min_width=styles.sidebar_width,

View File

@ -4,7 +4,7 @@ from blurme.templates import template
import reflex as rx import reflex as rx
@template(route="/dashboard", title="Dashboard") @template(route="/dashboard", title="Kontakt", image = "/contact-icon.png")
def dashboard() -> rx.Component: def dashboard() -> rx.Component:
"""The dashboard page. """The dashboard page.

View File

@ -5,7 +5,7 @@ from blurme.templates import template
import reflex as rx import reflex as rx
@template(route="/", title="Strona główna", image="/github.svg") @template(route="/", title="Strona główna", image = "/home-icon.png")
def index() -> rx.Component: def index() -> rx.Component:
return rx.vstack( return rx.vstack(
rx.heading("Witaj w BlurMe!", font_size="3em", margin_bottom="25px", background_image="linear-gradient(271.68deg, #7566fe 0.75%, #f96caf 88.52%)", background_clip="text", padding = "10px"), rx.heading("Witaj w BlurMe!", font_size="3em", margin_bottom="25px", background_image="linear-gradient(271.68deg, #7566fe 0.75%, #f96caf 88.52%)", background_clip="text", padding = "10px"),

View File

@ -4,7 +4,7 @@ from blurme.templates import template
import reflex as rx import reflex as rx
@template(route="/settings", title="Settings") @template(route="/settings", title="Zdjęcie", image = "/image-icon.png")
def settings() -> rx.Component: def settings() -> rx.Component:
return rx.vstack( return rx.vstack(
rx.heading("BlurMe", font_size="3em", margin_bottom="25px", background_image="linear-gradient(271.68deg, #7566fe 0.75%, #f96caf 88.52%)", background_clip="text", padding = "10px"), rx.heading("BlurMe", font_size="3em", margin_bottom="25px", background_image="linear-gradient(271.68deg, #7566fe 0.75%, #f96caf 88.52%)", background_clip="text", padding = "10px"),