Rework default ui for upload

This commit is contained in:
Alek Petuskey 2024-10-09 16:00:15 -07:00
parent 0e7627d1c4
commit 414278458f
5 changed files with 48 additions and 3 deletions

BIN
assets/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

0
pynecone/__init__.py Normal file
View File

39
pynecone/pynecone.py Normal file
View 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)

View File

@ -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
View File

@ -0,0 +1,5 @@
import reflex as rx
config = rx.Config(
app_name="pynecone",
)