Skip to content

Commit

Permalink
Fix responsive component import errors (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
picklelo authored Mar 4, 2023
1 parent 5a373d9 commit 35ed283
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
29 changes: 28 additions & 1 deletion pynecone/components/forms/upload.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A file upload component."""

from typing import Dict
from typing import Dict, List, Optional

from pynecone.components.component import EVENT_ARG, Component
from pynecone.components.forms.input import Input
Expand All @@ -18,6 +18,33 @@ class Upload(Component):

tag = "ReactDropzone"

# The list of accepted file types.
accept: Var[Optional[List[str]]]

# Whether the dropzone is disabled.
disabled: Var[bool]

# The maximum number of files that can be uploaded.
max_files: Var[int]

# The maximum file size (bytes) that can be uploaded.
max_size: Var[int]

# The minimum file size (bytes) that can be uploaded.
min_size: Var[int]

# Whether to allow multiple files to be uploaded.
multiple: Var[bool] = True # type: ignore

# Whether to disable click to upload.
no_click: Var[bool]

# Whether to disable drag and drop.
no_drag: Var[bool]

# Whether to disable using the space/enter keys to upload.
no_keyboard: Var[bool]

@classmethod
def create(cls, *children, **props) -> Component:
"""Create an upload component.
Expand Down
11 changes: 10 additions & 1 deletion pynecone/components/layout/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@
from .stack import Hstack, Stack, Vstack
from .wrap import Wrap, WrapItem

__all__ = [f for f in dir() if f[0].isupper()] # type: ignore
helpers = [
"cond",
"desktop_only",
"mobile_and_tablet",
"mobile_only",
"tablet_and_desktop",
"tablet_only",
]

__all__ = [f for f in dir() if f[0].isupper()] + helpers # type: ignore

0 comments on commit 35ed283

Please sign in to comment.