/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
client/components/wizard/docs/example.jsx
31 строка
818 B
Marko Andrijasevic
React: add new JSX transform (#56451)
29 сен 2021, 13:49
Не верифицирован
29 сен 2021, 13:49
f2e6f88
Код
Авторство
О чём код?
import Wizard from '../index'; const First = () => <div style={ { textAlign: 'center' } }>This is the first step.</div>; const Second = () => <div style={ { textAlign: 'center' } }>This is the second step.</div>; const Third = () => <div style={ { textAlign: 'center' } }>This is the third step.</div>; const STEPS = { FIRST: 'first', SECOND: 'second', THIRD: 'third', }; const steps = [ STEPS.FIRST, STEPS.SECOND, STEPS.THIRD ]; const components = { [ STEPS.FIRST ]: <First />, [ STEPS.SECOND ]: <Second />, [ STEPS.THIRD ]: <Third />, }; const WizardExample = ( { stepName = steps[ 0 ] } ) => ( <div> <Wizard basePath="/devdocs/design/wizard" components={ components } steps={ steps } stepName={ stepName } /> </div> ); WizardExample.displayName = 'Wizard'; export default WizardExample;