/
githubmirror
/
algorithm-visualizer
Обзор
Документация
Войти
/
githubmirror
/
algorithm-visualizer
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/components/ExpandableListItem/index.js
28 строк
1 KB
Jason Park
Rename jsx and scss files
09 июн 2019, 17:39
09 июн 2019, 17:39
60fcab5
Код
Авторство
О чём код?
import React from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import faCaretDown from '@fortawesome/fontawesome-free-solid/faCaretDown'; import faCaretRight from '@fortawesome/fontawesome-free-solid/faCaretRight'; import styles from './ExpandableListItem.module.scss'; import { ListItem } from 'components'; import { classes } from 'common/util'; class ExpandableListItem extends React.Component { render() { const { className, children, opened, ...props } = this.props; return opened ? ( <div className={classes(styles.expandable_list_item, className)}> <ListItem className={styles.category} {...props}> <FontAwesomeIcon className={styles.icon} fixedWidth icon={faCaretDown} /> </ListItem> {children} </div> ) : ( <ListItem className={classes(styles.category, className)} {...props}> <FontAwesomeIcon className={styles.icon} fixedWidth icon={faCaretRight} /> </ListItem> ); } } export default ExpandableListItem;