mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-02 18:39:06 +08:00
refactor(MarkdownStyles): remove last-child margin override; adjust MessageFooter margin and clean up unused code in MessageAttachments
This commit is contained in:
parent
6d602d5d48
commit
e0bc3bb2c5
@ -260,10 +260,6 @@
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
> *:last-child {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.footnotes {
|
||||
|
||||
@ -267,7 +267,7 @@ const MessageFooter = styled.div<{ $isLastMessage: boolean; $messageStyle: 'plai
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
margin-left: 46px;
|
||||
margin-top: 8px;
|
||||
margin-top: 3px;
|
||||
`
|
||||
|
||||
const NewContextMessage = styled.div<{ isMultiSelectMode: boolean }>`
|
||||
|
||||
@ -20,49 +20,9 @@ const StyledUpload = styled(Upload)`
|
||||
`
|
||||
|
||||
const MessageAttachments: FC<Props> = ({ block }) => {
|
||||
// const handleCopyImage = async (image: FileMetadata) => {
|
||||
// const data = await FileManager.readFile(image)
|
||||
// const blob = new Blob([data], { type: 'image/png' })
|
||||
// const item = new ClipboardItem({ [blob.type]: blob })
|
||||
// await navigator.clipboard.write([item])
|
||||
// }
|
||||
|
||||
if (!block.file) {
|
||||
return null
|
||||
}
|
||||
// 由图片块代替
|
||||
// if (block.file.type === FileTypes.IMAGE) {
|
||||
// return (
|
||||
// <Container style={{ marginBottom: 8 }}>
|
||||
// <Image
|
||||
// src={FileManager.getFileUrl(block.file)}
|
||||
// key={block.file.id}
|
||||
// width="33%"
|
||||
// preview={{
|
||||
// toolbarRender: (
|
||||
// _,
|
||||
// {
|
||||
// transform: { scale },
|
||||
// actions: { onFlipY, onFlipX, onRotateLeft, onRotateRight, onZoomOut, onZoomIn, onReset }
|
||||
// }
|
||||
// ) => (
|
||||
// <ToobarWrapper size={12} className="toolbar-wrapper">
|
||||
// <SwapOutlined rotate={90} onClick={onFlipY} />
|
||||
// <SwapOutlined onClick={onFlipX} />
|
||||
// <RotateLeftOutlined onClick={onRotateLeft} />
|
||||
// <RotateRightOutlined onClick={onRotateRight} />
|
||||
// <ZoomOutOutlined disabled={scale === 1} onClick={onZoomOut} />
|
||||
// <ZoomInOutlined disabled={scale === 50} onClick={onZoomIn} />
|
||||
// <UndoOutlined onClick={onReset} />
|
||||
// <CopyOutlined onClick={() => handleCopyImage(block.file)} />
|
||||
// <DownloadOutlined onClick={() => download(FileManager.getFileUrl(block.file))} />
|
||||
// </ToobarWrapper>
|
||||
// )
|
||||
// }}
|
||||
// />
|
||||
// </Container>
|
||||
// )
|
||||
// }
|
||||
|
||||
return (
|
||||
<Container style={{ marginTop: 2, marginBottom: 8 }} className="message-attachments">
|
||||
@ -89,23 +49,4 @@ const Container = styled.div`
|
||||
margin-top: 8px;
|
||||
`
|
||||
|
||||
// const Image = styled(AntdImage)`
|
||||
// border-radius: 10px;
|
||||
// `
|
||||
|
||||
// const ToobarWrapper = styled(Space)`
|
||||
// padding: 0px 24px;
|
||||
// color: #fff;
|
||||
// font-size: 20px;
|
||||
// background-color: rgba(0, 0, 0, 0.1);
|
||||
// border-radius: 100px;
|
||||
// .anticon {
|
||||
// padding: 12px;
|
||||
// cursor: pointer;
|
||||
// }
|
||||
// .anticon:hover {
|
||||
// opacity: 0.3;
|
||||
// }
|
||||
// `
|
||||
|
||||
export default MessageAttachments
|
||||
|
||||
@ -605,6 +605,11 @@ const CollapseContainer = styled(Collapse)`
|
||||
const ToolContainer = styled.div`
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
`
|
||||
|
||||
const MarkdownContainer = styled.div`
|
||||
|
||||
Loading…
Reference in New Issue
Block a user