/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
client/components/theme/docs/example.jsx
40 строк
816 B
Marko Andrijasevic
React: add new JSX transform (#56451)
29 сен 2021, 13:49
Не верифицирован
29 сен 2021, 13:49
f2e6f88
Код
Авторство
О чём код?
import Theme from 'calypso/components/theme'; const ThemeExample = () => { const theme = { id: 'twentyfifteen', name: 'Twenty Fifteen', screenshot: '//i1.wp.com/theme.wordpress.com/wp-content/themes/pub/twentyfifteen/screenshot.png', }; return ( <div> <Theme theme={ theme } buttonContents={ { action1: { label: 'Menu Item 1', action: function () { console.log( 'Menu Item 1 selected' ); }, }, action2: { label: 'Menu Item 2', action: function () { console.log( 'Menu Item 2 selected' ); }, }, } } actionLabel="Click Action" onScreenshotClick={ function () { console.log( 'onScreenshotClick triggered' ); } } /> </div> ); }; ThemeExample.displayName = 'Theme'; export default ThemeExample;