From 61ceca236365181f12c0b7a295eac9564a30ae66 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Sat, 9 Nov 2024 22:26:35 +0800 Subject: [PATCH] feat: update sidebar menu with interactive tooltips and painting terminology --- src/renderer/src/components/app/Sidebar.tsx | 112 ++++++++++-------- src/renderer/src/i18n/locales/zh-cn.json | 2 +- .../src/pages/paintings/PaintingsList.tsx | 2 +- .../src/pages/paintings/PaintingsPage.tsx | 30 ++--- 4 files changed, 82 insertions(+), 64 deletions(-) diff --git a/src/renderer/src/components/app/Sidebar.tsx b/src/renderer/src/components/app/Sidebar.tsx index c15b5437..f05ba782 100644 --- a/src/renderer/src/components/app/Sidebar.tsx +++ b/src/renderer/src/components/app/Sidebar.tsx @@ -5,6 +5,7 @@ import { useTheme } from '@renderer/context/ThemeProvider' import useAvatar from '@renderer/hooks/useAvatar' import { useRuntime } from '@renderer/hooks/useRuntime' import { useSettings } from '@renderer/hooks/useSettings' +import { Tooltip } from 'antd' import { Avatar } from 'antd' import { FC } from 'react' import { useTranslation } from 'react-i18next' @@ -50,57 +51,74 @@ const Sidebar: FC = () => { - to('/')}> - - - - - to('/agents')}> - - - - - to('/paintings')}> - - - - - to('/translate')}> - - - - - to('/apps')}> - - - - - to('/files')}> - - - - - to('/messages')}> - - - - + + to('/')}> + + + + + + + to('/agents')}> + + + + + + + to('/paintings')}> + + + + + + + to('/translate')}> + + + + + + + to('/apps')}> + + + + + + + to('/files')}> + + + + + + + to('/messages')}> + + + + + - toggleTheme()}> - {theme === 'dark' ? ( - - ) : ( - - )} - - - to(isLocalAi ? '/settings/assistant' : '/settings/provider')}> - - + + toggleTheme()}> + {theme === 'dark' ? ( + + ) : ( + + )} - + + + to(isLocalAi ? '/settings/assistant' : '/settings/provider')}> + + + + + ) diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index 46b7c9a0..b8b384e6 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -145,7 +145,7 @@ "stream_output": "流式输出", "search": "搜索模型..." }, - "images": { + "paintings": { "title": "图片", "image.size": "图片尺寸", "button.new.image": "新建图片", diff --git a/src/renderer/src/pages/paintings/PaintingsList.tsx b/src/renderer/src/pages/paintings/PaintingsList.tsx index 679253c0..44dc42aa 100644 --- a/src/renderer/src/pages/paintings/PaintingsList.tsx +++ b/src/renderer/src/pages/paintings/PaintingsList.tsx @@ -45,7 +45,7 @@ const PaintingsList: FC = ({ onDeletePainting(item)} okButtonProps={{ danger: true }} placement="left"> diff --git a/src/renderer/src/pages/paintings/PaintingsPage.tsx b/src/renderer/src/pages/paintings/PaintingsPage.tsx index 54392839..8ea675f7 100644 --- a/src/renderer/src/pages/paintings/PaintingsPage.tsx +++ b/src/renderer/src/pages/paintings/PaintingsPage.tsx @@ -107,7 +107,7 @@ const PaintingsPage: FC = () => { const onGenerate = async () => { if (painting.files.length > 0) { const confirmed = await window.modal.confirm({ - content: t('images.regenerate.confirm'), + content: t('paintings.regenerate.confirm'), centered: true }) @@ -252,11 +252,11 @@ const PaintingsPage: FC = () => { return ( - {t('images.title')} + {t('paintings.title')} {isMac && ( )} @@ -271,7 +271,7 @@ const PaintingsPage: FC = () => { /> {t('common.model')}