File tree Expand file tree Collapse file tree 1 file changed +1
-21
lines changed
packages/react-components/react-motion-components-preview/stories/src/Rotate Expand file tree Collapse file tree 1 file changed +1
-21
lines changed Original file line number Diff line number Diff line change 3
3
Field ,
4
4
makeStyles ,
5
5
tokens ,
6
- Switch ,
7
6
useId ,
8
7
Label ,
9
8
Slider ,
@@ -96,7 +95,6 @@ const LoremIpsum = () => (
96
95
export const Default = ( props : React . ComponentProps < typeof Rotate > ) => {
97
96
const classes = useClasses ( ) ;
98
97
const [ visible , setVisible ] = React . useState < boolean > ( false ) ;
99
- const [ autoplay , setAutoplay ] = React . useState < boolean > ( false ) ;
100
98
const [ perspective , setPerspective ] = React . useState < string > ( '1000px' ) ;
101
99
const [ duration , setDuration ] = React . useState < number > ( motionTokens . durationUltraSlow ) ; // 500ms
102
100
const [ axis , setAxis ] = React . useState < Axis3D > ( 'y' ) ;
@@ -122,18 +120,6 @@ export const Default = (props: React.ComponentProps<typeof Rotate>) => {
122
120
< Button className = { classes . ctaButton } appearance = "primary" size = "large" onClick = { ( ) => setVisible ( v => ! v ) } >
123
121
{ visible ? 'Hide' : 'Show' }
124
122
</ Button >
125
- < Field >
126
- < Switch
127
- label = "Autoplay"
128
- checked = { autoplay }
129
- onChange = { ( ) => {
130
- if ( ! autoplay ) {
131
- setVisible ( ! visible ) ;
132
- }
133
- return setAutoplay ( v => ! v ) ;
134
- } }
135
- />
136
- </ Field >
137
123
</ div >
138
124
</ div >
139
125
@@ -207,13 +193,7 @@ export const Default = (props: React.ComponentProps<typeof Rotate>) => {
207
193
</ div >
208
194
</ div >
209
195
210
- < Rotate
211
- visible = { visible }
212
- axis = { axis }
213
- angle = { angle }
214
- duration = { duration }
215
- onMotionFinish = { ( ) => autoplay && setVisible ( v => ! v ) }
216
- >
196
+ < Rotate visible = { visible } axis = { axis } angle = { angle } duration = { duration } >
217
197
< div className = { classes . card } >
218
198
< LoremIpsum />
219
199
</ div >
You can’t perform that action at this time.
0 commit comments