From 3fe6ac3505338ddebcf4a357fccf8fec3d19c91b Mon Sep 17 00:00:00 2001 From: woody Date: Fri, 7 Feb 2020 10:29:26 +0900 Subject: [PATCH] =?UTF-8?q?[#459]=20Refactor:=20RangeSlider=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EA=B5=AC=EC=B2=B4=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/stories/slider.stories.js | 6 +++--- packages/slider/src/index.ts | 1 + packages/slider/src/{index.tsx => range-slider.tsx} | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 packages/slider/src/index.ts rename packages/slider/src/{index.tsx => range-slider.tsx} (97%) diff --git a/docs/stories/slider.stories.js b/docs/stories/slider.stories.js index 9b9cb89499..11ed7d9a83 100644 --- a/docs/stories/slider.stories.js +++ b/docs/stories/slider.stories.js @@ -1,7 +1,7 @@ import React, { useState } from 'react' import { storiesOf } from '@storybook/react' -import Slider from '@titicaca/slider' +import { RangeSlider } from '@titicaca/slider' import { Text } from '@titicaca/core-elements' function Label({ fromValue, toValue }) { @@ -19,7 +19,7 @@ storiesOf('Slider', module) return (
컴포넌트 외부: {values.join(', ')} - 컴포넌트 외부: {values.join(', ')} - number -interface SliderProps { +interface RangeSliderProps { initialValues?: SliderValue step?: number min: number @@ -53,7 +53,7 @@ const NON_LINEAR_FN_SET: ValueTransformer[] = [ (x) => Math.round(Math.pow(x, 1 / EXPONENT)), ] -export default function Slider({ +export default function RangeSlider({ step = 1, initialValues, min, @@ -61,7 +61,7 @@ export default function Slider({ onChange, labelComponent: LabelComponent, nonLinear, -}: SliderProps) { +}: RangeSliderProps) { const [values, setValues] = useState(initialValues || [min, max]) const [scaleFn, scaleFnInverse] = nonLinear