Skip to content

refactor: NotificationListItem to used styled-components#610

Merged
machour merged 3 commits intogitpoint:masterfrom
LeoCp:feat/refactor-notification-list-item
Nov 7, 2017
Merged

refactor: NotificationListItem to used styled-components#610
machour merged 3 commits intogitpoint:masterfrom
LeoCp:feat/refactor-notification-list-item

Conversation

@LeoCp
Copy link
Copy Markdown
Contributor

@LeoCp LeoCp commented Oct 30, 2017

Before After
simulator screen shot - iphone 6 - 2017-10-30 at 12 26 57 simulator screen shot - iphone 6 - 2017-10-30 at 12 32 50

Description

Migrate NotificationListItem component to styled-components (#532)

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.4%) to 39.72% when pulling 6f6ac2c on LeoCp:feat/refactor-notification-list-item into 753f60c on gitpoint:master.

Copy link
Copy Markdown
Member

@chinesedfan chinesedfan left a comment

Choose a reason for hiding this comment

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

@LeoCp Welcome to GitPoint!

});
const NotificationListItemContainer = styled.View`
border-bottom-color: ${colors.greyLight};
border-bottom-width: 1px;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@LeoCp Can you omit units unless it is a shorthand property?


const Title = styled.Text`
color: ${colors.black};
${{ ...fonts.fontPrimary }};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please try to use font-family: ${styledFonts.fontPrimary}, while styledFonts is imported from config.

type: 'octicon',
})``;

const CheckIcon = styled(IconStyled).attrs({ name: 'check' })``;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can the empty block be removed?

getIconName = type => {
switch (type) {
case 'commit':
case 'Commit':
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this a case bug that you find out?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, the type was wrong.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

optional: I think it will be good to transform type to lowercase and to the check, this way we cover ourselves from any future change.
What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agree, but should be done in another PR.

Copy link
Copy Markdown
Contributor Author

@LeoCp LeoCp Nov 3, 2017

Choose a reason for hiding this comment

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

Great!

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.3%) to 39.682% when pulling 232c4bd on LeoCp:feat/refactor-notification-list-item into 753f60c on gitpoint:master.

const TitleComponent = this.getComponentType();
const tag = this.getComponentType();
const iconName = this.getIconName(notification.subject.type);
const titleComponentProps =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @LeoCp welcome!
Can you please move this into a class method and add proper tests to it? I don't feel comfortable with all this logic under render() { ... }

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.4%) to 39.758% when pulling 95faa8c on LeoCp:feat/refactor-notification-list-item into 753f60c on gitpoint:master.

Copy link
Copy Markdown
Member

@machour machour left a comment

Choose a reason for hiding this comment

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

Tested on both Android & iOS, works as expected and fixes #614 👌

screen shot 2017-11-07 at 3 44 53 pm

Thank you so much @LeoCp

@machour
Copy link
Copy Markdown
Member

machour commented Nov 7, 2017

@alejandronanez could you verify that the latest changes are okay with you and merge this baby in? ❤️

@machour
Copy link
Copy Markdown
Member

machour commented Nov 7, 2017

Validated on gitter with Alejandro 🕺

@machour machour merged commit 1bf7e04 into gitpoint:master Nov 7, 2017
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.

6 participants