diff options
author | Noah Loomans <noahloomans@gmail.com> | 2017-12-11 20:43:07 +0100 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2017-12-11 20:43:07 +0100 |
commit | 2216d1ceed02e54620f16fb826e5947b6c2cb9bf (patch) | |
tree | 410611fd10e8f5ec639a14f0bd1b651b8ce74845 /src/client | |
parent | 2cac093369ecb965ddbef60e6dc2aa6e50f0e937 (diff) |
Add line between results and search
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/react/components/container/Results.jsx | 21 | ||||
-rw-r--r-- | src/client/style/index.scss | 6 |
2 files changed, 20 insertions, 7 deletions
diff --git a/src/client/react/components/container/Results.jsx b/src/client/react/components/container/Results.jsx index 04d1f84..1c38c8b 100644 --- a/src/client/react/components/container/Results.jsx +++ b/src/client/react/components/container/Results.jsx @@ -1,13 +1,28 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; +import classnames from 'classnames'; import Result from '../presentational/Result'; const Results = (({ results }) => ( - results.map(user => ( - <Result key={user.value} user={user} /> - )) + <div + className={classnames('search__results', { + 'search__results--has-results': results.length > 0, + })} + > + {results.map(user => ( + <Result key={user.value} user={user} /> + ))} + </div> )); +Results.propTypes = { + results: PropTypes.arrayOf(PropTypes.shape({ + type: PropTypes.string, + value: PropTypes.value, + })).isRequired, +}; + const mapStateToProps = state => ({ results: state.search.results, }); diff --git a/src/client/style/index.scss b/src/client/style/index.scss index 19ef748..8e1b4d0 100644 --- a/src/client/style/index.scss +++ b/src/client/style/index.scss @@ -16,10 +16,8 @@ body { box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); } - &--has-results { - .search__input-wrapper { - border-bottom: 1px #BDBDBD solid; - } + &__results--has-results { + border-top: 1px #BDBDBD solid; } &__icon-wrapper { |