From 21d4f7519c3e76fa0e65c3bd929df84cfce0150c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Tue, 18 Jun 2019 14:37:24 +0800 Subject: [PATCH] fix: fix CopyBlock style warning --- src/components/CopyBlock/index.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/CopyBlock/index.tsx b/src/components/CopyBlock/index.tsx index 2292078e..9ee05ae8 100644 --- a/src/components/CopyBlock/index.tsx +++ b/src/components/CopyBlock/index.tsx @@ -1,7 +1,7 @@ import { Icon, Popover, Typography } from 'antd'; import { FormattedMessage } from 'umi-plugin-react/locale'; -import React from 'react'; +import React, { useRef } from 'react'; import { connect } from 'dva'; import { isAntDesignPro } from '@/utils/utils'; import styles from './index.less'; @@ -41,8 +41,13 @@ const BlockCodeView: React.SFC<{ text: blockUrl, onCopy: () => onBlockCopy(url), }} + style={{ + display: 'flex', + }} > - {blockUrl} +
+          {blockUrl}
+        
); @@ -58,14 +63,16 @@ export default connect(({ routing }: { routing: RoutingType }) => ({ location: routing.location, }))(({ location }: RoutingType) => { const url = location.pathname; + const divDom = useRef(null); return ( } placement="topLeft" content={} trigger="click" + getPopupContainer={dom => (divDom.current ? divDom.current : dom)} > -
+
-- GitLab