update blank template (#3219)
* update blank template * update CONTRIBUTING.md * adjust min_height of main stack * simplify stuff * fix import order for blank template and tell ruff to ignore it
This commit is contained in:
parent
1d093486b9
commit
bdcbe006a2
@ -96,6 +96,15 @@ pre-commit install
|
|||||||
That's it you can now submit your PR. Thanks for contributing to Reflex!
|
That's it you can now submit your PR. Thanks for contributing to Reflex!
|
||||||
|
|
||||||
|
|
||||||
|
## Editing Templates
|
||||||
|
|
||||||
|
To edit the templates in Reflex you can do so in two way.
|
||||||
|
|
||||||
|
Change to the basic `blank` template can be done in the `reflex/.templates/apps/blank` directory.
|
||||||
|
|
||||||
|
Others templates can be edited in their own repository. For example the `sidebar` template can be found in the [`reflex-sidebar`](https://github.com/reflex-dev/sidebar-template) repository.
|
||||||
|
|
||||||
|
|
||||||
## Other Notes
|
## Other Notes
|
||||||
|
|
||||||
For some pull requests when adding new components you will have to generate a pyi file for the new component. This is done by running the following command in the `reflex` directory.
|
For some pull requests when adding new components you will have to generate a pyi file for the new component. This is done by running the following command in the `reflex` directory.
|
||||||
|
@ -106,3 +106,4 @@ lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "
|
|||||||
"tests/*.py" = ["D100", "D103", "D104", "B018"]
|
"tests/*.py" = ["D100", "D103", "D104", "B018"]
|
||||||
"reflex/.templates/*.py" = ["D100", "D103", "D104"]
|
"reflex/.templates/*.py" = ["D100", "D103", "D104"]
|
||||||
"*.pyi" = ["ALL"]
|
"*.pyi" = ["ALL"]
|
||||||
|
"*/blank.py" = ["I001"]
|
||||||
|
@ -1,34 +1,37 @@
|
|||||||
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
|
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
|
||||||
|
|
||||||
from rxconfig import config
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
docs_url = "https://reflex.dev/docs/getting-started/introduction/"
|
from rxconfig import config
|
||||||
filename = f"{config.app_name}/{config.app_name}.py"
|
|
||||||
|
|
||||||
|
|
||||||
class State(rx.State):
|
class State(rx.State):
|
||||||
"""The app state."""
|
"""The app state."""
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
def index() -> rx.Component:
|
def index() -> rx.Component:
|
||||||
return rx.center(
|
# Welcome Page (Index)
|
||||||
rx.theme_panel(),
|
return rx.container(
|
||||||
|
rx.color_mode.button(position="top-right"),
|
||||||
rx.vstack(
|
rx.vstack(
|
||||||
rx.heading("Welcome to Reflex!", size="9"),
|
rx.heading("Welcome to Reflex!", size="9"),
|
||||||
rx.text("Get started by editing ", rx.code(filename)),
|
rx.text(
|
||||||
rx.button(
|
"Get started by editing ",
|
||||||
"Check out our docs!",
|
rx.code(f"{config.app_name}/{config.app_name}.py"),
|
||||||
on_click=lambda: rx.redirect(docs_url),
|
size="5",
|
||||||
size="4",
|
|
||||||
),
|
),
|
||||||
rx.logo(),
|
rx.link(
|
||||||
align="center",
|
rx.button("Check out our docs!"),
|
||||||
spacing="7",
|
href="https://reflex.dev/docs/getting-started/introduction/",
|
||||||
font_size="2em",
|
is_external=True,
|
||||||
|
),
|
||||||
|
spacing="5",
|
||||||
|
justify="center",
|
||||||
|
min_height="85vh",
|
||||||
),
|
),
|
||||||
height="100vh",
|
rx.logo(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user