-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [WIP] Moment card * feature(card): adds moment card component * fix(rspec tests): updates rspec test corresponding to created, edited locales changes * fix(moment card): adds unit test for moment card and requested changes * fix(moment card): fixes css issues of the card layout * chore(moment card): wraps card in grid layout * fix(Gemfile): updates rails-html-sanitizer version to fix XSS vulnerability * chore(Gemfile): updates parser version to 2.5.0.5
- Loading branch information
1 parent
7503e3d
commit 5e269a7
Showing
33 changed files
with
638 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// @flow | ||
import React from 'react'; | ||
import MomentCardName from './MomentCardName'; | ||
import MomentCardDate from './MomentCardDate'; | ||
import MomentCardDraft from './MomentCardDraft'; | ||
import MomentCardSettings from './MomentCardSettings'; | ||
import MomentCardCategories from './MomentCardCategories'; | ||
import MomentCardMoods from './MomentCardMoods'; | ||
import css from './MomentCard.scss'; | ||
|
||
type MomentCardProp = { | ||
action: { | ||
edit?: any, | ||
delete?: any, | ||
viewer?: any | ||
}, | ||
item: { | ||
name: string, | ||
category?: Array<string>, | ||
mood?: Array<string>, | ||
}, | ||
date: string, | ||
cardType: string, | ||
draftText?: string | ||
}; | ||
|
||
export default class MomentCard extends React.Component <MomentCardProp> { | ||
render() { | ||
const { action, cardType, date, item, draftText } = this.props; | ||
|
||
return ( | ||
<div className={css.moment}> | ||
<div className={css.header}> | ||
{ cardType === 'Draft' && <MomentCardDraft draftText={draftText} /> } | ||
<MomentCardName name={item.name} /> | ||
<MomentCardSettings action={action} cardType={cardType} /> | ||
</div> | ||
<MomentCardDate date={date} /> | ||
<div className={css.tags}> | ||
<MomentCardCategories category={item.category} /> | ||
<MomentCardMoods mood={item.mood} /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
Oops, something went wrong.