about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/drawer/pager/index.js
blob: 8dc2d3ee93f77b8eee297809db56949ff5fb4c42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//  Package imports.
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';

//  Components.
import IconButton from 'flavours/glitch/components/icon_button';
import Composer from 'flavours/glitch/features/composer';
import DrawerPagerAccount from './account';

//  The component.
export default function DrawerPager ({
  account,
  active,
  onClose,
  onFocus,
}) {
  const computedClass = classNames('drawer--pager', { active });

  //  The result.
  return (
    <div
      className={computedClass}
      onFocus={onFocus}
    >
      <DrawerPagerAccount account={account} />
      <IconButton
        icon='close'
        onClick={onClose}
        title=''
      />
      <Composer />
    </div>
  );
}

DrawerPager.propTypes = {
  account: ImmutablePropTypes.map,
  active: PropTypes.bool,
  onClose: PropTypes.func,
  onFocus: PropTypes.func,
};