Browse Source

FIX | fix reason select layout

merge-requests/236/head
MacOS 3 years ago
parent
commit
800450ff0c
  1. 6
      .gitignore
  2. 8
      .vscode/settings.json
  3. 2
      ios/Podfile.lock
  4. 42
      src/modules/tasks/components/reason-form.component.tsx
  5. 1
      src/modules/tasks/smart-components/add-new-reason.smart-component.tsx
  6. 1
      src/shared/components/forms/form-select.component.tsx

6
.gitignore vendored

@ -60,4 +60,8 @@ buck-out/
*/*.hprof */*.hprof
/android/*.hprof /android/*.hprof
# Visual Studio Code
#
.vscode/

8
.vscode/settings.json vendored

@ -1,5 +1,5 @@
{ {
"cSpell.words": [ "editor.formatOnSave": true,
"Ініціатор" "editor.formatOnType": true,
] "editor.formatOnPaste": true
} }

2
ios/Podfile.lock

@ -562,7 +562,7 @@ SPEC CHECKSUMS:
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: c71c5917ec0ad2de41d5d06a5855f6d5eda06971 FBLazyVector: c71c5917ec0ad2de41d5d06a5855f6d5eda06971
FBReactNativeSpec: 50ac84ed135478e1b20e25b4c165cd57b2ce1988 FBReactNativeSpec: 1d8cb9b6fe4b85899f49b6e1f28f24709b90197e
Flipper: d3da1aa199aad94455ae725e9f3aa43f3ec17021 Flipper: d3da1aa199aad94455ae725e9f3aa43f3ec17021
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Flipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c Flipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c

42
src/modules/tasks/components/reason-form.component.tsx

@ -9,7 +9,7 @@ import {
} from '@/shared' } from '@/shared'
import { PartialTheme } from '@/shared/themes/interfaces' import { PartialTheme } from '@/shared/themes/interfaces'
import React, { FC, useState } from 'react' import React, { FC, useState } from 'react'
import { StyleSheet } from 'react-native' import { StyleSheet, View } from 'react-native'
import { AddNewReasonSmart } from '../smart-components' import { AddNewReasonSmart } from '../smart-components'
interface IProps { interface IProps {
@ -44,24 +44,24 @@ export const ReasonForm: FC<IProps> = ({
return ( return (
<> <>
{showLabel ? <Txt style={styles.blockTitle}>Підстава</Txt> : null} {showLabel ? <Txt style={styles.blockTitle}>Підстава</Txt> : null}
<View style={styles.select}>
<FormSelect
title={activeReason?.name || 'Оберіть зі списку'}
buttonStyle={styles.button}
onPress={openSelectReasonModal}
/>
<FormSelect {error ? <Txt style={styles.error}>{error}</Txt> : null}
title={activeReason?.name || 'Оберіть зі списку'}
buttonStyle={styles.button}
style={!error && styles.select}
onPress={openSelectReasonModal}
/>
{error ? <Txt style={styles.error}>{error}</Txt> : null} <AddNewReasonSmart
reasonName={newReasonName}
<AddNewReasonSmart onReasonNameChange={setNewReasonName}
reasonName={newReasonName} onSubmit={() => {
onReasonNameChange={setNewReasonName} submitNewReason(newReasonName)
onSubmit={() => { setNewReasonName('')
submitNewReason(newReasonName) }}
setNewReasonName('') />
}} </View>
/>
</> </>
) )
} }
@ -71,10 +71,11 @@ const createStyles = (theme: PartialTheme) =>
blockTitle: { blockTitle: {
fontSize: $size(16, 14), fontSize: $size(16, 14),
color: theme?.$secondaryText, color: theme?.$secondaryText,
marginVertical: $size(15, 13), marginTop: $size(15, 13),
marginBottom: $size(10, 8),
}, },
select: { select: {
marginBottom: $size(10, 8), marginBottom: $size(20, 18),
}, },
button: { button: {
minWidth: $size(32, 28), minWidth: $size(32, 28),
@ -83,6 +84,7 @@ const createStyles = (theme: PartialTheme) =>
error: { error: {
color: theme?.$errorText, color: theme?.$errorText,
fontSize: $size(12), fontSize: $size(12),
marginVertical: $size(5), marginTop: $size(5, 3),
marginBottom: $size(10, 8),
}, },
}) })

1
src/modules/tasks/smart-components/add-new-reason.smart-component.tsx

@ -25,7 +25,6 @@ export const AddNewReasonSmart: FC<IProps> = ({
title="Додайте нову" title="Додайте нову"
icon={{ name: 'add-file', size: $size(16, 14) }} icon={{ name: 'add-file', size: $size(16, 14) }}
buttonStyle={styles.button} buttonStyle={styles.button}
style={{ marginBottom: $size(20, 18) }}
onPress={() => addReasonModalSheetRef?.current?.open()} onPress={() => addReasonModalSheetRef?.current?.open()}
/> />

1
src/shared/components/forms/form-select.component.tsx

@ -59,6 +59,7 @@ const createStyles = (theme: PartialTheme) =>
container: { container: {
height: $size(50, 45), height: $size(50, 45),
paddingHorizontal: $size(20, 18), paddingHorizontal: $size(20, 18),
marginVertical: $size(5),
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', justifyContent: 'space-between',

Loading…
Cancel
Save