Fix current width calc

This commit is contained in:
Oswaldo Acauan 2018-06-04 16:43:54 -03:00
parent a5d173a1f2
commit fb04db7b54
2 changed files with 2 additions and 2 deletions

View File

@ -170,7 +170,7 @@ class App extends Component {
bottomRight: false, bottomLeft: false, topLeft: false }}
onResize={(e, direction, ref) => {
const { compactUserList } = this.state;
const shouldBeCompact = (e.clientX - ref.offsetLeft) <= USERLIST_COMPACT_WIDTH;
const shouldBeCompact = ref.clientWidth <= USERLIST_COMPACT_WIDTH;
if (compactUserList === shouldBeCompact) return;
this.setState({ compactUserList: shouldBeCompact });
}}

View File

@ -24,7 +24,7 @@ const propTypes = {
roving: PropTypes.func.isRequired,
};
const UserListContainer = (props) => <UserList {...props} />;
const UserListContainer = props => <UserList {...props} />;
UserListContainer.propTypes = propTypes;