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
[Chore]: Technical: Translate root components to typescript #1790
[Chore]: Technical: Translate root components to typescript #1790
Conversation
8ab78d0
to
00c5553
Compare
src/components/bottom-widget.tsx
Outdated
|
||
const maxWidth = 1080; | ||
|
||
const BottomWidgetContainer = styled.div` | ||
interface BottomWidgetContainer { |
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.
type should have Props
in its name, so it won't be conversion when exporting both the component and the type of its prop
interface BottomWidgetContainerProps {
hasPadding?: boolean;
width: number
}
src/components/bottom-widget.tsx
Outdated
export function FilterAnimationControllerFactory( | ||
AnimationController: ReturnType<typeof AnimationControllerFactory> | ||
) { | ||
const FilterAnimationController = ({ |
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.
const FilterAnimationController: React.FC<FilterAnimationControllerProps>
src/components/bottom-widget.tsx
Outdated
@@ -46,9 +53,23 @@ const BottomWidgetContainer = styled.div` | |||
${media.portable`padding: 0;`} | |||
`; | |||
|
|||
interface FilterAnimationControllerProps { | |||
filter: TimeRangeFilter & {animationWindow?: string}; | |||
children?: ReactNode; |
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.
you don't need children
here when use the React.FC
to define component as shown below
src/components/bottom-widget.tsx
Outdated
@@ -90,12 +111,24 @@ export function FilterAnimationControllerFactory(AnimationController: ReturnType | |||
return FilterAnimationController; | |||
} | |||
|
|||
interface LayerAnimationControllerProps { | |||
children?: ReactNode; |
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.
remove chidlren
Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com>
Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com>
00c5553
to
160737a
Compare
Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com>
160737a
to
ed223e2
Compare
@@ -134,7 +134,7 @@ export const AnimationWindowControl = ({ | |||
data-for={`${item.id}-tooltip`} | |||
className="playback-control-button" | |||
onClick={() => { | |||
onClick&&onClick(item.id); | |||
onClick && onClick(item.id); |
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.
onClick?.(item.id);
@@ -24,6 +24,16 @@ import {bindActionCreators} from 'redux'; | |||
import {console as Console} from 'global/window'; | |||
import KeplerGlContext from 'components/context'; | |||
|
|||
export type FactoryElement = (...args) => React.Component; |
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.
shoud this be React.ComponentType
instead of React.Component
? so It also includes React.FC
?
@@ -429,7 +480,7 @@ function KeplerGlFactory( | |||
> | |||
<NotificationPanel {...notificationPanelFields} /> | |||
{!uiState.readOnly && !readOnly && <SidePanel {...sideFields} />} | |||
<MapsLayout className="maps">{mapContainers}</MapsLayout> | |||
<MapsLayout>{mapContainers}</MapsLayout> |
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.
why remove className
?
|
||
/** @type {{[key: string]: React.CSSProperties}} */ | ||
const MAP_STYLE = { | ||
container: { | ||
display: 'inline-block', | ||
position: 'relative', | ||
position: 'relative' as Property.Position, |
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.
why adding individual type instead of use React.CSSProperties
?
@@ -546,7 +589,7 @@ export default function MapContainerFactory(MapPopover, MapControl, Editor) { | |||
mapIndex={index} | |||
mapControls={mapControls} | |||
readOnly={this.props.readOnly} | |||
scale={mapState.scale || 1} | |||
scale={1} |
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.
can we keep the mapState.scale
here?
Signed-off-by: Daria Terekhova daria.terekhova@actionengine.com