diff --git a/CHANGELOG.md b/CHANGELOG.md index 38f7c56..0b64b2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 3.1.0 + +### Features + +- If `count` is set to a decimal number like 3.5, the component will display 3 + full-width skeletons followed by 1 half-width skeleton. (#136) + ## 3.0.3 ### Bug Fixes diff --git a/README.md b/README.md index 547266e..5ebd815 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,12 @@ return (
count?: number
count
is a decimal number like 3.5,
+ three full skeletons and one half-width skeleton will be
+ rendered.
+ 1
This is a test for{' '} @@ -179,7 +189,7 @@ export const PercentWidthInFlex: React.VFC = () => (
This is a test for{' '} @@ -231,7 +241,7 @@ function HeightComparison({ ) } -export const HeightQuirk: React.VFC = () => ( +export const HeightQuirk: React.FC = () => (
This is a demonstration of a Skeleton quirk that was reported in{' '} @@ -287,7 +297,7 @@ export const HeightQuirk: React.VFC = () => (
This is a test for{' '}
diff --git a/src/__tests__/Skeleton.test.tsx b/src/__tests__/Skeleton.test.tsx
index 303480a..bb85775 100644
--- a/src/__tests__/Skeleton.test.tsx
+++ b/src/__tests__/Skeleton.test.tsx
@@ -118,3 +118,23 @@ it('renders a skeleton with a wrapper', () => {
expect(box.querySelector(skeletonSelector)).toBeVisible()
})
+
+it('renders a half-width skeleton when count = 1.5', () => {
+ render(