mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-26 21:21:53 +08:00
fix popup ui
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user