Skip to content

fix(contest-team): 深色模式下队伍管理页的确认框仍显示为浅色 - #2805

Open
luowanci-cell wants to merge 1 commit into
eesast:masterfrom
luowanci-cell:fix/contest-team-dark-confirm
Open

luowanci-cell wants to merge 1 commit into
eesast:masterfrom
luowanci-cell:fix/contest-team-dark-confirm

Conversation

@luowanci-cell

Copy link
Copy Markdown

问题

深色模式下,赛事互动 CONTEST → 队伍管理,点「解散队伍」弹出的确认框是浅色(白底)。

根因

站点深色模式靠 <ConfigProvider theme={{ algorithm: darkAlgorithm }}> 通过 context 下发;
而该页用的是 antd 静态方法 Modal.confirm / Modal.success / message.*。
antd v5 的静态方法会渲染到游离容器,只读 ConfigProvider.config({ theme }) 设置的全局主题,拿不到组件树上的 context,所以永远是亮色 token。

改动

仅 src/app/ContestSite/TeamPage/ManagePage.tsx:

  • 用 Modal.useModal() / message.useMessage() 替代静态调用,并渲染 contextHolder
  • 补充 effect 依赖,避免新增 lint 告警
  • 不改任何业务逻辑(mutation 调用与刷新顺序不变)

验证

  • yarn typecheck 通过
  • yarn lint:0 error,warning 数与改动前一致
  • 深色模式:退出队伍 / 移除成员 / 解散队伍 / 删除头像 四个确认框均为深色
  • 浅色模式外观无变化

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant