Skip to content

Item: Update to v1 API #431

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 19 commits into from
Aug 29, 2016
Merged

Item: Update to v1 API #431

merged 19 commits into from
Aug 29, 2016

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Aug 24, 2016

Finished

Update Item component to v1 API.

@layershifter
Copy link
Member Author

layershifter commented Aug 24, 2016

@levithomason Item.Items was removed, what I must do with this?

@levithomason
Copy link
Member

levithomason commented Aug 24, 2016

The deprecatedComponents export old names, but replace them with another component:

-export const Items = deprecateComponent('Items', 'Use "Item.Items" instead.', Item.Items)
+export const Items = deprecateComponent('Items', 'Use "Item.Group" instead.', Item.Group)

The last argument is the replacement component. In this case, it will now export Items but when you import { Items } from 'stardust' you will see the warning message and the returned component will be Item.Group.

@codecov-io
Copy link

codecov-io commented Aug 27, 2016

Current coverage is 96.69% (diff: 100%)

Merging #431 into master will increase coverage by 0.52%

@@             master       #431   diff @@
==========================================
  Files            84         90     +6   
  Lines          1254       1300    +46   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           1206       1257    +51   
+ Misses           48         43     -5   
  Partials          0          0          

Powered by Codecov. Last update 598f764...0d34c02

import Image from '../../elements/Image/Image'

function ItemImage(props) {
return <Image {...props} />
Copy link
Member Author

Choose a reason for hiding this comment

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

@levithomason I have problem there.

  1. I think I need use createImage factory, but will it pass props?
  2. ItemImage doesn't have ui class by default. How we can deal with this?

_357

Alexander Fedyashov added 3 commits August 27, 2016 18:57
@layershifter
Copy link
Member Author

layershifter commented Aug 28, 2016

@levithomason, finished ✌️

Can be merged after issue will be solved and code review 😺

@levithomason
Copy link
Member

Taking a look...

@levithomason
Copy link
Member

I've added a ui prop (and tests) to Image to allow turning off the ui className:

<Image {...rest} as={ElementType} ui={false} />

This seems to solve the issue with the ui className simply. We may add this feature for all components, though for now it will just be on the Image.

@levithomason
Copy link
Member

There are a couple warnings to solve, looks like we're spreading props we shouldn't be:

Warning: Failed prop type: Invalid prop `items[0].childKey` of type `number` supplied to `ItemGroup`, expected `string`.
Warning: Unknown prop `childKey` on <div> tag. Remove this prop from the element.
in ItemGroup

Alexander Fedyashov added 2 commits August 29, 2016 21:36
… into fix/item

Conflicts:
	src/views/Item/ItemGroup.js
	src/views/Item/ItemImage.js
@layershifter
Copy link
Member Author

Seems, it fixed 👍

} = props

const classes = cx(
'ui',
ui && 'ui',
Copy link
Member Author

Choose a reason for hiding this comment

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

Stupid question. Why you used there '&&' instead of useKeyOnly? 🐰

Copy link
Member

Choose a reason for hiding this comment

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

Stupid answer, whoops!

@levithomason
Copy link
Member

Will merge/release once tests pass

@levithomason levithomason merged commit 056ebde into master Aug 29, 2016
@levithomason levithomason deleted the fix/item branch August 29, 2016 20:11
@levithomason
Copy link
Member

Released in v0.38.0, we're getting closer to v1 :D 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants