File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -2,21 +2,23 @@ import * as React from 'react';
22import { ModalTransition } from '../../dist' ;
33
44interface Props {
5+ value : ModalTransition ;
56 onChange ( transition : ModalTransition ) ;
67}
7- export const TransitionSelect : React . FC < Props > = ( { onChange } ) => (
8+ export const TransitionSelect : React . FC < Props > = ( { value , onChange } ) => (
89 < div className = "w-full md:w-1/4 mb-6 md:mb-0 mt-8" >
910 < label className = "block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" >
1011 Transition
1112 </ label >
1213 < div className = "relative" >
1314 < select
14- className = "block appearance-none w-full bg-gray-200 border border-gray-200 text-gray-700 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
15+ value = { value }
16+ className = "block appearance-none w-full border border-gray-200 text-gray-700 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
1517 onChange = { e => onChange ( e . target . value as ModalTransition ) }
1618 >
17- { Object . keys ( ModalTransition ) . map ( value => (
18- < option key = { value } value = { value } >
19- { value }
19+ { Object . keys ( ModalTransition ) . map ( option => (
20+ < option key = { option } value = { option } >
21+ { option }
2022 </ option >
2123 ) ) }
2224 </ select >
Original file line number Diff line number Diff line change @@ -91,13 +91,13 @@ const Component = ({ transition }) => {
9191} ;
9292
9393const App = ( ) => {
94- const [ transition , setTransition ] = React . useState ( ModalTransition . NONE ) ;
94+ const [ transition , setTransition ] = React . useState ( ModalTransition . SCALE ) ;
9595
9696 return (
9797 < ModalProvider >
9898 < div className = "p-8" >
9999 < Component transition = { transition } />
100- < TransitionSelect onChange = { setTransition } />
100+ < TransitionSelect value = { transition } onChange = { setTransition } />
101101 </ div >
102102 </ ModalProvider >
103103 ) ;
You can’t perform that action at this time.
0 commit comments