Skip to content

Commit

Permalink
feat: accommodate new company info pages
Browse files Browse the repository at this point in the history
  • Loading branch information
iisakkirotko committed Sep 5, 2024
1 parent 7268083 commit ae05356
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 15 deletions.
16 changes: 9 additions & 7 deletions solara/website/components/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ def Header(
with solara.Button(icon=True, class_="hidden-md-and-up", on_click=lambda: on_toggle_left_menu and on_toggle_left_menu()):
rv.Icon(children=["mdi-menu"])

display = " d-none d-sm-flex" if route_current is not None and route_current.path not in ["about", "pricing", "careers"] else " d-flex"
with solara.v.Html(
tag="div",
class_="header-logo-container d-none d-sm-flex",
class_="header-logo-container" + display,
style_="""
background-color: transparent;
flex-grow: 1;
Expand All @@ -46,16 +47,17 @@ def Header(
solara.Image(router.root_path + f"/static/assets/images/logo{'_white' if dark_effective else ''}.svg", classes=["header-logo"])
solara.Text("API", style={"font-size": "20px", "font-weight": "600"})

if settings.search.enabled:
from solara_enterprise.search.search import Search
if route_current is not None and route_current.path not in ["about", "pricing", "careers"]:
if settings.search.enabled:
from solara_enterprise.search.search import Search

Search()
else:
Algolia()
Search()
else:
Algolia()

with rv.Html(tag="ul", class_="main-menu menu d-none d-md-flex", style_="justify-content: flex-end;"):
for route in all_routes:
if route.path in ["apps", "contact", "changelog"]:
if route.path in ["apps", "contact", "changelog", "our_team", "about", "pricing", "roadmap", "careers"]:
continue
current = route_current == route
with rv.Html(tag="li", class_="active" if current else None):
Expand Down
4 changes: 3 additions & 1 deletion solara/website/components/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def MarkdownWithMetadata(content: str, unsafe_solara_execute=True):
solara.Meta(property=key, content=value)
else:
solara.Meta(name=key, content=value)
with solara.v.Html(tag="div", style_="display: flex; flex-direction: row; gap: 15px;", attributes={"id": "markdown-to-navigate"}):
with solara.v.Html(
tag="div", style_="display: flex; flex-direction: row; gap: 15px; max-width: 90%; margin: 0 auto;", attributes={"id": "markdown-to-navigate"}
):
solara.Markdown(content, unsafe_solara_execute=unsafe_solara_execute, style="flex-grow: 1;")
MarkdownNavigation(id="markdown-to-navigate").key("markdown-nav" + str(hash(content)))

Expand Down
4 changes: 4 additions & 0 deletions solara/website/components/sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,9 @@ def Sidebar():
with solara.v.ListItem(value="/changelog"):
solara.v.ListItemIcon(children=[solara.v.Icon(children=["mdi-history"])])
solara.v.ListItemTitle(style_="padding: 0 20px;", children=["Changelog"])
with solara.Link("/roadmap"):
with solara.v.ListItem(value="/roadmap"):
solara.v.ListItemIcon(children=[solara.v.Icon(children=["mdi-road"])])
solara.v.ListItemTitle(style_="padding: 0 20px;", children=["Roadmap"])

return main
3 changes: 2 additions & 1 deletion solara/website/pages/careers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def Page():
"""
# Careers
We are always looking for talented individuals to join our team. If you're still be interested after reading the rest of this page, reach out at [[email protected]](mailto:[email protected]).
"""
""",
style={"max-width": "90%", "margin": "0 auto"},
)
with solara.Row(style={"flex-wrap": "wrap", "align-items": "stretch"}, gap="0"):
with Tile():
Expand Down
4 changes: 2 additions & 2 deletions solara/website/pages/changelog/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from pathlib import Path

import solara
from solara.website.components.sidebar import Sidebar
from solara.website.components import MarkdownWithMetadata

title = "Changelog"
HERE = Path(__file__)

Page = solara.Markdown(Path(HERE.parent / "changelog.md").read_text())
Page = MarkdownWithMetadata(Path(HERE.parent / "changelog.md").read_text())
Sidebar = Sidebar
8 changes: 4 additions & 4 deletions solara/website/pages/our_team/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@solara.component
def Page():
with solara.Column(gap="40px"):
with solara.Column(gap="40px", style={"max-width": "90%"}):
solara.Markdown("""
# Our Team
Expand Down Expand Up @@ -54,12 +54,12 @@ def DevCard(
website=None,
email=None,
):
with solara.Row(gap="40px", style={"align-items": "stretch"}):
with solara.Div(style={"flex": "1 0 200px", "border-radius": "15px", "overflow": "hidden", "aspect-ratio": "1/1"}):
with solara.Row(gap="40px", style={"align-items": "stretch", "max-height": "300px", "flex": "1 1 auto"}):
with solara.Div(style={"flex": "0 1 300px", "border-radius": "15px", "overflow": "hidden", "aspect-ratio": "1/1"}):
solara.v.Html(
tag="img",
attributes={"src": image or "https://dxhl76zpt6fap.cloudfront.net/public/logo.svg", "alt": name},
style_="width: 100%; height: 100%; object-fit: cover;",
style_="height: 100%; aspect-ratio: 1; object-fit: cover;",
)
with solara.Column():
solara.HTML(tag="h2", unsafe_innerHTML=name)
Expand Down
2 changes: 2 additions & 0 deletions solara/website/pages/roadmap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from pathlib import Path

from solara.website.components.markdown import MarkdownWithMetadata
from solara.website.components.sidebar import Sidebar


title = "Roadmap"
HERE = Path(__file__)
Sidebar = Sidebar

Page = MarkdownWithMetadata(Path(HERE.parent / "roadmap.md").read_text())

0 comments on commit ae05356

Please sign in to comment.