Skip to content

Commit

Permalink
feat(comment-input): submit comment on clicking on the icon instead t…
Browse files Browse the repository at this point in the history
…ext (#324)
  • Loading branch information
lex111 authored and Houssein Djirdeh committed Sep 22, 2017
1 parent 8b5258d commit 329c851
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 24 deletions.
27 changes: 8 additions & 19 deletions src/components/comment-input.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ const styles = StyleSheet.create({
},
wrapper: {
padding: 10,
marginLeft: 5,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
},
textInput: {
fontSize: normalize(12),
flex: 1,
marginLeft: 15,
marginRight: 5,
color: colors.black,
...fonts.fontPrimaryLight,
Expand All @@ -41,11 +39,6 @@ const styles = StyleSheet.create({
alignItems: 'flex-end',
justifyContent: 'center',
},
postButton: {
fontSize: normalize(12),
letterSpacing: 1,
...fonts.fontPrimarySemiBold,
},
postButtonDisabled: {
color: colors.grey,
},
Expand Down Expand Up @@ -109,8 +102,6 @@ export class CommentInput extends Component {
users={users}
/>
<View style={styles.wrapper}>
<Icon name="send" color={colors.grey} />

{userCanPost &&
<TextInput
underlineColorAndroid={'transparent'}
Expand Down Expand Up @@ -139,25 +130,23 @@ export class CommentInput extends Component {
{translate('issue.main.lockedIssue', language)}
</Text>}

{!this.props.issueLocked &&
{userCanPost &&
<TouchableOpacity
disabled={this.state.text === ''}
style={styles.postButtonContainer}
onPress={() => this.handleSubmit(this.state.text)}
>
<Text
style={[
styles.postButton,
<Icon
name="send"
iconStyle={
this.state.text === ''
? styles.postButtonDisabled
: styles.postButtonEnabled,
]}
>
{translate('issue.main.commentButton', language)}
</Text>
: styles.postButtonEnabled
}
/>
</TouchableOpacity>}

{this.props.issueLocked &&
{!userCanPost && this.props.issueLocked &&
<View style={styles.postButtonContainer}>
<Icon name="lock" type="octicon" color={colors.grey} />
</View>}
Expand Down
1 change: 0 additions & 1 deletion src/locale/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ export const en = {
noDescription: 'No description provided.',
lockedCommentInput: 'Locked, but you can still comment...',
commentInput: 'Add a comment...',
commentButton: 'Post',
lockedIssue: 'Issue is locked',
states: {
open: 'Open',
Expand Down
1 change: 0 additions & 1 deletion src/locale/languages/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ export const fr = {
noDescription: 'Aucune description fournie.',
lockedCommentInput: 'Verrouiller, mais vous pouvez encore commenter...',
commentInput: 'Ajouter un commentaire...',
commentButton: 'Publier',
lockedIssue: 'Ce ticket est verrouillé',
states: {
open: 'Ouvert',
Expand Down
1 change: 0 additions & 1 deletion src/locale/languages/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ export const nl = {
noDescription: 'Niet voorzien van een beschrijving.',
lockedCommentInput: 'Gesloten maar je kan nog opmerkingen maken...',
commentInput: 'Plaats opmerking...',
commentButton: 'Post',
lockedIssue: 'Issue is gesloten',
states: {
open: 'Open',
Expand Down
1 change: 0 additions & 1 deletion src/locale/languages/pt-br.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ export const ptBr = {
noDescription: 'Nenhuma descrição fornecida.',
lockedCommentInput: 'Trancada, mas você ainda pode comentar...',
commentInput: 'Adicionar um comentário...',
commentButton: 'Postar',
lockedIssue: 'A issue está trancada',
states: {
open: 'Aberta',
Expand Down
1 change: 0 additions & 1 deletion src/locale/languages/tr.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ export const tr = {
noDescription: 'Açıklama sağlanmadı.',
lockedCommentInput: 'Kilitli, ancak yine de yorum yapabilirsiniz...',
commentInput: 'Yorum ekle...',
commentButton: 'Ekle',
lockedIssue: 'Issue kilitli',
states: {
open: 'Açık',
Expand Down

0 comments on commit 329c851

Please sign in to comment.