diff --git a/.changeset/few-olives-like.md b/.changeset/few-olives-like.md new file mode 100644 index 0000000..ffa3ac6 --- /dev/null +++ b/.changeset/few-olives-like.md @@ -0,0 +1,5 @@ +--- +"notion-to-jsx": patch +--- + +add loading state to image skeleton component diff --git a/packages/notion-to-jsx/src/components/Cover/index.tsx b/packages/notion-to-jsx/src/components/Cover/index.tsx index b144245..77d3a38 100644 --- a/packages/notion-to-jsx/src/components/Cover/index.tsx +++ b/packages/notion-to-jsx/src/components/Cover/index.tsx @@ -17,7 +17,7 @@ const Cover = ({ src, alt }: Props) => { return (
- +
- +
{ const getVariantClass = () => { switch (variant) { @@ -42,6 +47,10 @@ const Skeleton = ({ } }; + if (!isLoading) { + return null; + } + return (