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

Enable modal types #1 of 2 #1189

Merged
merged 1 commit into from
Jul 14, 2020
Merged

Enable modal types #1 of 2 #1189

merged 1 commit into from
Jul 14, 2020

Conversation

ibgreen
Copy link
Collaborator

@ibgreen ibgreen commented Jul 14, 2020

This gets type checking flowing through the big modal-container component all the way to upload-file.js.

A few files look like they have big changes but I am just splitting out unmemoized components from memoized ones to ensure typescript can infer the types automatically.

Signed-off-by: Ib Green <[email protected]>
<div className="description" />
<div className="selection">
<FormattedMessage id={'modal.exportMap.html.selection'} />
const ExportHtmlMapUnmemoized = ({
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code not changed, just broken out.

@@ -44,65 +44,76 @@ const NO_OP = () => {};
ExportMapModalFactory.deps = [ExportHtmlMapFactory, ExportJsonMapFactory];

function ExportMapModalFactory(ExportHtmlMap, ExportJsonMap) {
const ExportMapModal = React.memo(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code not changed, just broken out.

@@ -67,8 +67,26 @@ const StyledImagePreview = styled.div.attrs({
}
`;

const ImagePreview = ({exportImage = {}, width = 400, showDimension}) => {
const {error, imageDataUri, exporting, imageSize: {imageW, imageH} = {}} = exportImage;
/** @typedef {{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExportImage is defined in ui-state-updater.d.ts

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Will update to use that in #1190

@ibgreen ibgreen merged commit a246121 into master Jul 14, 2020
@delete-merged-branch delete-merged-branch bot deleted the ib/modal-types branch July 14, 2020 12:39
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.

2 participants