Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
πŸ› bug: remove ConfigProvider (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 authored Jul 13, 2020
1 parent 289a47b commit 6cc0eb8
Showing 1 changed file with 10 additions and 39 deletions.
49 changes: 10 additions & 39 deletions src/WrapContent.tsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,19 @@
import React, { CSSProperties } from 'react';
import { ConfigProvider, Layout } from 'antd';
import { Layout } from 'antd';

const { Content } = Layout;

class WrapContent extends React.Component<{
const WrapContent: React.FC<{
isChildrenLayout?: boolean;
className?: string;
style?: CSSProperties;
location?: any;
prefixCls?: string;
contentHeight?: number | string;
}> {
ref: HTMLDivElement | null = null;

render() {
const {
style,
prefixCls,
className,
children,
isChildrenLayout,
} = this.props;
return (
<Content className={className} style={style}>
<ConfigProvider
getPopupContainer={() => {
if (isChildrenLayout && this.ref) {
return this.ref;
}
return document.body;
}}
>
<div
ref={(ele) => {
this.ref = ele;
}}
className={`${prefixCls}-basicLayout-children-content-wrap`}
>
{children}
</div>
</ConfigProvider>
</Content>
);
}
}
}> = (props) => {
const { style, className, children } = props;
return (
<Layout.Content className={className} style={style}>
{children}
</Layout.Content>
);
};

export default WrapContent;

0 comments on commit 6cc0eb8

Please sign in to comment.