From 6cb1846b234cc8d17f3976e2572739203f9bd39c Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Fri, 1 Nov 2024 12:06:30 +0800 Subject: [PATCH] fix: ui and layout --- src/renderer/src/components/TranslateButton.tsx | 2 +- src/renderer/src/i18n/locales/en-us.json | 2 +- src/renderer/src/i18n/locales/zh-cn.json | 2 +- src/renderer/src/i18n/locales/zh-tw.json | 2 +- .../src/pages/agents/components/AgentCard.tsx | 2 +- .../src/pages/history/components/TopicsHistory.tsx | 10 +++++++++- src/renderer/src/pages/paintings/PaintingsPage.tsx | 12 +++++------- 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/renderer/src/components/TranslateButton.tsx b/src/renderer/src/components/TranslateButton.tsx index 75844b49..60f86746 100644 --- a/src/renderer/src/components/TranslateButton.tsx +++ b/src/renderer/src/components/TranslateButton.tsx @@ -57,7 +57,7 @@ const TranslateButton: FC = ({ text, onTranslated, disabled, style }) => return ( @@ -63,6 +64,13 @@ const TopicsHistory: React.FC = ({ keywords, onClick, onSearch, ...props ))} ))} + {keywords.length >= 2 && ( +
+ +
+ )}
diff --git a/src/renderer/src/pages/paintings/PaintingsPage.tsx b/src/renderer/src/pages/paintings/PaintingsPage.tsx index d9c07197..964a315f 100644 --- a/src/renderer/src/pages/paintings/PaintingsPage.tsx +++ b/src/renderer/src/pages/paintings/PaintingsPage.tsx @@ -382,7 +382,7 @@ const PaintingsPage: FC = () => { text={textareaRef.current?.resizableTextArea?.textArea?.value} onTranslated={handleTranslation} disabled={isLoading} - style={{ marginRight: 6 }} + style={{ marginRight: 6, borderRadius: '50%' }} /> @@ -439,13 +439,11 @@ const MainContainer = styled.div` const InputContainer = styled.div` display: flex; flex-direction: column; - min-height: 100px; - max-height: 100px; + min-height: 95px; + max-height: 95px; position: relative; - border: 1px solid var(--color-border-soft); + border-top: 1px solid var(--color-border-soft); transition: all 0.3s ease; - margin: 0 20px 15px 20px; - border-radius: 10px; ` const Textarea = styled(TextArea)` @@ -466,7 +464,7 @@ const Toolbar = styled.div` justify-content: flex-end; padding: 0 8px; padding-bottom: 0; - height: 36px; + height: 40px; ` const ToolbarMenu = styled.div`