|
@ -14,8 +14,8 @@ import { cycleElefriendCompose } from 'flavours/glitch/actions/compose'; |
|
|
import Composer from 'flavours/glitch/features/composer'; |
|
|
import Composer from 'flavours/glitch/features/composer'; |
|
|
import DrawerAccount from './account'; |
|
|
import DrawerAccount from './account'; |
|
|
import DrawerHeader from './header'; |
|
|
import DrawerHeader from './header'; |
|
|
import DrawerResults from './results'; |
|
|
|
|
|
import SearchContainer from './containers/search_container'; |
|
|
import SearchContainer from './containers/search_container'; |
|
|
|
|
|
import SearchResultsContainer from './containers/search_results_container'; |
|
|
import spring from 'react-motion/lib/spring'; |
|
|
import spring from 'react-motion/lib/spring'; |
|
|
|
|
|
|
|
|
// Utils.
|
|
|
// Utils.
|
|
@ -32,9 +32,6 @@ const mapStateToProps = (state, ownProps) => ({ |
|
|
account: state.getIn(['accounts', me]), |
|
|
account: state.getIn(['accounts', me]), |
|
|
columns: state.getIn(['settings', 'columns']), |
|
|
columns: state.getIn(['settings', 'columns']), |
|
|
elefriend: state.getIn(['compose', 'elefriend']), |
|
|
elefriend: state.getIn(['compose', 'elefriend']), |
|
|
results: state.getIn(['search', 'results']), |
|
|
|
|
|
searchHidden: state.getIn(['search', 'hidden']), |
|
|
|
|
|
submitted: state.getIn(['search', 'submitted']), |
|
|
|
|
|
showSearch: ownProps.multiColumn ? state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']) : ownProps.isSearchPage, |
|
|
showSearch: ownProps.multiColumn ? state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']) : ownProps.isSearchPage, |
|
|
unreadNotifications: state.getIn(['notifications', 'unread']), |
|
|
unreadNotifications: state.getIn(['notifications', 'unread']), |
|
|
showNotificationsBadge: state.getIn(['local_settings', 'notifications', 'tab_badge']), |
|
|
showNotificationsBadge: state.getIn(['local_settings', 'notifications', 'tab_badge']), |
|
@ -65,10 +62,7 @@ class Compose extends React.PureComponent { |
|
|
// State props.
|
|
|
// State props.
|
|
|
account: ImmutablePropTypes.map, |
|
|
account: ImmutablePropTypes.map, |
|
|
columns: ImmutablePropTypes.list, |
|
|
columns: ImmutablePropTypes.list, |
|
|
results: ImmutablePropTypes.map, |
|
|
|
|
|
elefriend: PropTypes.number, |
|
|
elefriend: PropTypes.number, |
|
|
searchHidden: PropTypes.bool, |
|
|
|
|
|
submitted: PropTypes.bool, |
|
|
|
|
|
unreadNotifications: PropTypes.number, |
|
|
unreadNotifications: PropTypes.number, |
|
|
showNotificationsBadge: PropTypes.bool, |
|
|
showNotificationsBadge: PropTypes.bool, |
|
|
|
|
|
|
|
@ -87,9 +81,6 @@ class Compose extends React.PureComponent { |
|
|
multiColumn, |
|
|
multiColumn, |
|
|
onClickElefriend, |
|
|
onClickElefriend, |
|
|
onOpenSettings, |
|
|
onOpenSettings, |
|
|
results, |
|
|
|
|
|
searchHidden, |
|
|
|
|
|
submitted, |
|
|
|
|
|
isSearchPage, |
|
|
isSearchPage, |
|
|
unreadNotifications, |
|
|
unreadNotifications, |
|
|
showNotificationsBadge, |
|
|
showNotificationsBadge, |
|
@ -124,7 +115,7 @@ class Compose extends React.PureComponent { |
|
|
<Motion defaultStyle={{ x: isSearchPage ? 0 : -100 }} style={{ x: spring(showSearch || isSearchPage ? 0 : -100, { stiffness: 210, damping: 20 }) }}> |
|
|
<Motion defaultStyle={{ x: isSearchPage ? 0 : -100 }} style={{ x: spring(showSearch || isSearchPage ? 0 : -100, { stiffness: 210, damping: 20 }) }}> |
|
|
{({ x }) => ( |
|
|
{({ x }) => ( |
|
|
<div className='drawer__inner darker' style={{ transform: `translateX(${x}%)`, visibility: x === -100 ? 'hidden' : 'visible' }}> |
|
|
<div className='drawer__inner darker' style={{ transform: `translateX(${x}%)`, visibility: x === -100 ? 'hidden' : 'visible' }}> |
|
|
<DrawerResults results={results} visible={submitted && !searchHidden} /> |
|
|
|
|
|
|
|
|
<SearchResultsContainer /> |
|
|
</div> |
|
|
</div> |
|
|
)} |
|
|
)} |
|
|
</Motion> |
|
|
</Motion> |
|
|