Skip to content

Commit

Permalink
fix: height bug & avatar ref
Browse files Browse the repository at this point in the history
  • Loading branch information
ObservedObserver committed Nov 24, 2023
1 parent 3662b21 commit 91c8da7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions pages/Avatar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import streamlit_shadcn_ui as ui

ui.avatar(src="https://imagedelivery.net/tSvh1MGEu9IgUanmf58srQ/e2b094c8-8519-4e8b-e92e-1cf8d4b58f00/public")
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "streamlit-shadcn-ui"
version = "0.1.9"
version = "0.1.10"
readme = "README.md"
keywords = ["streamlit", "shadcn", "ui", "components"]
description = "Using shadcn components in Streamlit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function App(props: ComponentProps<{comp: string; props: any; [key: string]: any

useEffect(() => {
if (container.current) {
Streamlit.setFrameHeight(container.current.offsetHeight + 5);
Streamlit.setFrameHeight(container.current.offsetHeight + 10);
}
}, []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export const StAlertDialog = forwardRef<HTMLDivElement, StAlertDialogProps>(
} = props;
useEffect(() => {
if (ref && typeof ref !== "function") {
Streamlit.setFrameHeight(ref.current.offsetHeight + 5);
// Streamlit.setFrameHeight(1000);
Streamlit.setFrameHeight(ref.current.offsetHeight + 10);
}
});
useBodyStyle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const StAvatar = forwardRef<HTMLDivElement, StAvatarProps>(
const { src, fallback } = props;

return (
<Avatar>
<Avatar ref={ref}>
<AvatarImage src={src} />
<AvatarFallback>{fallback}</AvatarFallback>
</Avatar>
Expand Down
3 changes: 2 additions & 1 deletion streamlit_shadcn_ui/py_components/slider.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .utils import declare_component

_component_func = declare_component("slider")
_RELEASE = True
_component_func = declare_component("slider", release=_RELEASE)

def slider(default_value=None, min_value=0, max_value=100, step=1, label=None, key=None):
props = {
Expand Down

0 comments on commit 91c8da7

Please sign in to comment.