From e6a883c592ff94fb6d9bcf52070f2430812831ad Mon Sep 17 00:00:00 2001 From: Rin <52448921+KurumiRin@users.noreply.github.com> Date: Sun, 28 May 2023 01:36:03 +0800 Subject: [PATCH] style: optimization code (#42679) * style: optimization code * style: use const replace themestyle init --- components/empty/empty.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/components/empty/empty.tsx b/components/empty/empty.tsx index c382a34ab3..75a4aa5c0b 100644 --- a/components/empty/empty.tsx +++ b/components/empty/empty.tsx @@ -6,14 +6,9 @@ const Empty: React.FC = () => { const [, token] = useToken(); const bgColor = new TinyColor(token.colorBgBase); - let themeStyle: React.CSSProperties = {}; // Dark Theme need more dark of this - if (bgColor.toHsl().l < 0.5) { - themeStyle = { - opacity: 0.65, - }; - } + const themeStyle: React.CSSProperties = bgColor.toHsl().l < 0.5 ? { opacity: 0.65 } : {}; return (