-
-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: improve week header cell styling #905
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此 PR 修改了 DatePanel 组件中用于展示周标题的渲染方式。原先通过 元素包裹 {locale.week} 来达到隐藏视觉但占位的效果,现在直接在 内渲染 {locale.week},并设置了 pointerEvents 为 'none' 与 opacity 为 0,以保持相同的视觉效果。没有对外部或导出的实体声明进行变更。 Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
src/PickerPanel/DatePanel/index.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #905 +/- ##
=======================================
Coverage 95.47% 95.47%
=======================================
Files 64 64
Lines 2740 2740
Branches 770 770
=======================================
Hits 2616 2616
Misses 121 121
Partials 3 3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/PickerPanel/DatePanel/index.tsx (1)
102-103
: 优化周标题单元格的渲染实现!代码变更简化了 DOM 结构,通过直接在
th
元素上设置样式来实现视觉隐藏效果,这是一个很好的改进。不过建议考虑将内联样式抽离到一个常量或样式对象中,以提高代码的可维护性:
+const weekHeaderStyles = { pointerEvents: 'none', opacity: 0 } as const; + if (prefixColumn) { headerCells.push( - <th key="empty" style={{ pointerEvents: 'none', opacity: 0 }}> + <th key="empty" style={weekHeaderStyles}> {locale.week} </th>, ); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
tests/__snapshots__/panel.spec.tsx.snap
is excluded by!**/*.snap
📒 Files selected for processing (1)
src/PickerPanel/DatePanel/index.tsx
(1 hunks)
那就先不改呗,而且还动了DOM |
这个改动其实还好,不会影响到正常使用 |
先关了,保持现状先 |
Summary by CodeRabbit