Renamed /src to /frontend

This commit is contained in:
Jori Lallo
2016-07-24 15:32:31 -07:00
parent 19da05eee7
commit d2187c4b10
147 changed files with 10 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
import React from 'react';
import styles from './HeaderAction.scss';
const HeaderAction = (props) => {
return (
<div
onClick={ props.onClick }
className={ styles.container }
>{ props.children }</div>
);
};
HeaderAction.propTypes = {
onClick: React.PropTypes.func,
};
export default HeaderAction;

View File

@@ -0,0 +1,9 @@
.container {
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
min-height: 43px;
padding: 0 0.5rem;
color: #0C77F8;
}

View File

@@ -0,0 +1,2 @@
import HeaderAction from './HeaderAction';
export default HeaderAction;

View File

@@ -0,0 +1,38 @@
import React from 'react';
import _truncate from 'lodash/truncate';
import styles from './Title.scss';
import classNames from 'classnames/bind';
const cx = classNames.bind(styles);
const Title = (props) => {
let title;
if (props.truncate) {
title = _truncate(props.children, props.truncate);
} else {
title = props.children;
}
let usePlaceholder;
if (props.children === null && props.placeholder) {
title = props.placeholder;
usePlaceholder = true;
}
return(
<span
title={ props.children }
className={ cx(styles.title, { untitled: usePlaceholder })}
>
{ title }
</span>
);
};
Title.propTypes = {
children: React.PropTypes.string,
truncate: React.PropTypes.number,
placeholder: React.PropTypes.string,
}
export default Title;

View File

@@ -0,0 +1,7 @@
.title {
}
.untitled {
color: #ccc;
}

View File

@@ -0,0 +1,2 @@
import Title from './Title';
export default Title;