-
-
Notifications
You must be signed in to change notification settings - Fork 37
feat: add support for headers and change the layout approach #199
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
base: main
Are you sure you want to change the base?
Conversation
@Cyberax is attempting to deploy a commit to the Jovanni's projects Team on Vercel. A member of the Team first needs to authorize it. |
}); | ||
exports.TrueSheetHeader = void 0; | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
const TrueSheetHeader = props => { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
"use strict"; | ||
|
||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
export const TrueSheetHeader = props => { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
Component?: TrueSheetProps['HeaderComponent'] | ||
} | ||
|
||
export const TrueSheetHeader = (props: TrueSheetHeaderProps) => { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
|
||
val data = Arguments.createMap() | ||
data.putDouble("width", Utils.toDIP(rect.width().toFloat()).toDouble()) | ||
data.putDouble("height", Utils.toDIP(rect.height().toFloat()).toDouble()) |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
val rect = sheetDialog.getVisibleContentDimensions() | ||
|
||
val data = Arguments.createMap() | ||
data.putDouble("width", Utils.toDIP(rect.width().toFloat()).toDouble()) |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
Code Climate has analyzed commit 7bbb440 and detected 13 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
This commit adds support for header components. However, the major improvement is the changed approach to doing the layout for the bottom sheet. Prior to this commit, there was an inherent conflict between the native iOS/Android layout systems and the React layout manager. In particular, this resulted in issues with the on-screen keyboard overlapping controls. To solve this, this commit introduces an intermediate view that sits between the native OS dialog and the hosted React view. This intermediate view handles the keyboard avoidance using OS-specific mechanism: keyboardLayoutGuide on iOS and rootView.padding on Android. We then communicate the visible area back to React that then lays out components as usual. So there is no need to have special handling for scrolling views or to do manual footer positioning.
This commit adds support for header components. However, the major improvement is the changed approach to doing the layout for the bottom sheet.
Prior to this commit, there was an inherent conflict between the native iOS/Android layout systems and the React layout manager. In particular, this resulted in issues with the on-screen keyboard overlapping controls.
To solve this, this commit introduces an intermediate view that sits between the native OS dialog and the hosted React view. This intermediate view handles the keyboard avoidance using OS-specific mechanism: keyboardLayoutGuide on iOS and rootView.padding on Android.
We then communicate the visible area back to React that then lays out components as usual. So there is no need to have special handling for scrolling views or to do manual footer positioning.