X Tutup
The Wayback Machine - https://web.archive.org/web/20201218002732/https://github.com/gitpoint/git-point/pull/578
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
from

Conversation

@josenaranjo
Copy link
Contributor

@josenaranjo josenaranjo commented Oct 25, 2017

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.

#532
@coveralls
Copy link

@coveralls coveralls commented Oct 25, 2017

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;

This comment has been minimized.

@chinesedfan

chinesedfan Oct 25, 2017
Member

Shorthands properties should have units.

This comment has been minimized.

@josenaranjo

josenaranjo Oct 27, 2017
Author Contributor

Fixed

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

This comment has been minimized.

@chinesedfan

chinesedfan Oct 25, 2017
Member

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

This comment has been minimized.

@josenaranjo

josenaranjo Oct 27, 2017
Author Contributor

The closeIssue style is used in Line 70.

This comment has been minimized.

@chinesedfan

chinesedfan Oct 27, 2017
Member

Oh yes, I forget to expand those collapsed codes.

@coveralls
Copy link

@coveralls coveralls commented Oct 27, 2017

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

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}
/>

This comment has been minimized.

@machour

machour Nov 4, 2017
Member

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
  }
})``;

This comment has been minimized.

@machour

machour Nov 7, 2017
Member

#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} />

This comment has been minimized.

@machour

machour Nov 4, 2017
Member

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 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.
X Tutup