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

refactor(styles): Migrate IssueListItem to Styled Components #578

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

josenaranjo
Copy link
Contributor

I left some StyleSheet styles without migrating because those styles are so specific about a particular behavior that 1. I'm not sure they are going to display the component as expected and 2. It has more meaning as it is. Let me know what you think.

#532

Migrate Stylesheet styles to styled components.

gitpoint#532
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 30.983% when pulling 2cfad22 on josenaranjo:refactor-issue-list-item into a43d3bc on gitpoint:master.

align-items: flex-start;
justify-content: center;
padding-right: 10;
padding: 5;
Copy link
Member

Choose a reason for hiding this comment

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

Shorthands properties should have units.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

paddingVertical: 5,
borderBottomWidth: 1,
borderBottomColor: colors.greyLight,
},
closedIssue: {
Copy link
Member

Choose a reason for hiding this comment

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

I think it can be removed, because nowhere uses it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The closeIssue style is used in Line 70.

Copy link
Member

Choose a reason for hiding this comment

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

Oh yes, I forget to expand those collapsed codes.

@coveralls
Copy link

Coverage Status

Coverage increased (+3.8%) to 34.636% when pulling 0eddee9 on josenaranjo:refactor-issue-list-item into a43d3bc on gitpoint:master.

Copy link
Member

@alejandronanez alejandronanez left a comment

Choose a reason for hiding this comment

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

Can you please add a screenshot of the work you've done?
LGTM and Thanks!

@machour machour self-assigned this Nov 4, 2017
@@ -99,10 +103,10 @@ export const IssueListItem = ({ type, issue, navigation, locale }: Props) => (
titleStyle={styles.title}
subtitleStyle={styles.subtitle}
/>
Copy link
Member

Choose a reason for hiding this comment

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

Once #619 is merged, this <ListItem> can be converted as a styled component using this:

const Issue = styled(ListItem).attrs({
  containerStyle: {
     // old style attributes
  },
  titleStyle: {
     // old style attributes
  },
  subtitleStyle: {
     // old style attributes
  }
})``;

Copy link
Member

@machour machour Nov 7, 2017

Choose a reason for hiding this comment

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

#619 is merged, you should now be able to convert the react-native-elements components.

@@ -99,10 +103,10 @@ export const IssueListItem = ({ type, issue, navigation, locale }: Props) => (
titleStyle={styles.title}
subtitleStyle={styles.subtitle}
/>
<View style={styles.commentsContainer}>
<CommentsContainer>
<Icon name="comment" type="octicon" size={18} color={colors.grey} />
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if we should define a new styled component here (same way as ListItem), and have all this static props in the styled component.
The JSX code would then simply be something like: <CommentIcon />

What do you think of this? 🤔

@machour machour changed the title refactor(styles): StyleSheet to Styled Components refactor(styles): Migrate IssueListItem to Styled Components Nov 4, 2017
@machour
Copy link
Member

machour commented Jan 16, 2018

Hi @josenaranjo, friendly ping, are you still up for this one? 🙏

@machour machour removed their assignment Jan 16, 2018
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.

5 participants