Skip to content
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

Merged

Conversation

dariaterekhova-actionengine
Copy link
Collaborator

Signed-off-by: Daria Terekhova daria.terekhova@actionengine.com


const maxWidth = 1080;

const BottomWidgetContainer = styled.div`
interface BottomWidgetContainer {
Copy link
Contributor

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
}

export function FilterAnimationControllerFactory(
AnimationController: ReturnType<typeof AnimationControllerFactory>
) {
const FilterAnimationController = ({
Copy link
Contributor

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>

@@ -46,9 +53,23 @@ const BottomWidgetContainer = styled.div`
${media.portable`padding: 0;`}
`;

interface FilterAnimationControllerProps {
filter: TimeRangeFilter & {animationWindow?: string};
children?: ReactNode;
Copy link
Contributor

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

@@ -90,12 +111,24 @@ export function FilterAnimationControllerFactory(AnimationController: ReturnType
return FilterAnimationController;
}

interface LayerAnimationControllerProps {
children?: ReactNode;
Copy link
Contributor

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>
@dariaterekhova-actionengine dariaterekhova-actionengine force-pushed the dt/js_to_ts_convertion_components_root_sp branch from 00c5553 to 160737a Compare April 21, 2022 14:23
Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com>
@dariaterekhova-actionengine dariaterekhova-actionengine force-pushed the dt/js_to_ts_convertion_components_root_sp branch from 160737a to ed223e2 Compare April 21, 2022 14:24
@@ -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);
Copy link
Contributor

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;
Copy link
Contributor

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>
Copy link
Contributor

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,
Copy link
Contributor

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}
Copy link
Contributor

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?

@delete-merged-branch delete-merged-branch bot deleted the dt/js_to_ts_convertion_components_root_sp branch April 29, 2022 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants