diff --git a/client/web/plugins/com.msgbyte.genshin/src/GenshinPanel/GachaPool/GachaPoolItem.tsx b/client/web/plugins/com.msgbyte.genshin/src/GenshinPanel/GachaPool/GachaPoolItem.tsx index 2983c901..4c31de2b 100644 --- a/client/web/plugins/com.msgbyte.genshin/src/GenshinPanel/GachaPool/GachaPoolItem.tsx +++ b/client/web/plugins/com.msgbyte.genshin/src/GenshinPanel/GachaPool/GachaPoolItem.tsx @@ -14,6 +14,7 @@ const ItemRoot = styled.div` text-align: center; font-weight: bold; line-height: 44px; + text-wrap: nowrap; } `; diff --git a/client/web/plugins/com.msgbyte.genshin/src/GenshinPanel/index.tsx b/client/web/plugins/com.msgbyte.genshin/src/GenshinPanel/index.tsx index 08f2522a..7259abfa 100644 --- a/client/web/plugins/com.msgbyte.genshin/src/GenshinPanel/index.tsx +++ b/client/web/plugins/com.msgbyte.genshin/src/GenshinPanel/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Translate } from '../translate'; import { OfficialGachaIndex, OfficialGachaType, util } from 'genshin-gacha-kit'; import { useAsync } from '@capital/common'; -import { PillTabs, PillTabPane, LoadingSpinner } from '@capital/component'; +import { PillTabs, LoadingSpinner } from '@capital/component'; import { GachaPool } from './GachaPool'; import _groupBy from 'lodash/groupBy'; import './index.less'; @@ -32,16 +32,13 @@ const GenshinPanel: React.FC = React.memo(() => { {loading && } - - {(gachaList ?? []).map((item) => ( - - - - ))} - + ({ + key: String(item.gacha_id), + label: `${item.gacha_name}(${item.begin_time} - ${item.end_time})`, + children: , + }))} + /> ); }); diff --git a/client/web/src/components/PillTabs.tsx b/client/web/src/components/PillTabs.tsx index dd9d2cfd..9a30968d 100644 --- a/client/web/src/components/PillTabs.tsx +++ b/client/web/src/components/PillTabs.tsx @@ -5,11 +5,7 @@ import './PillTabs.less'; /** * @example - * - * - * ... - * - * + * */ export const PillTabs: React.FC = React.memo((props) => { return ( @@ -20,4 +16,7 @@ export const PillTabs: React.FC = React.memo((props) => { }); PillTabs.displayName = 'PillTabs'; +/** + * @deprecated + */ export const PillTabPane = Tabs.TabPane; diff --git a/client/web/src/components/modals/GroupDetail/Role/index.tsx b/client/web/src/components/modals/GroupDetail/Role/index.tsx index 21814615..ae5dffb1 100644 --- a/client/web/src/components/modals/GroupDetail/Role/index.tsx +++ b/client/web/src/components/modals/GroupDetail/Role/index.tsx @@ -1,5 +1,5 @@ import { Loading } from '@/components/Loading'; -import { PillTabPane, PillTabs } from '@/components/PillTabs'; +import { PillTabs } from '@/components/PillTabs'; import { AllPermission } from 'tailchat-shared'; import React, { useMemo, useState } from 'react'; import { t, useGroupInfo } from 'tailchat-shared'; @@ -61,44 +61,57 @@ export const GroupRole: React.FC = React.memo((props) => {
- - - {currentRoleInfo && ( - { - await handleDeleteRole(); - setRoleId(AllPermission); // 删除身份组后切换到所有人 - }} - /> - )} - - - - - - {currentRoleInfo && ( - - )} - - + + {currentRoleInfo && ( + { + await handleDeleteRole(); + setRoleId(AllPermission); // 删除身份组后切换到所有人 + }} + /> + )} + + ), + }, + { + key: 'permission', + label: t('权限'), + children: ( + + ), + }, + { + key: 'member', + label: t('管理成员'), + disabled: roleId === AllPermission, + children: ( + <> + {currentRoleInfo && ( + + )} + + ), + }, + ]} + />
diff --git a/client/web/src/plugin/PluginStore/index.tsx b/client/web/src/plugin/PluginStore/index.tsx index b946d849..704ebc80 100644 --- a/client/web/src/plugin/PluginStore/index.tsx +++ b/client/web/src/plugin/PluginStore/index.tsx @@ -44,60 +44,74 @@ export const PluginStore: React.FC = React.memo(() => { return (
- - - {t('已安装')} + + {t('已安装')} -
- {_uniqBy([...builtinPlugins, ...installedPluginList], 'name').map( - (plugin) => ( - - ) - )} -
-
+
+ {_uniqBy( + [...builtinPlugins, ...installedPluginList], + 'name' + ).map((plugin) => ( + + ))} +
+ + ), + }, + { + key: '2', + label: t('全部'), + children: ( + <> + {t('内置插件')} - - {t('内置插件')} +
+ {builtinPlugins.map((plugin) => ( + + ))} +
-
- {builtinPlugins.map((plugin) => ( - - ))} -
+ {t('插件中心')} - {t('插件中心')} - -
- {allPlugins - .filter((p) => !builtinPluginNameList.includes(p.name)) // 插件中心只显示不包含内置插件的插件 - .map((plugin) => ( - - ))} -
-
- - {t('手动安装')}} - key="3" - > - - -
+
+ {allPlugins + .filter((p) => !builtinPluginNameList.includes(p.name)) // 插件中心只显示不包含内置插件的插件 + .map((plugin) => ( + + ))} +
+ + ), + }, + { + key: '3', + label: {t('手动安装')}, + children: , + }, + ]} + />
); }); diff --git a/client/web/src/routes/Main/Content/Inbox/Sidebar.tsx b/client/web/src/routes/Main/Content/Inbox/Sidebar.tsx index 5f078d35..654b45e5 100644 --- a/client/web/src/routes/Main/Content/Inbox/Sidebar.tsx +++ b/client/web/src/routes/Main/Content/Inbox/Sidebar.tsx @@ -136,14 +136,20 @@ export const InboxSidebar: React.FC = React.memo(() => {
- - - {fullList.map((item) => renderInbox(item))} - - - {unreadList.map((item) => renderInbox(item))} - - + {fullList.map((item) => renderInbox(item))}, + }, + { + key: '2', + label: `${t('未读')} (${unreadList.length})`, + children: <>{unreadList.map((item) => renderInbox(item))}, + }, + ]} + />
); diff --git a/client/web/src/routes/Main/Content/Personal/Friends/index.tsx b/client/web/src/routes/Main/Content/Personal/Friends/index.tsx index 9b93cd67..890bb470 100644 --- a/client/web/src/routes/Main/Content/Personal/Friends/index.tsx +++ b/client/web/src/routes/Main/Content/Personal/Friends/index.tsx @@ -1,11 +1,12 @@ import React, { useCallback, useState } from 'react'; -import { PillTabPane, PillTabs } from '@/components/PillTabs'; +import { PillTabs } from '@/components/PillTabs'; import { AddFriend } from './AddFriend'; import { t, useAppSelector, useGlobalConfigStore } from 'tailchat-shared'; import { RequestSend } from './RequestSend'; import { RequestReceived } from './RequestReceived'; import { FriendList } from './FriendList'; import { Badge } from 'antd'; +import _compact from 'lodash/compact'; /** * 主要内容组件 @@ -27,50 +28,50 @@ export const FriendPanel: React.FC = React.memo(() => { return (
- - - - - - {!disableAddFriend && ( - <> - - {t('已发送')} - - } - key="2" - > - - - - {t('待处理')} - - } - key="3" - > - - - {t('添加好友')}} - key="add" - > - - - - )} - + + ), + }, + !disableAddFriend && { + key: '2', + label: ( + + {t('已发送')} + + ), + children: , + }, + !disableAddFriend && { + key: '3', + label: ( + + {t('待处理')} + + ), + children: , + }, + !disableAddFriend && { + key: '4', + label: {t('添加好友')}, + children: , + }, + ])} + />
); }); diff --git a/server/plugins/com.msgbyte.tasks/web/plugins/com.msgbyte.tasks/src/TasksPanel/index.tsx b/server/plugins/com.msgbyte.tasks/web/plugins/com.msgbyte.tasks/src/TasksPanel/index.tsx index 026d0095..1b73f156 100644 --- a/server/plugins/com.msgbyte.tasks/web/plugins/com.msgbyte.tasks/src/TasksPanel/index.tsx +++ b/server/plugins/com.msgbyte.tasks/web/plugins/com.msgbyte.tasks/src/TasksPanel/index.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { useAsyncFn } from '@capital/common'; -import { PillTabs, PillTabPane } from '@capital/component'; +import { PillTabs } from '@capital/component'; import type { TaskItemType } from './type'; import { TaskItem } from './TaskItem'; import { NewTask } from './NewTask'; @@ -25,27 +25,36 @@ const TasksPanel: React.FC = React.memo(() => { - - -
- {tasks - .filter((t) => !t.done) - .map((task) => ( - - ))} -
-
- - -
- {tasks - .filter((t) => t.done) - .map((task) => ( - - ))} -
-
-
+ + {tasks + .filter((t) => !t.done) + .map((task) => ( + + ))} + + ), + }, + { + key: '2', + label: Translate.done, + children: ( +
+ {tasks + .filter((t) => t.done) + .map((task) => ( + + ))} +
+ ), + }, + ]} + /> ); });