From aee683abf9775a48d73ddd725d28db5c78612c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arda=20Sentu=CC=88rk?= Date: Tue, 1 Aug 2023 10:51:14 +0200 Subject: [PATCH 1/2] refactor: sort the values in the input array alphabetically - sorted alphabetically to make the input features more organised and easier to find SVA-1099 --- .../screens/consul/Debates/NewDebate.js | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/screens/consul/Debates/NewDebate.js b/src/components/screens/consul/Debates/NewDebate.js index 8fbfd4bff..665cf7c32 100644 --- a/src/components/screens/consul/Debates/NewDebate.js +++ b/src/components/screens/consul/Debates/NewDebate.js @@ -162,42 +162,42 @@ NewDebate.propTypes = { const INPUTS = [ { - name: 'title', + autoCapitalize: 'none', + autoCompleteType: 'off', + keyboardType: 'default', label: texts.consul.startNew.newDebateTitleLabel, + name: 'title', placeholder: texts.consul.startNew.newDebateTitleLabel, - keyboardType: 'default', - textContentType: 'none', - autoCompleteType: 'off', - autoCapitalize: 'none', rules: { required: texts.consul.startNew.emptyError, minLength: { value: 4, message: 'ist zu kurz (minimum 4 Zeichen)' } - } + }, + textContentType: 'none' }, { - name: 'description', - multiline: true, - minHeight: 150, + autoCapitalize: 'none', + autoCompleteType: 'off', + keyboardType: 'default', label: texts.consul.startNew.newDebateDescriptionLabel, + minHeight: 150, + multiline: true, + name: 'description', placeholder: texts.consul.startNew.newDebateDescriptionLabel, - keyboardType: 'default', - textContentType: 'none', - autoCompleteType: 'off', - autoCapitalize: 'none', rules: { required: texts.consul.startNew.emptyError, minLength: { value: 10, message: 'ist zu kurz (minimum 10 Zeichen)' } - } + }, + textContentType: 'none' }, { - name: 'tagList', - multiline: true, + autoCapitalize: 'none', + autoCompleteType: 'off', + keyboardType: 'default', label: texts.consul.startNew.tags, + multiline: true, + name: 'tagList', placeholder: texts.consul.startNew.newDebateTagLabel, - keyboardType: 'default', - textContentType: 'none', - autoCompleteType: 'off', - autoCapitalize: 'none', - rules: { required: false } + rules: { required: false }, + textContentType: 'none' } ]; From d6f89788a3090ed70c1531db9d98faada1e7490b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arda=20Sentu=CC=88rk?= Date: Tue, 1 Aug 2023 10:57:49 +0200 Subject: [PATCH 2/2] fix: consul input's nesting problem - added `containerStyle` according to platform to `description` section in `INPUTS` array to solve the problem of overlapping inputs - added `maxHeight` so that the `tags` input in the `INPUTS` array does not overlap the `checkbox` - added `textAlignVertical` property to start typing from above in message input SVA-1099 --- src/components/screens/consul/Debates/NewDebate.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/screens/consul/Debates/NewDebate.js b/src/components/screens/consul/Debates/NewDebate.js index 665cf7c32..7ea06b7e5 100644 --- a/src/components/screens/consul/Debates/NewDebate.js +++ b/src/components/screens/consul/Debates/NewDebate.js @@ -2,9 +2,9 @@ import PropTypes from 'prop-types'; import React, { useState } from 'react'; import { useMutation } from 'react-apollo'; import { useForm } from 'react-hook-form'; -import { Alert, StyleSheet } from 'react-native'; +import { Alert, Platform, StyleSheet } from 'react-native'; -import { namespace, secrets, texts } from '../../../../config'; +import { device, namespace, normalize, secrets, texts } from '../../../../config'; import { ConsulClient } from '../../../../ConsulClient'; import { QUERY_TYPES } from '../../../../queries'; import { START_DEBATE, UPDATE_DEBATE } from '../../../../queries/consul'; @@ -177,10 +177,14 @@ const INPUTS = [ { autoCapitalize: 'none', autoCompleteType: 'off', + containerStyle: { + marginBottom: Platform.select({ android: normalize(130), ios: normalize(85) }) + }, keyboardType: 'default', label: texts.consul.startNew.newDebateDescriptionLabel, minHeight: 150, multiline: true, + textAlignVertical: 'top', name: 'description', placeholder: texts.consul.startNew.newDebateDescriptionLabel, rules: { @@ -194,6 +198,7 @@ const INPUTS = [ autoCompleteType: 'off', keyboardType: 'default', label: texts.consul.startNew.tags, + maxHeight: 50, multiline: true, name: 'tagList', placeholder: texts.consul.startNew.newDebateTagLabel,