-
Notifications
You must be signed in to change notification settings - Fork 233
ENG-6355: template for highlight pages #1440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b3b658b
template for highlight pages
LineIndent 1bdba86
update navbar too
LineIndent 164b18b
Merge branch 'main' into ahmad/make-page-template
LineIndent af2ee88
re-structure page decorator for use-cases & databricks
LineIndent 11dc11c
remove use cases from sidebar
LineIndent 4c45542
Merge branch 'main' into ahmad/make-page-template
LineIndent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,14 @@ | ||
|
|
||
| import reflex as rx | ||
|
|
||
| import flexdown | ||
| import reflex as rx | ||
| from pcweb.flexdown import xd2 as xd | ||
| from pcweb.components.docpage.navbar import navbar | ||
| from pcweb.pages.customers.views.footer import footer_customer | ||
| from pcweb.views.bottom_section.bottom_section import bottom_section | ||
| from pcweb.pages.framework.index_colors import index_colors | ||
|
|
||
| from pcweb.templates.highlightpage import highlight_page | ||
|
|
||
| document = flexdown.parse_file("pcweb/pages/databricks/databricks.md") | ||
|
|
||
| def databricks_content(): | ||
| def databricks_content() -> rx.Component: | ||
| return rx.box(xd.render(document, document.filename)) | ||
|
|
||
|
|
||
| @rx.page(route="/databricks", title="Databricks - Reflex") | ||
| def databricks(): | ||
| return rx.box( | ||
| rx.box( | ||
| index_colors(), | ||
| navbar(), | ||
| rx.el.main( | ||
| databricks_content(), | ||
| rx.box(class_name="flex-grow"), | ||
| class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20", | ||
| ), | ||
| rx.box(class_name="h-[1px] bg-slate-3 w-full"), | ||
| bottom_section(), | ||
| footer_customer(), | ||
| class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans gap-4 mx-auto max-w-[64.19rem] lg:border-x border-slate-3 pt-24 lg:pt-48", | ||
| ), | ||
| class_name="relative overflow-hidden", | ||
| ) | ||
| @highlight_page(route="/databricks", title="Databricks - Reflex") | ||
| def databricks_page(): | ||
| return databricks_content() |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import flexdown | ||
| import reflex as rx | ||
| from pcweb.flexdown import xd2 as xd | ||
|
|
||
| from pcweb.templates.highlightpage import highlight_page | ||
|
|
||
| document = flexdown.parse_file("pcweb/pages/use_cases/use_cases.md") | ||
|
|
||
| def use_cases_content() -> rx.Component: | ||
| return rx.box(xd.render(document, document.filename)) | ||
|
|
||
| @highlight_page(route="/use-cases", title="Use Cases - Reflex") | ||
| def use_cases_page(): | ||
| return use_cases_content() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import reflex as rx | ||
|
|
||
| from reflex.event import EventType | ||
| from typing import Callable, Any | ||
| from pcweb.components.docpage.navbar import navbar | ||
| from pcweb.pages.customers.views.footer import footer_customer | ||
| from pcweb.views.bottom_section.bottom_section import bottom_section | ||
| from pcweb.pages.framework.index_colors import index_colors | ||
|
|
||
| def highlight_page( | ||
| route: str | None = None, | ||
| title: str | None = None, | ||
| image: str | None = None, | ||
| description: str | None = None, | ||
| meta: list[Any] | None = None, | ||
| script_tags: list[Any] | None = None, | ||
| on_load: EventType[()] | None = None, | ||
| ) -> Callable[[Callable[[], rx.Component]], Callable[[], rx.Component]]: | ||
| """Decorator that wraps a page's main content in a consistent layout and registers it with rx.page.""" | ||
|
|
||
| def decorator(page_func: Callable[[], rx.Component]) -> Callable[[], rx.Component]: | ||
| @rx.page( | ||
| route=route, | ||
| title=title, | ||
| image=image, | ||
| description=description, | ||
| meta=meta, | ||
| script_tags=script_tags, | ||
| on_load=on_load, | ||
| ) | ||
| def wrapped_page() -> rx.Component: | ||
| content = page_func() | ||
| return rx.box( | ||
| rx.box( | ||
| index_colors(), | ||
| navbar(), | ||
| rx.el.main( | ||
| content, | ||
| rx.box(class_name="flex-grow"), | ||
| class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20", | ||
| ), | ||
| rx.box(class_name="h-[1px] bg-slate-3 w-full"), | ||
| bottom_section(), | ||
| footer_customer(), | ||
| class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans gap-4 mx-auto max-w-[64.19rem] lg:border-x border-slate-3 pt-24 lg:pt-48", | ||
| ), | ||
| class_name="relative overflow-hidden", | ||
| ) | ||
|
|
||
| return wrapped_page | ||
|
|
||
| return decorator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.