Rework default ui for upload
This commit is contained in:
parent
0e7627d1c4
commit
414278458f
BIN
assets/favicon.ico
Normal file
BIN
assets/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
0
pynecone/__init__.py
Normal file
0
pynecone/__init__.py
Normal file
39
pynecone/pynecone.py
Normal file
39
pynecone/pynecone.py
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
|
||||||
|
|
||||||
|
import reflex as rx
|
||||||
|
|
||||||
|
from rxconfig import config
|
||||||
|
|
||||||
|
|
||||||
|
class State(rx.State):
|
||||||
|
"""The app state."""
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
def index() -> rx.Component:
|
||||||
|
# Welcome Page (Index)
|
||||||
|
return rx.container(
|
||||||
|
rx.color_mode.button(position="top-right"),
|
||||||
|
rx.vstack(
|
||||||
|
rx.heading("Welcome to Reflex!", size="9"),
|
||||||
|
rx.text(
|
||||||
|
"Get started by editing ",
|
||||||
|
rx.code(f"{config.app_name}/{config.app_name}.py"),
|
||||||
|
size="5",
|
||||||
|
),
|
||||||
|
rx.link(
|
||||||
|
rx.button("Check out our docs!"),
|
||||||
|
href="https://reflex.dev/docs/getting-started/introduction/",
|
||||||
|
is_external=True,
|
||||||
|
),
|
||||||
|
spacing="5",
|
||||||
|
justify="center",
|
||||||
|
min_height="85vh",
|
||||||
|
),
|
||||||
|
rx.logo(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
app = rx.App()
|
||||||
|
app.add_page(index)
|
@ -23,6 +23,8 @@ from reflex.utils.imports import ImportVar
|
|||||||
from reflex.vars import VarData
|
from reflex.vars import VarData
|
||||||
from reflex.vars.base import CallableVar, LiteralVar, Var
|
from reflex.vars.base import CallableVar, LiteralVar, Var
|
||||||
from reflex.vars.sequence import LiteralStringVar
|
from reflex.vars.sequence import LiteralStringVar
|
||||||
|
from reflex.components.radix.themes.components.button import button
|
||||||
|
from reflex.components.lucide import icon
|
||||||
|
|
||||||
DEFAULT_UPLOAD_ID: str = "default"
|
DEFAULT_UPLOAD_ID: str = "default"
|
||||||
|
|
||||||
@ -324,9 +326,8 @@ class StyledUpload(Upload):
|
|||||||
The styled upload component.
|
The styled upload component.
|
||||||
"""
|
"""
|
||||||
# Set default props.
|
# Set default props.
|
||||||
props.setdefault("border", "1px dashed var(--accent-12)")
|
if not children:
|
||||||
props.setdefault("padding", "5em")
|
children = [button("Upload Files", icon("upload", size=12), align_items="center")]
|
||||||
props.setdefault("textAlign", "center")
|
|
||||||
|
|
||||||
# Mark the Upload component as used in the app.
|
# Mark the Upload component as used in the app.
|
||||||
Upload.is_used = True
|
Upload.is_used = True
|
||||||
|
5
rxconfig.py
Normal file
5
rxconfig.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import reflex as rx
|
||||||
|
|
||||||
|
config = rx.Config(
|
||||||
|
app_name="pynecone",
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user