1 | import * as React from 'react';
|
2 | import * as PropTypes from 'prop-types';
|
3 | import { SidebarHideProps as ReakitSidebarHideProps } from 'reakit/ts';
|
4 |
|
5 | import { SidebarHide as _SidebarHide } from './styled';
|
6 |
|
7 | export type LocalSidebarHideProps = {
|
8 | children?: React.ReactNode | void;
|
9 | hide(): void;
|
10 | onClick?(): void;
|
11 | };
|
12 | export type SidebarHideProps = LocalSidebarHideProps & ReakitSidebarHideProps;
|
13 |
|
14 | export const SidebarHide: React.FunctionComponent<LocalSidebarHideProps> = React.forwardRef(
|
15 | ({ children, ...props }, ref) => (
|
16 |
|
17 | <_SidebarHide {...props} ref={ref}>
|
18 | {children}
|
19 | </_SidebarHide>
|
20 | )
|
21 | );
|
22 |
|
23 | export const sidebarHidePropTypes = {
|
24 | children: PropTypes.node,
|
25 | hide: PropTypes.func.isRequired,
|
26 | onClick: PropTypes.func
|
27 | };
|
28 | SidebarHide.propTypes = sidebarHidePropTypes;
|
29 |
|
30 | export const sidebarHideDefaultProps = {
|
31 | children: null,
|
32 | onClick: undefined
|
33 | };
|
34 | SidebarHide.defaultProps = sidebarHideDefaultProps;
|
35 |
|
36 |
|
37 | const C: React.FunctionComponent<SidebarHideProps> = SidebarHide;
|
38 | export default C;
|