-
Notifications
You must be signed in to change notification settings - Fork 0
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
Likhith/76897/mobiledialog migration to tsx #13
Changes from all commits
47b74d5
56c7ac7
704e0b1
ed7563f
59768c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -17,8 +17,8 @@ import Div100vh from 'react-div-100vh'; | |||||||||
type TDiv100vhContainerProps = { | ||||||||||
id?: string; | ||||||||||
height_offset?: string; | ||||||||||
is_bypassed: boolean; | ||||||||||
is_disabled: boolean; | ||||||||||
is_bypassed?: boolean; | ||||||||||
is_disabled?: boolean; | ||||||||||
max_height_offset?: string; | ||||||||||
className?: string; | ||||||||||
max_autoheight_offset?: string; | ||||||||||
|
@@ -27,8 +27,8 @@ type TDiv100vhContainerProps = { | |||||||||
const Div100vhContainer = ({ | ||||||||||
children, | ||||||||||
className, | ||||||||||
is_bypassed, | ||||||||||
is_disabled, | ||||||||||
is_bypassed = false, | ||||||||||
is_disabled = false, | ||||||||||
id, | ||||||||||
height_offset, | ||||||||||
max_autoheight_offset, | ||||||||||
|
@@ -38,7 +38,7 @@ const Div100vhContainer = ({ | |||||||||
height: max_autoheight_offset ? '' : height_rule, | ||||||||||
maxHeight: max_autoheight_offset ? `calc(100rvh - ${max_autoheight_offset})` : '', | ||||||||||
}; | ||||||||||
if (is_bypassed) return children; | ||||||||||
if (is_bypassed) return children as JSX.Element; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
@likhith-deriv Why force casting here? I don’t have any errors 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The component that uses |
||||||||||
return ( | ||||||||||
<Div100vh id={id} className={className} style={is_disabled ? {} : height_style}> | ||||||||||
{children} | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import MobileDialog from './mobile-dialog.jsx'; | ||
import MobileDialog from './mobile-dialog'; | ||
import './mobile-dialog.scss'; | ||
|
||
export default MobileDialog; |
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.
@likhith-deriv Should we give them a default value of
false
at lines30
and31
? 🤔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.
To be more explicit we can. Else since they are boolean, undefined becomes false
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.
undefined
becomesfalse
in JS world, In TS world it’strue | false | undefined
😁