Move the search box up so that it is in line (to the left) of the paragraph of ambassador text

This commit is contained in:
Letícia Camara 2018-11-04 17:42:22 -02:00
parent 23318a59e8
commit 8fbd72bb1a
3 changed files with 15 additions and 11 deletions

View file

@ -42,7 +42,7 @@ const styles = theme => ({
class EnhancedSearch extends Component { class EnhancedSearch extends Component {
render() { render() {
const {query, onUpdateQuery, onColumnChange} = this.props; const {query, onUpdateQuery, onColumnChange, textComponent} = this.props;
const { classes } = this.props; const { classes } = this.props;
return ( return (
@ -62,6 +62,7 @@ class EnhancedSearch extends Component {
startAdornment: <InputAdornment position="start"><Search /></InputAdornment>, startAdornment: <InputAdornment position="start"><Search /></InputAdornment>,
}} }}
/> />
{textComponent}
<br /> <br />
{this.props.showSearchColumns && this.props.columns.map(column => ( {this.props.showSearchColumns && this.props.columns.map(column => (
<FormControlLabel <FormControlLabel

View file

@ -57,6 +57,7 @@ const defaultProps = {
onEdit: () => {}, onEdit: () => {},
onDelete: () => {}, onDelete: () => {},
onMultipleDelete: () => {}, onMultipleDelete: () => {},
description: ''
}; };
/** /**
@ -81,8 +82,6 @@ class EnhancedTable extends Component {
}; };
}).sort(sortBy('name')) }).sort(sortBy('name'))
}; };
this.handleRequestSort('', this.props.orderBy);
} }
handleRequestSort = (event, property) => { handleRequestSort = (event, property) => {
@ -254,6 +253,7 @@ class EnhancedTable extends Component {
return ( return (
<div style={styles.root}> <div style={styles.root}>
<EnhancedSearch <EnhancedSearch
textComponent={this.props.description}
query={searchQuery} query={searchQuery}
columns={searchColumns} columns={searchColumns}
showSearchColumns={showSearchColumns} showSearchColumns={showSearchColumns}

View file

@ -350,6 +350,16 @@ class AmbassadorsPage extends Component {
data = data.sort(sortBy('location.searchText')); data = data.sort(sortBy('location.searchText'));
const textComponent = (
<span>
<FormattedHTMLMessage id="ambassadors.description1" />
<Link to="/merchants">
<FormattedMessage id="ambassadors.merchants_link_description" />
</Link>
<FormattedHTMLMessage id="ambassadors.description2" />
</span>
);
return ( return (
<div> <div>
<AppHeader /> <AppHeader />
@ -367,14 +377,6 @@ class AmbassadorsPage extends Component {
<img src={LoadingGif} alt="Loading" style={loadingStyle} /> <img src={LoadingGif} alt="Loading" style={loadingStyle} />
): ( ): (
<div> <div>
<p style={{ textAlign: 'left', marginRight: 20 }}>
<FormattedHTMLMessage id="ambassadors.description1" />
<Link to="/merchants">
<FormattedMessage id="ambassadors.merchants_link_description" />
</Link>
<FormattedHTMLMessage id="ambassadors.description2" />
</p>
<Modal <Modal
isOpen={this.state.mapsModalIsOpen} isOpen={this.state.mapsModalIsOpen}
onRequestClose={() => this.closeMapsModal()} onRequestClose={() => this.closeMapsModal()}
@ -396,6 +398,7 @@ class AmbassadorsPage extends Component {
<div> <div>
<br /> <br />
<EnhancedTable <EnhancedTable
description={textComponent}
columnData={columnData} columnData={columnData}
data={data} data={data}
orderBy="Location" orderBy="Location"