mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 13:19:33 +08:00
style: update code block ui styling and logic
This commit is contained in:
parent
223496192d
commit
535b7d0a92
@ -82,7 +82,9 @@ const CodeBlock: React.FC<CodeBlockProps> = ({ children, className }) => {
|
|||||||
<div className="code-block">
|
<div className="code-block">
|
||||||
<CodeHeader>
|
<CodeHeader>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
||||||
{codeCollapsible && <CollapseIcon expanded={isExpanded} onClick={() => setIsExpanded(!isExpanded)} />}
|
{codeCollapsible && shouldShowExpandButton && (
|
||||||
|
<CollapseIcon expanded={isExpanded} onClick={() => setIsExpanded(!isExpanded)} />
|
||||||
|
)}
|
||||||
<CodeLanguage>{'<' + match[1].toUpperCase() + '>'}</CodeLanguage>
|
<CodeLanguage>{'<' + match[1].toUpperCase() + '>'}</CodeLanguage>
|
||||||
</div>
|
</div>
|
||||||
<CopyButton text={children} />
|
<CopyButton text={children} />
|
||||||
@ -207,8 +209,8 @@ const CodeFooter = styled.div`
|
|||||||
const ExpandButtonWrapper = styled.div`
|
const ExpandButtonWrapper = styled.div`
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 30px;
|
height: 25px;
|
||||||
margin-top: -30px;
|
margin-top: -25px;
|
||||||
|
|
||||||
.button-text {
|
.button-text {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user