Skip to content

Migrate Card & Card.Image to typescript #805

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

Merged
merged 7 commits into from
Jun 11, 2020
Merged

Migrate Card & Card.Image to typescript #805

merged 7 commits into from
Jun 11, 2020

Conversation

ethanshar
Copy link
Collaborator

@ethanshar ethanshar commented Jun 6, 2020

This fix the annoying warning we're getting lately

'ref' is not a prop. Trying to access it will result in 'undefined' being returned....

<Image
testID={testID}
source={imageSource}
style={[this.styles.image]}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You removed imageStyle, I need it in CardItem

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Where do you pass the imageStyle I couldn't find where it comes from?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It was just this style={[this.styles.image, imageStyle]}, I might have forgotten to add it to the PropTypes :S

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What not call it style ?
you mean that the user can pass from outside?

@@ -1,6 +1,6 @@
import _ from 'lodash';

export function extractPositionValues(position) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think of turning position to an enum?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think position is not a string but an array.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, it can be an array of enums, I have code for it, I can create a PR later and if you can decide if you like the idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, let's save it for later.. this PR is getting too messy

@@ -4,6 +4,7 @@
* Please use this file for declaring all the exports, so they could be picked up by typescript's complier
*/
export * from './style';
export {default as Card} from './components/card';
Copy link
Collaborator

Choose a reason for hiding this comment

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

We might need to add some (or all) of the ones below here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The idea is that the other types will be part of Card
Card.Image, Card.Section..
But now I see it's not working so well...
I will check it

Copy link
Collaborator

@M-i-k-e-l M-i-k-e-l left a comment

Choose a reason for hiding this comment

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

As discussed - I'll merge and the rest of the fix will be in a different PR.
The ImageStyle might not be needed if we go to the CardSection route.

@M-i-k-e-l M-i-k-e-l merged commit 0d660e2 into master Jun 11, 2020
@ethanshar ethanshar deleted the ts/migrate_card branch July 26, 2020 05:41
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