-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(FloatingPanel): support position attribute #6829
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6829 +/- ##
==========================================
- Coverage 92.70% 92.67% -0.03%
==========================================
Files 335 335
Lines 7199 7213 +14
Branches 1793 1814 +21
==========================================
+ Hits 6674 6685 +11
- Misses 490 492 +2
- Partials 35 36 +1 ☔ View full report in Codecov by Sentry. |
@@ -25,6 +26,7 @@ export type FloatingPanelProps = { | |||
children: ReactNode | |||
onHeightChange?: (height: number, animating: boolean) => void | |||
handleDraggingOfContent?: boolean | |||
position?: 'bottom' | 'top' |
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.
用 placement
吧~
<div className={`${classPrefix}-header`} ref={headerRef}> | ||
<div className={`${classPrefix}-bar`} /> | ||
</div> | ||
{position === 'bottom' && ( |
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.
申明一个 headerNode
变量,然后条件填进来,不要重复写定义代码~
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.
感谢指出问题,让我发现了编码时的“陋习”,已修改提交代码
实现#6827