From d5d39c645818045cdff396f56c0d26b9b667681a Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Tue, 19 Nov 2024 11:49:35 +0800 Subject: [PATCH] style: update code block ui styling and logic --- src/renderer/src/pages/home/Markdown/CodeBlock.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/pages/home/Markdown/CodeBlock.tsx b/src/renderer/src/pages/home/Markdown/CodeBlock.tsx index 48984bcf95..6e817d6e70 100644 --- a/src/renderer/src/pages/home/Markdown/CodeBlock.tsx +++ b/src/renderer/src/pages/home/Markdown/CodeBlock.tsx @@ -82,7 +82,9 @@ const CodeBlock: React.FC = ({ children, className }) => {
- {codeCollapsible && setIsExpanded(!isExpanded)} />} + {codeCollapsible && shouldShowExpandButton && ( + setIsExpanded(!isExpanded)} /> + )} {'<' + match[1].toUpperCase() + '>'}
@@ -207,8 +209,8 @@ const CodeFooter = styled.div` const ExpandButtonWrapper = styled.div` position: relative; cursor: pointer; - height: 30px; - margin-top: -30px; + height: 25px; + margin-top: -25px; .button-text { position: absolute;