Skip to content

Commit

Permalink
[#459] Feature: Slider 최소 조건 story 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
giwan-dev committed Feb 10, 2020
1 parent fed605a commit 675972d
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docs/stories/slider.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react'
import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'

import { SingleSlider, RangeSlider } from '@titicaca/slider'
import { Text } from '@titicaca/core-elements'
Expand All @@ -17,7 +18,8 @@ function RangeLabel({ fromValue, toValue }) {
}

storiesOf('Slider', module)
.add('기본', () => {
.add('기본', () => <SingleSlider onChange={action('onChange')} />)
.add('단일', () => {
const [value, setValue] = useState(500000)

return (
Expand All @@ -33,6 +35,23 @@ storiesOf('Slider', module)
</div>
)
})
.add('단일 non linear', () => {
const [value, setValue] = useState(500000)

return (
<div style={{ height: '4000px', padding: '500px 20px 0 20px' }}>
컴포넌트 외부: {value}
<SingleSlider
initialValue={value}
min={0}
max={500000}
onChange={setValue}
labelComponent={SingleLabel}
nonLinear
/>
</div>
)
})
.add('범위', () => {
const [values, setValues] = useState([0, 500000])

Expand All @@ -49,7 +68,7 @@ storiesOf('Slider', module)
</div>
)
})
.add('Non linear', () => {
.add('범위 non linear', () => {
const [values, setValues] = useState([0, 500000])

return (
Expand Down

0 comments on commit 675972d

Please sign in to comment.