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

Adds moment card component #859

Merged
merged 8 commits into from
Mar 30, 2018
Merged

Conversation

dhavalpur0hit
Copy link
Contributor

Creates card component #785

@dhavalpur0hit dhavalpur0hit force-pushed the moment-card branch 2 times, most recently from a870db7 to adad604 Compare March 20, 2018 08:25
@julianguyen julianguyen requested a review from nshki March 20, 2018 17:53
render() {
return (
<div>
Viewers
Copy link
Member

Choose a reason for hiding this comment

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

You should use the i18n key here

Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit MomentCardViewersState as the second parameter (it's optional).

On the following lines, you can omit props: MomentCardViewersProp and state: MomentCardViewersState because they should already be defined as part of React.Component< MomentCardViewersProp>.

yarn-error.log Outdated
@@ -0,0 +1,51 @@
Arguments:
/usr/bin/node /usr/bin/yarn lint:flow
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't be committing this file!

Copy link
Contributor

Choose a reason for hiding this comment

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

I added *.log to .gitignore, but you'll want to delete this file.

font-size: 10px;
letter-spacing: 0.1em;
text-transform: uppercase;
color: rgba(109, 8, 57, 0.5);
Copy link
Member

Choose a reason for hiding this comment

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

This color should be a variable in colors.scss 🌈

Copy link
Member

@julianguyen julianguyen left a comment

Choose a reason for hiding this comment

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

Thanks so much for working on this Dhaval! Looking great so far. Let me know if you have any questions about my feedback!

@julianguyen
Copy link
Member

You'll also want to rebase from master!

@nshki
Copy link
Member

nshki commented Mar 20, 2018

Thanks a bunch for working on this @dhaval0894! Let me know once you've rebased with master and I'll take a look at everything in-depth.

@@ -22,6 +22,7 @@ import DropdownFillSmall from '../bundles/shared/components/Dropdown/DropdownFil
import Footer from '../bundles/shared/components/Footer/Footer';
Copy link
Contributor

Choose a reason for hiding this comment

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

When you rebase, this file should no longer exist. All the stories are now split up into separate files, so there should be one specifically for the MomentCards.

render() {
return (
<div>
Viewers
Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit MomentCardViewersState as the second parameter (it's optional).

On the following lines, you can omit props: MomentCardViewersProp and state: MomentCardViewersState because they should already be defined as part of React.Component< MomentCardViewersProp>.

};

export default class MomentCardSettings extends
React.Component<MomentCardSettingsProp, MomentCardSettingsState> {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit MomentCardViewersState as the second parameter (it's optional).

On the following lines, you can omit props: MomentCardViewersProp and state: MomentCardViewersState because they should already be defined as part of React.Component< MomentCardViewersProp>.

};

export default class MomentCardName extends
React.Component<MomentCardNameProp, MomentCardNameState> {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit MomentCardViewersState as the second parameter (it's optional).

On the following lines, you can omit props: MomentCardViewersProp and state: MomentCardViewersState because they should already be defined as part of React.Component< MomentCardViewersProp>.

};

export default class MomentCardMoods
extends React.Component<MomentCardMoodsProp, MomentCardMoodsState> {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit MomentCardViewersState as the second parameter (it's optional).

On the following lines, you can omit props: MomentCardViewersProp and state: MomentCardViewersState because they should already be defined as part of React.Component< MomentCardViewersProp>.

};

export default class MomentCardDraft
extends React.Component<MomentCardDraftProp, MomentCardDraftState> {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit MomentCardViewersState as the second parameter (it's optional).

On the following lines, you can omit props: MomentCardViewersProp and state: MomentCardViewersState because they should already be defined as part of React.Component< MomentCardViewersProp>.

};

export default class MomentCardDate
extends React.Component<MomentCardDateProp, MomentCardDateState> {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit MomentCardViewersState as the second parameter (it's optional).

On the following lines, you can omit props: MomentCardViewersProp and state: MomentCardViewersState because they should already be defined as part of React.Component< MomentCardViewersProp>.

};

export default class MomentCardCategories
extends React.Component<MomentCardCategoriesProp, MomentCardCategoriesState> {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit MomentCardViewersState as the second parameter (it's optional).

On the following lines, you can omit props: MomentCardViewersProp and state: MomentCardViewersState because they should already be defined as part of React.Component< MomentCardViewersProp>.

cardType: string,
};

export default class MomentCard extends React.Component<MomentCardProp, MomentCardState> {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit MomentCardViewersState as the second parameter (it's optional).

On the following lines, you can omit props: MomentCardViewersProp and state: MomentCardViewersState because they should already be defined as part of React.Component< MomentCardViewersProp>.

type MomentCardProp = {
item: {
name: string,
category?: [],
Copy link
Contributor

Choose a reason for hiding this comment

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

category?: Array<string>,
mood?: Array<string>

@dhavalpur0hit
Copy link
Contributor Author

Thanks a lot, @baohouse, @julianguyen, @nshki for taking time to review this. I have updated the PR with the requested changes, so please let me know if there are any further changes. Thanks!

@baohouse
Copy link
Contributor

baohouse commented Mar 21, 2018

screen shot 2018-03-21 at 8 54 26 am

I did a visual inspection.

  1. There's an issue if the main text runs long; it collides with the icons.
  2. The padding on the right should be increased; the icons are too close to the right edge.
  3. Can we setup props that take in onClick handlers for each of the icons?
  4. What is the viewers text for? I did not see it in the mockups.

@nshki How should it behave if the lines run longer than 3 lines? Fixed height with hiding-clipping? Expand the height of the card? Also, is there a minimum width of the card? The mockups showed one card being wider than the others, so is this expandable width-wise?

@nshki
Copy link
Member

nshki commented Mar 21, 2018

@baohouse Let's expand the height to accommodate for a lot of text.

@baohouse
Copy link
Contributor

@nshki I looked at the mockups. With regards to width, it looks like we should make this take up the width of the parent container to be used in grid systems.

@nshki
Copy link
Member

nshki commented Mar 21, 2018

@baohouse Yup totally!

@baohouse
Copy link
Contributor

@dhaval0894

  1. So the card should be fluid; it should take up 100% of the width.
  2. Moment cards should have a min-height, and be allowed to expand to fit content.
  3. When displaying it in Storybook, you can put them inside a grid layout. My PR [WIP] Splitting up Logo file; Adding Ant Design #864 will let us have access to Ant Design; you can look at my Logo story changes there to see how I'm adding a 2-column layout.

@dhavalpur0hit
Copy link
Contributor Author

@baohouse Cool, I'll make these changes.

@dhavalpur0hit
Copy link
Contributor Author

Hey @baohouse, I have made the following changes:

  1. Made the card fluid. Now it will resize depending upon the content.
  2. The main text won't collide with the icons. I have added the max-width and word-wrap property to ensure text gets wrapped if it's too long.
  3. Added onClick handlers for each of the icons.
  4. Wrapped card components in grid layout in the storybook (I had to install ant design package as the PR #864 is not merged into master)
  5. Increased the padding on the right so that the icons won't be too close to the right edge.

Also, the viewers text was already there when I took over the PR from @julianguyen, I didn't know the rationale for that so I kept it :).

@dhavalpur0hit
Copy link
Contributor Author

screenshot from 2018-03-23 17-32-58
screenshot from 2018-03-23 17-33-09
screenshot from 2018-03-23 17-33-15
@baohouse Just for your reference. Please review it and let me know if there are any further changes.

@baohouse
Copy link
Contributor

@nshki I see "Viewers" text below the icons. I didn't see this in the original mockups. Was this an ad hoc design change?

@nshki
Copy link
Member

nshki commented Mar 27, 2018

@baohouse Not sure why the "viewers" text is there. If it or something similar is not in the mocks, it can be removed.

@baohouse
Copy link
Contributor

baohouse commented Mar 28, 2018

@dhaval0894

  1. Let's remove the viewers text.
  2. Let's make the container display: block and take up the whole width of the parent container

@nshki Do we have a minimum height we want to aim for? I think if we should take the height taken up by two-line title with tags and creation time.

@nshki
Copy link
Member

nshki commented Mar 28, 2018

@baohouse Yup, that minimum height sounds good to me!

@dhavalpur0hit
Copy link
Contributor Author

@baohouse @nshki Do we really need the min-height? The card adjusts itself depending upon the content height.

@baohouse
Copy link
Contributor

@dhaval0894 If you make another story with the 3 card examples sitting on a single row (three column grid), they will all have different heights. I suppose the implementor could override the component CSS to establish a min-height on their own. Very well, not needed.

@dhavalpur0hit
Copy link
Contributor Author

Yes, good point @baohouse. Setting min-height won't help because if the content height is greater than the min-height then also cards will have different height. Like you said, allowing the implementor to override the component CSS to establish a min-height is a good way to do this :)

@dhavalpur0hit
Copy link
Contributor Author

@nshki @baohouse I have made these changes:

  1. Remove the viewer's text.
  2. Make the container display: block and take up the whole width of the parent container.
    Let me know if there are any changes.

@baohouse
Copy link
Contributor

@dhaval0894 Mostly looks good. Only thing is that upgrading the parser gem broken bundle install. Can you update it to parser (2.5.0.5)?

@dhavalpur0hit
Copy link
Contributor Author

Hey @baohouse, updated it to parser(2.5.0.5).

Copy link
Member

@nshki nshki left a comment

Choose a reason for hiding this comment

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

@baohouse covered everything in his review, so I'm also approving as well. :) Thank you both!

@baohouse
Copy link
Contributor

@julianguyen I looked at your comments, they've all been addressed. Feel free to approve your requested changes.

Copy link
Member

@julianguyen julianguyen left a comment

Choose a reason for hiding this comment

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

Woo thanks so much for working on this Dhaval! Fantastic work :D Thank you @baohouse and @nshki for reviewing this PR so well. So grateful ✨

@baohouse baohouse merged commit 5e269a7 into ifmeorg:master Mar 30, 2018
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.

4 participants