Skip to content

Commit

Permalink
remove lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
amcdnl committed May 15, 2024
1 parent 8e4e9a8 commit 0cb1145
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/form/Range/Range.story.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { RangeDouble } from './RangeDouble';
import React, { useState } from 'react';
import { RangeSingle } from './RangeSingle';
import { debounce } from 'lodash';

export default {
title: 'Components/Form/Range',
component: Range,
component: RangeSingle,
decorators: [
Story => (
<div className="bg-panel p-20">
Expand Down Expand Up @@ -116,12 +115,9 @@ export const CustomIntegerStep = () => {
export const Double = () => {
const [state, setState] = useState<[number, number]>([20, 40]);

const debounceRange = () =>
debounce((min: number, max: number) => setState([min, max]));

return (
<RangeDouble
onChange={debounceRange}
onChange={([min, max]) => setState([min, max])}
min={10}
max={50}
value={state}
Expand All @@ -133,12 +129,9 @@ export const Double = () => {
export const DoubleFloatStep = () => {
const [state, setState] = useState<[number, number]>([5, 10]);

const debounceRange = () =>
debounce((min: number, max: number) => setState([min, max]));

return (
<RangeDouble
onChange={debounceRange}
onChange={([min, max]) => setState([min, max])}
min={0.5}
max={12.5}
step={0.1}
Expand All @@ -151,12 +144,9 @@ export const DoubleFloatStep = () => {
export const DoubleIntegerStep = () => {
const [state, setState] = useState<[number, number]>([20, 40]);

const debounceRange = () =>
debounce((min: number, max: number) => setState([min, max]));

return (
<RangeDouble
onChange={debounceRange}
onChange={([min, max]) => setState([min, max])}
min={10}
max={50}
step={5}
Expand Down

0 comments on commit 0cb1145

Please sign in to comment.