/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/components/src/card/docs/example.jsx
49 строк
1 KB
Marko Andrijasevic
React: add new JSX transform (#56451)
29 сен 2021, 13:49
Не верифицирован
29 сен 2021, 13:49
f2e6f88
Код
Авторство
О чём код?
import { Component } from 'react'; import Card from '..'; import CompactCard from '../compact'; Card.displayName = 'Card'; CompactCard.displayName = 'CompactCard'; class Cards extends Component { static displayName = 'Card'; state = { compactCards: false, }; static defaultProps = { exampleCode: ( <div> <Card>I am a Card.</Card> <Card>I am another Card.</Card> <Card className="docs__awesome sauce">I am a third Card with custom classes!</Card> <Card href="#cards">I am a linkable Card</Card> <Card href="#cards" target="_blank" rel="noopener noreferrer"> I am a externally linked Card </Card> <Card tagName="button" displayAsLink onClick={ function () { alert( 'Thank you for clicking me!' ); } } > I am a clickable button that looks like a link </Card> <Card highlight="info">I am a Card, highlighted as info</Card> <Card highlight="success">I am a Card, highlighted as success</Card> <Card highlight="error">I am a Card, highlighted as error</Card> <Card highlight="warning">I am a Card, highlighted as warning</Card> <CompactCard>I am a CompactCard.</CompactCard> <CompactCard>I am another CompactCard.</CompactCard> </div> ), }; render() { return this.props.exampleCode; } } export default Cards;