feat(FeatureMenus, Footer): replace Ant Design icons with Lucide icons and enhance layout

- Updated icons in FeatureMenus from Ant Design to Lucide for improved visual consistency.
- Refactored Footer component to use Lucide icons and adjusted layout for better alignment and spacing.
- Enhanced styling of Tag components for a more cohesive design.
This commit is contained in:
kangfenmao 2025-04-19 18:54:17 +08:00
parent e4de5331e0
commit 4663794ba6
2 changed files with 35 additions and 29 deletions

View File

@ -1,6 +1,7 @@
import { BulbOutlined, EnterOutlined, FileTextOutlined, MessageOutlined, TranslationOutlined } from '@ant-design/icons' import { EnterOutlined } from '@ant-design/icons'
import Scrollbar from '@renderer/components/Scrollbar' import Scrollbar from '@renderer/components/Scrollbar'
import { Col } from 'antd' import { Col } from 'antd'
import { FileText, Languages, Lightbulb, MessageSquare } from 'lucide-react'
import { Dispatch, SetStateAction, useImperativeHandle, useMemo, useState } from 'react' import { Dispatch, SetStateAction, useImperativeHandle, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import styled from 'styled-components' import styled from 'styled-components'
@ -30,7 +31,7 @@ const FeatureMenus = ({
const features = useMemo( const features = useMemo(
() => [ () => [
{ {
icon: <MessageOutlined style={{ fontSize: '16px', color: 'var(--color-text)' }} />, icon: <MessageSquare size={16} color="var(--color-text)" />,
title: t('miniwindow.feature.chat'), title: t('miniwindow.feature.chat'),
active: true, active: true,
onClick: () => { onClick: () => {
@ -41,12 +42,12 @@ const FeatureMenus = ({
} }
}, },
{ {
icon: <TranslationOutlined style={{ fontSize: '16px', color: 'var(--color-text)' }} />, icon: <Languages size={16} color="var(--color-text)" />,
title: t('miniwindow.feature.translate'), title: t('miniwindow.feature.translate'),
onClick: () => text && setRoute('translate') onClick: () => text && setRoute('translate')
}, },
{ {
icon: <FileTextOutlined style={{ fontSize: '16px', color: 'var(--color-text)' }} />, icon: <FileText size={16} color="var(--color-text)" />,
title: t('miniwindow.feature.summary'), title: t('miniwindow.feature.summary'),
onClick: () => { onClick: () => {
if (text) { if (text) {
@ -56,7 +57,7 @@ const FeatureMenus = ({
} }
}, },
{ {
icon: <BulbOutlined style={{ fontSize: '16px', color: 'var(--color-text)' }} />, icon: <Lightbulb size={16} color="var(--color-text)" />,
title: t('miniwindow.feature.explanation'), title: t('miniwindow.feature.explanation'),
onClick: () => { onClick: () => {
if (text) { if (text) {
@ -116,6 +117,8 @@ const FeatureListWrapper = styled.div`
` `
const FeatureItem = styled.div` const FeatureItem = styled.div`
display: flex;
flex-direction: row;
cursor: pointer; cursor: pointer;
transition: background-color 0s; transition: background-color 0s;
background: transparent; background: transparent;
@ -139,6 +142,7 @@ const FeatureItem = styled.div`
const FeatureIcon = styled.div` const FeatureIcon = styled.div`
color: #fff; color: #fff;
display: flex;
` `
const FeatureTitle = styled.h3` const FeatureTitle = styled.h3`

View File

@ -1,5 +1,6 @@
import { ArrowLeftOutlined, CopyOutlined, LogoutOutlined, PushpinFilled, PushpinOutlined } from '@ant-design/icons' import { ArrowLeftOutlined } from '@ant-design/icons'
import { Tag, Tooltip } from 'antd' import { Tag as AntdTag, Tooltip } from 'antd'
import { CircleArrowLeft, Copy, Pin } from 'lucide-react'
import { FC, useState } from 'react' import { FC, useState } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import styled from 'styled-components' import styled from 'styled-components'
@ -23,20 +24,10 @@ const Footer: FC<FooterProps> = ({ route, canUseBackspace, clearClipboard, onExi
return ( return (
<WindowFooter className="drag"> <WindowFooter className="drag">
<PinButtonArea onClick={() => onClickPin()} className="nodrag">
<Tooltip title={t('miniwindow.tooltip.pin')} mouseEnterDelay={0.8} placement="left">
{isPinned ? (
<PushpinFilled style={{ fontSize: '18px', color: 'var(--color-primary)' }} />
) : (
<PushpinOutlined style={{ fontSize: '18px' }} />
)}
</Tooltip>
</PinButtonArea>
<FooterText> <FooterText>
<Tag <Tag
bordered={false} bordered={false}
icon={<LogoutOutlined />} icon={<CircleArrowLeft size={14} color="var(--color-text)" />}
style={{ cursor: 'pointer' }}
className="nodrag" className="nodrag"
onClick={() => onExit()}> onClick={() => onExit()}>
{t('miniwindow.footer.esc', { {t('miniwindow.footer.esc', {
@ -54,41 +45,52 @@ const Footer: FC<FooterProps> = ({ route, canUseBackspace, clearClipboard, onExi
</Tag> </Tag>
)} )}
{route !== 'home' && ( {route !== 'home' && (
<Tag bordered={false} icon={<CopyOutlined />} style={{ cursor: 'pointer' }} className="nodrag"> <Tag
bordered={false}
icon={<Copy size={14} color="var(--color-text)" />}
style={{ cursor: 'pointer' }}
className="nodrag">
{t('miniwindow.footer.copy_last_message')} {t('miniwindow.footer.copy_last_message')}
</Tag> </Tag>
)} )}
</FooterText> </FooterText>
<PinButtonArea onClick={() => onClickPin()} className="nodrag">
<Tooltip title={t('miniwindow.tooltip.pin')} mouseEnterDelay={0.8} placement="left">
<Pin size={14} stroke={isPinned ? 'var(--color-primary)' : 'var(--color-text)'} />
</Tooltip>
</PinButtonArea>
</WindowFooter> </WindowFooter>
) )
} }
const WindowFooter = styled.div` const WindowFooter = styled.div`
position: relative; display: flex;
width: 100%; flex-direction: row;
text-align: center; justify-content: space-between;
padding: 5px 0; padding: 5px 0;
color: var(--color-text-secondary); color: var(--color-text-secondary);
font-size: 12px; font-size: 12px;
` `
const FooterText = styled.div` const FooterText = styled.div`
width: 100%;
height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 5px;
color: var(--color-text-secondary); color: var(--color-text-secondary);
font-size: 12px; font-size: 12px;
` `
const PinButtonArea = styled.div` const PinButtonArea = styled.div`
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
cursor: pointer; cursor: pointer;
display: flex;
align-items: center;
`
const Tag = styled(AntdTag)`
cursor: pointer;
display: flex;
align-items: center;
gap: 5px;
` `
export default Footer export default Footer