-
Notifications
You must be signed in to change notification settings - Fork 752
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
Conversation
a870db7
to
adad604
Compare
render() { | ||
return ( | ||
<div> | ||
Viewers |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 🌈
There was a problem hiding this 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!
You'll also want to rebase from master! |
Thanks a bunch for working on this @dhaval0894! Let me know once you've rebased with |
client/app/stories/index.jsx
Outdated
@@ -22,6 +22,7 @@ import DropdownFillSmall from '../bundles/shared/components/Dropdown/DropdownFil | |||
import Footer from '../bundles/shared/components/Footer/Footer'; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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?: [], |
There was a problem hiding this comment.
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>
adad604
to
8fed86a
Compare
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! |
I did a visual inspection.
@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? |
@baohouse Let's expand the height to accommodate for a lot of text. |
@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. |
@baohouse Yup totally! |
@dhaval0894
|
@baohouse Cool, I'll make these changes. |
8fed86a
to
4a4bdf2
Compare
Hey @baohouse, I have made the following changes:
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 :). |
|
5a71ad8
to
68f069f
Compare
@nshki I see "Viewers" text below the icons. I didn't see this in the original mockups. Was this an ad hoc design change? |
@baohouse Not sure why the "viewers" text is there. If it or something similar is not in the mocks, it can be removed. |
@dhaval0894
@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. |
@baohouse Yup, that minimum height sounds good to me! |
@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. |
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 :) |
68f069f
to
9fe6b0a
Compare
@dhaval0894 Mostly looks good. Only thing is that upgrading the parser gem broken |
Hey @baohouse, updated it to |
There was a problem hiding this 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!
@julianguyen I looked at your comments, they've all been addressed. Feel free to approve your requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creates card component #785