-
-
Notifications
You must be signed in to change notification settings - Fork 20
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: backgroundColor apply refactoring #121
Conversation
@sergeymild is attempting to deploy a commit to the Jovanni's projects Team on Vercel. A member of the Team first needs to authorize it. |
Code Climate has analyzed commit 25f9c6c and detected 0 issues on this pull request. View more on Code Climate. |
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.
Looks good. See minor comments
@@ -250,7 +251,7 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> { | |||
scrollableHandle={this.state.scrollableHandle} | |||
sizes={sizes} | |||
blurTint={blurTint} | |||
background={backgroundColor} | |||
background={(backgroundColor ? processColor(backgroundColor) : undefined) as any} |
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.
Maybe change the background
type in TrueSheetNativeViewProps
instead of casting to any
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.
If you change this property in TrueSheetNativeViewProps so that its type is number instead of ColorType, the user won't be able to use it as a regular color property. I don't see any problem with casting to any because it's part of the internal implementation and won't be exposed externally.
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.
the background
prop is actually just a prop for the native component. The user facing prop is backgroundColor
.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -250,7 +251,7 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> { | |||
scrollableHandle={this.state.scrollableHandle} | |||
sizes={sizes} | |||
blurTint={blurTint} | |||
background={backgroundColor} | |||
background={(backgroundColor ? processColor(backgroundColor) : undefined) as any} |
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.
background={(backgroundColor ? processColor(backgroundColor) : undefined) as any} | |
background={(backgroundColor ? processColor(backgroundColor) : undefined)} |
@@ -9,6 +9,7 @@ import { | |||
type NativeSyntheticEvent, | |||
type LayoutChangeEvent, | |||
type ColorValue, | |||
processColor, |
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.
processColor, | |
type ProcessedColorValue, |
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.
Replace the type with this:
interface TrueSheetNativeViewProps
extends Omit<TrueSheetProps, 'onPresent' | 'onSizeChange' | 'backgroundColor'> {
contentHeight?: number
footerHeight?: number
background?: ProcessedColorValue | null
scrollableHandle: number | null
onPresent: (event: SizeChangeEvent) => void
onSizeChange: (event: SizeChangeEvent) => void
onContainerSizeChange: (event: ContainerSizeChangeEvent) => void
}
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.
going to merge this and update suggested code in main.
thanks @sergeymild
🚀 This pull request is included in v1.1.0. See Release 1.1.0 for release notes. |
No description provided.