File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 11import withApollo from "./with-apollo" ;
22import withRouter from "./with-router" ;
3+ import withAntd from "./with-antd" ;
34
45/**
56 * @hoc Инициализирующая логика приложения
67 * FIXME: Потом какой-нибудь `compose` метод заинсталлим откуда-нить и покрасивше будет
78 */
8- export const withHocs = ( component : Component ) => withRouter ( withApollo ( component ) ) ;
9+ export const withHocs = ( component : Component ) => withAntd ( withRouter ( withApollo ( component ) ) ) ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { ConfigProvider } from "antd" ;
3+
4+ // eslint-disable-next-line max-len
5+ // https://ant.design/docs/react/faq#How-do-I-prevent-Select-Dropdown-DatePicker-TimePicker-Popover-Popconfirm-scrolling-with-the-page
6+
7+ /**
8+ * @hoc Инициализация antd для корректного использования компонентов
9+ * @remark Для попапов в системе - возвращаем parentElement (для фикса бага) или document.body (defaultValue)
10+ * @see https://github.com/ani-team/github-client/issues/162#issuecomment-736676022
11+ */
12+ const withAntd = ( component : Component ) => ( ) => (
13+ < ConfigProvider getPopupContainer = { ( { parentElement } ) => parentElement || document . body } >
14+ { component ( ) }
15+ </ ConfigProvider >
16+ ) ;
17+
18+ export default withAntd ;
You can’t perform that action at this time.
0 commit comments