Skip to content

Commit

Permalink
RC #291 - Removing test story from FacetTimeline.stories.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dleadbetter committed Aug 13, 2024
1 parent 2986ca4 commit 11681a1
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions packages/storybook/src/core-data/FacetTimeline.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,43 +131,3 @@ export const Description = withCoreDataContextProvider(() => (
zoom={10}
/>
));

export const MinMax = withCoreDataContextProvider(() => {
const [min, setMin] = useState(1768);
const [max, setMax] = useState(1777);

const getRandomInt = (min, max) => {
const minCeiled = Math.ceil(min);
const maxFloored = Math.floor(max);
return Math.floor(Math.random() * (maxFloored - minCeiled) + minCeiled); // The maximum is exclusive and the minimum is inclusive
};

const onResetRange = useCallback(() => {
const newMin = getRandomInt(1768, 1777);
const newMax = getRandomInt(newMin, 1777);

setMin(newMin);
setMax(newMax);
}, []);

const useRangeTest = () => ({
range: { min, max },
refine: () => {}
});

return (
<>
<FacetTimeline
useRange={useRangeTest}
zoom={10}
/>
<button
className='bg-blue-500 rounded-sm text-white p-3'
onClick={onResetRange}
type='button'
>
Reset Range
</button>
</>
);
});

0 comments on commit 11681a1

Please sign in to comment.