diff --git a/src/components/issue-description.component.js b/src/components/issue-description.component.js index 7ba0dc7b4..5150893a0 100644 --- a/src/components/issue-description.component.js +++ b/src/components/issue-description.component.js @@ -1,8 +1,9 @@ import React, { Component } from 'react'; -import { StyleSheet, View, ActivityIndicator } from 'react-native'; +import { StyleSheet, ActivityIndicator } from 'react-native'; import { ListItem } from 'react-native-elements'; import Parse from 'parse-diff'; import moment from 'moment/min/moment-with-locales.min'; +import styled from 'styled-components/native'; import { StateBadge, @@ -12,63 +13,70 @@ import { Button, } from 'components'; import { translate } from 'utils'; -import { colors, fonts, normalize } from 'config'; +import { colors, styledFonts, normalize } from 'config'; import { v3 } from 'api'; const styles = StyleSheet.create({ - headerContainer: { - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'center', - paddingRight: 10, - }, - borderBottom: { - borderBottomWidth: 1, - borderBottomColor: colors.greyLight, - }, - title: { - color: colors.primaryDark, - ...fonts.fontPrimarySemiBold, - }, - titleSmall: { - color: colors.primaryDark, - ...fonts.fontPrimarySemiBold, - fontSize: normalize(10), - }, - listItemContainer: { - borderBottomWidth: 0, - flex: 1, - }, - diffBlocksContainer: { - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'flex-end', - paddingRight: 10, - paddingBottom: 10, - }, badge: { alignItems: 'flex-end', justifyContent: 'center', }, - labelButtonGroup: { - flexWrap: 'wrap', - flexDirection: 'row', - marginLeft: 54, - paddingBottom: 15, - }, - assigneesSection: { - marginLeft: 54, - paddingBottom: 5, - }, - mergeButtonContainer: { - flex: 1, - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', - paddingVertical: 15, - }, }); +const HeaderContainer = styled.View` + flex-direction: row; + align-items: center; + justify-content: center; + padding-right: 10; +`; + +const ContainerBorderBottom = styled.View` + border-bottom-width: 1; + border-bottom-color: ${colors.greyLight}; +`; + +const ListItemStyled = styled(ListItem)` + color: ${colors.primaryDark} + font-family: ${styledFonts.fontPrimarySemiBold} +`; + +const ListItemURL = ListItemStyled.extend` + font-size: ${normalize(10)}; +`; + +const ListItemIssueTitle = ListItemStyled.extend` + border-bottom-width: 0; + flex: 1; +`; + +const DiffBlocksContainer = styled.View` + flex-direction: row; + align-items: center; + justify-content: flex-end; + padding-right: 10; + padding-bottom: 10; +`; + +const LabelButtonGroup = styled.View` + flex-wrap: wrap; + flex-direction: row; + margin-left: 54; + padding-bottom: 15; +`; + +const AssigneesSection = styled.View` + margin-left: 54; + padding-bottom: 5; +`; + +const MergeButtonContainer = styled.View` + flex: 1; + flex-direction: row; + justify-content: center; + align-items: center; + padding-vertical: 15; +`; + export class IssueDescription extends Component { props: { issue: Object, @@ -114,11 +122,10 @@ export class IssueDescription extends Component { }); return ( - - {issue.repository_url && - + {issue.repository_url && ( + onRepositoryPress(issue.repository_url)} hideChevron - />} + /> + )} - - + )} - + !isPendingCheckMerge && ( + + ))} + - {issue.pull_request && - - {isPendingDiff && - } + {issue.pull_request && ( + + {isPendingDiff && ( + + )} {!isPendingDiff && - (lineAdditions !== 0 || lineDeletions !== 0) && - - navigation.navigate('PullDiff', { - title: translate('repository.pullDiff.title', locale), - locale, - diff, - })} - />} - } + (lineAdditions !== 0 || lineDeletions !== 0) && ( + + navigation.navigate('PullDiff', { + title: translate('repository.pullDiff.title', locale), + locale, + diff, + })} + /> + )} + + )} {issue.labels && - issue.labels.length > 0 && - - {this.renderLabelButtons(issue.labels)} - } + issue.labels.length > 0 && ( + + {this.renderLabelButtons(issue.labels)} + + )} {issue.assignees && - issue.assignees.length > 0 && - - - } + issue.assignees.length > 0 && ( + + + + )} {issue.pull_request && !isMerged && issue.state === 'open' && - userHasPushPermission && - -