diff --git a/src/renderer/src/pages/home/Markdown/MermaidPopup.tsx b/src/renderer/src/pages/home/Markdown/MermaidPopup.tsx index 5134e790d8..c626c1c259 100644 --- a/src/renderer/src/pages/home/Markdown/MermaidPopup.tsx +++ b/src/renderer/src/pages/home/Markdown/MermaidPopup.tsx @@ -3,6 +3,7 @@ import { download } from '@renderer/utils/download' import { Button, Modal, Space, Tabs } from 'antd' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' +import styled from 'styled-components' interface ShowParams { chart: string @@ -97,6 +98,7 @@ const PopupContainer: React.FC = ({ resolve, chart }) => { onCancel={onCancel} afterClose={onClose} width={1000} + centered footer={[ @@ -109,18 +111,9 @@ const PopupContainer: React.FC = ({ resolve, chart }) => { key: 'preview', label: t('mermaid.tabs.preview'), children: ( -
+ {chart} -
+ ) }, { @@ -163,3 +156,9 @@ export default class MermaidPopup { }) } } + +const StyledMermaid = styled.div` + max-height: calc(80vh - 200px); + text-align: center; + overflow-y: auto; +`