Removed custom Flex component
This commit is contained in:
@ -1,34 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
const Flex = (props) => {
|
|
||||||
const style = {
|
|
||||||
display: 'flex',
|
|
||||||
flex: props.flex ? '1' : null,
|
|
||||||
flexDirection: props.direction,
|
|
||||||
justifyContent: props.justify,
|
|
||||||
alignItems: props.align,
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div style={ style } {...props}>
|
|
||||||
{ props.children }
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Flex.defaultProps = {
|
|
||||||
direction: 'row',
|
|
||||||
justify: null,
|
|
||||||
align: null,
|
|
||||||
flex: null,
|
|
||||||
};
|
|
||||||
|
|
||||||
Flex.propTypes = {
|
|
||||||
children: React.PropTypes.node,
|
|
||||||
direction: React.PropTypes.string,
|
|
||||||
justify: React.PropTypes.string,
|
|
||||||
align: React.PropTypes.string,
|
|
||||||
flex: React.PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Flex;
|
|
@ -6,7 +6,7 @@ import keydown from 'react-keydown';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
import DropdownMenu, { MenuItem } from 'components/DropdownMenu';
|
import DropdownMenu, { MenuItem } from 'components/DropdownMenu';
|
||||||
import Flex from 'components/Flex';
|
import { Flex } from 'reflexbox';
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
import LoadingIndicator from 'components/LoadingIndicator';
|
||||||
import Alert from 'components/Alert';
|
import Alert from 'components/Alert';
|
||||||
import { Avatar } from 'rebass';
|
import { Avatar } from 'rebass';
|
||||||
@ -66,7 +66,7 @@ class Layout extends React.Component {
|
|||||||
{ this.props.title && (<span> / </span>) }{ this.props.title }
|
{ this.props.title && (<span> / </span>) }{ this.props.title }
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<Flex direction="row" className={ styles.headerRight }>
|
<Flex className={ styles.headerRight }>
|
||||||
<Flex align="center" className={ styles.actions }>
|
<Flex align="center" className={ styles.actions }>
|
||||||
{ this.props.actions }
|
{ this.props.actions }
|
||||||
</Flex>
|
</Flex>
|
||||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
import { Avatar } from 'rebass';
|
import { Avatar } from 'rebass';
|
||||||
import Flex from 'components/Flex';
|
import { Flex } from 'reflexbox';
|
||||||
|
|
||||||
import styles from './PublishingInfo.scss';
|
import styles from './PublishingInfo.scss';
|
||||||
|
|
||||||
@ -29,4 +29,4 @@ PublishingInfo.propTypes = {
|
|||||||
updatedAt: React.PropTypes.string.isRequired,
|
updatedAt: React.PropTypes.string.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PublishingInfo;
|
export default PublishingInfo;
|
||||||
|
@ -12,7 +12,7 @@ import CenteredContent from 'components/CenteredContent';
|
|||||||
import DocumentList from 'components/DocumentList';
|
import DocumentList from 'components/DocumentList';
|
||||||
import Divider from 'components/Divider';
|
import Divider from 'components/Divider';
|
||||||
import DropdownMenu, { MenuItem, MoreIcon } from 'components/DropdownMenu';
|
import DropdownMenu, { MenuItem, MoreIcon } from 'components/DropdownMenu';
|
||||||
import Flex from 'components/Flex';
|
import { Flex } from 'reflexbox';
|
||||||
|
|
||||||
import styles from './Atlas.scss';
|
import styles from './Atlas.scss';
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ class Atlas extends React.Component {
|
|||||||
|
|
||||||
if (collection) {
|
if (collection) {
|
||||||
actions = (
|
actions = (
|
||||||
<Flex direction="row">
|
<Flex>
|
||||||
<DropdownMenu label={ <MoreIcon /> } >
|
<DropdownMenu label={ <MoreIcon /> } >
|
||||||
<MenuItem onClick={ this.onCreate }>
|
<MenuItem onClick={ this.onCreate }>
|
||||||
New document
|
New document
|
||||||
|
@ -3,7 +3,7 @@ import { observer } from 'mobx-react';
|
|||||||
|
|
||||||
import store from './DashboardStore';
|
import store from './DashboardStore';
|
||||||
|
|
||||||
import Flex from 'components/Flex';
|
import { Flex } from 'reflexbox';
|
||||||
import Layout from 'components/Layout';
|
import Layout from 'components/Layout';
|
||||||
import AtlasPreview from 'components/AtlasPreview';
|
import AtlasPreview from 'components/AtlasPreview';
|
||||||
import AtlasPreviewLoading from 'components/AtlasPreviewLoading';
|
import AtlasPreviewLoading from 'components/AtlasPreviewLoading';
|
||||||
@ -35,7 +35,7 @@ class Dashboard extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const actions = (
|
const actions = (
|
||||||
<Flex direction="row">
|
<Flex>
|
||||||
<DropdownMenu label={ <MoreIcon /> } >
|
<DropdownMenu label={ <MoreIcon /> } >
|
||||||
<MenuItem onClick={ this.onClickNewAtlas }>
|
<MenuItem onClick={ this.onClickNewAtlas }>
|
||||||
New Atlas
|
New Atlas
|
||||||
@ -45,7 +45,7 @@ class Dashboard extends React.Component {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex flex>
|
<Flex auto>
|
||||||
<Layout
|
<Layout
|
||||||
actions={ actions }
|
actions={ actions }
|
||||||
>
|
>
|
||||||
|
@ -9,7 +9,7 @@ import DocumentEditStore, {
|
|||||||
|
|
||||||
import Switch from 'components/Switch';
|
import Switch from 'components/Switch';
|
||||||
import Layout, { Title, HeaderAction, SaveAction } from 'components/Layout';
|
import Layout, { Title, HeaderAction, SaveAction } from 'components/Layout';
|
||||||
import Flex from 'components/Flex';
|
import { Flex } from 'reflexbox';
|
||||||
import AtlasPreviewLoading from 'components/AtlasPreviewLoading';
|
import AtlasPreviewLoading from 'components/AtlasPreviewLoading';
|
||||||
import CenteredContent from 'components/CenteredContent';
|
import CenteredContent from 'components/CenteredContent';
|
||||||
import DropdownMenu, { MenuItem, MoreIcon } from 'components/DropdownMenu';
|
import DropdownMenu, { MenuItem, MoreIcon } from 'components/DropdownMenu';
|
||||||
@ -131,7 +131,7 @@ class DocumentEdit extends Component {
|
|||||||
let titleText = this.store.title;
|
let titleText = this.store.title;
|
||||||
|
|
||||||
const actions = (
|
const actions = (
|
||||||
<Flex direction="row">
|
<Flex>
|
||||||
<HeaderAction>
|
<HeaderAction>
|
||||||
<SaveAction
|
<SaveAction
|
||||||
onClick={ this.onSave }
|
onClick={ this.onSave }
|
||||||
|
@ -2,12 +2,11 @@ import React from 'react';
|
|||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import _debounce from 'lodash/debounce';
|
import _debounce from 'lodash/debounce';
|
||||||
|
|
||||||
import Flex from 'components/Flex';
|
import { Flex } from 'reflexbox';
|
||||||
import Layout from 'components/Layout';
|
import Layout from 'components/Layout';
|
||||||
import CenteredContent from 'components/CenteredContent';
|
import CenteredContent from 'components/CenteredContent';
|
||||||
import SearchField from './components/SearchField';
|
import SearchField from './components/SearchField';
|
||||||
import DocumentPreview from 'components/DocumentPreview';
|
import DocumentPreview from 'components/DocumentPreview';
|
||||||
import AtlasPreviewLoading from 'components/AtlasPreviewLoading';
|
|
||||||
|
|
||||||
import styles from './Search.scss';
|
import styles from './Search.scss';
|
||||||
|
|
||||||
@ -35,11 +34,12 @@ class Search extends React.Component {
|
|||||||
loading={ this.store.isFetching }
|
loading={ this.store.isFetching }
|
||||||
>
|
>
|
||||||
<CenteredContent>
|
<CenteredContent>
|
||||||
<Flex direction="column" flex={ true }>
|
<Flex column auto>
|
||||||
<Flex flex={ true }>
|
<Flex auto>
|
||||||
<img
|
<img
|
||||||
src={ require('assets/icons/search.svg') }
|
src={ require('assets/icons/search.svg') }
|
||||||
className={ styles.icon }
|
className={ styles.icon }
|
||||||
|
alt="Search"
|
||||||
/>
|
/>
|
||||||
<SearchField
|
<SearchField
|
||||||
searchTerm={ this.store.searchTerm }
|
searchTerm={ this.store.searchTerm }
|
||||||
@ -47,7 +47,7 @@ class Search extends React.Component {
|
|||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
{ this.store.documents && this.store.documents.map((document) => {
|
{ this.store.documents && this.store.documents.map((document) => {
|
||||||
return (<DocumentPreview key={ document.id } document={ document } />);
|
return (<DocumentPreview key={ document.id } document={ document } />);
|
||||||
}) }
|
}) }
|
||||||
</Flex>
|
</Flex>
|
||||||
</CenteredContent>
|
</CenteredContent>
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
|
|
||||||
import Flex from 'components/Flex';
|
|
||||||
|
|
||||||
import styles from './SearchField.scss';
|
import styles from './SearchField.scss';
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
|
Reference in New Issue
Block a user