/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
client/components/section-header/docs/example.jsx
42 строки
1 KB
Marko Andrijasevic
React: add new JSX transform (#56451)
29 сен 2021, 13:49
Не верифицирован
29 сен 2021, 13:49
f2e6f88
Код
Авторство
О чём код?
import { Button } from '@automattic/components'; import { translate } from 'i18n-calypso'; import { PureComponent } from 'react'; import SectionHeader from 'calypso/components/section-header'; class SectionHeaderExample extends PureComponent { static displayName = 'SectionHeader'; render() { return ( <div> <SectionHeader label={ translate( 'Team' ) } count={ 10 }> <Button compact primary> { translate( 'Primary Action' ) } </Button> <Button compact>{ translate( 'Manage' ) }</Button> <Button compact onClick={ function () { alert( translate( 'Clicked add button' ) ); } } > { translate( 'Add' ) } </Button> </SectionHeader> <h3>{ translate( 'Clickable SectionHeader' ) }</h3> <SectionHeader label={ translate( 'Team' ) } count={ 10 } href="/devdocs/design/section-header" /> <h3>{ translate( 'Empty SectionHeader' ) }</h3> <SectionHeader /> </div> ); } } export default SectionHeaderExample;