fix popup ui

This commit is contained in:
go0p
2026-08-06 15:11:35 +08:00
committed by go0p
parent 5dc98745de
commit eabf81c1af
2 changed files with 97 additions and 20 deletions
+6 -13
View File
@@ -205,13 +205,9 @@ export const ProxySwitch: React.FC = () => {
const items: MenuProps['items'] = [
...FIXED_MODES.map(mode => ({
key: mode.key,
label: (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%' }}>
<span>{mode.name}</span>
{currentMode === mode.key && <span>🟢</span>}
</div>
),
label: mode.name,
icon: mode.icon,
className: `${currentMode === mode.key ? 'active-item' : ''} menu-id-${mode.key}`,
})),
{type: 'divider'}
];
@@ -221,13 +217,9 @@ export const ProxySwitch: React.FC = () => {
items.push(
...customProxies.map(proxy => ({
key: proxy.key,
label: (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%' }}>
<span>{proxy.name}</span>
{currentMode === proxy.key && <CheckOutlined style={{ color: 'var(--yakit-primary)' }} />}
</div>
),
label: proxy.name,
icon: <img src={YAK_ICON_URL} alt="YAK" style={{width: 16, height: 16}}/>,
className: `${currentMode === proxy.key ? 'active-item' : ''} menu-id-${proxy.key}`,
}))
);
items.push({type: 'divider'});
@@ -238,6 +230,7 @@ export const ProxySwitch: React.FC = () => {
key: 'setting',
label: '代理设置',
icon: <SettingOutlined/>,
className: 'menu-id-setting',
});
// 添加新建代理选项
@@ -245,6 +238,7 @@ export const ProxySwitch: React.FC = () => {
key: 'add',
label: '添加代理',
icon: <PlusOutlined/>,
className: 'menu-id-add',
});
return items;
@@ -257,7 +251,6 @@ export const ProxySwitch: React.FC = () => {
selectedKeys={[currentMode]}
items={buildMenuItems()}
onClick={({key}) => handleModeChange(key)}
data-menu-id={currentMode}
/>
{isLoading && <div className="loading-overlay">切换中...</div>}
</div>