Browse Source

CHANGE | copy contact fields by longpress (#34)

Мобільний додаток / Деталка контакту / Копіювати

Reviewed-on: #34
Co-authored-by: Yevhen Romanenko <yevhen.romanenko.jetup@gmail.com>
Co-committed-by: Yevhen Romanenko <yevhen.romanenko.jetup@gmail.com>
pull/35/head
Yevhen Romanenko 8 months ago committed by Vitalik Yatsenko
parent
commit
8ab836c959
  1. 49
      src/shared/components/forms/touchable-fake-input.atom.tsx

49
src/shared/components/forms/touchable-fake-input.atom.tsx

@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@
import React, { FC } from 'react'
import { useTheme } from '@/shared/hooks/use-theme.hook'
import { PartialTheme } from '@/shared/themes/interfaces'
import {
@ -7,6 +6,7 @@ import { @@ -7,6 +6,7 @@ import {
Text,
TextStyle,
TouchableOpacity,
TouchableWithoutFeedback,
View,
ViewStyle,
} from 'react-native'
@ -42,28 +42,33 @@ export const TouchableFakeInput: FC<IProps> = ({ @@ -42,28 +42,33 @@ export const TouchableFakeInput: FC<IProps> = ({
<View style={[styles.container, style]}>
<Txt style={styles.label}>{label}</Txt>
<TouchableOpacity
disabled={disabled}
style={onCls(Boolean(error), 'inputWrap')}
onPress={onPress}>
{needCopy && (
<IconComponent
name={iconName}
size={$size(20, 18)}
style={styles.iconLeft}
color={theme.iconComponent.$primaryColor}
/>
)}
<Text style={[styles.value, txtStyle]}>{value}</Text>
<TouchableWithoutFeedback onLongPress={() => CopyToBuffer(value)}>
<View>
<TouchableOpacity
disabled={disabled}
style={onCls(Boolean(error), 'inputWrap')}
onLongPress={() => CopyToBuffer(value)}
onPress={onPress}>
{needCopy && (
<IconComponent
name={iconName}
size={$size(20, 18)}
style={styles.iconLeft}
color={theme.iconComponent.$primaryColor}
/>
)}
<Text style={[styles.value, txtStyle]}>{value}</Text>
<IconComponent
name={needCopy ? 'copy' : iconName}
size={$size(20, 18)}
btnStyle={styles.icon}
color={theme.iconComponent.$primaryColor}
onPress={() => CopyToBuffer(value)}
/>
</TouchableOpacity>
<IconComponent
name={needCopy ? 'copy' : iconName}
size={$size(20, 18)}
btnStyle={styles.icon}
color={theme.iconComponent.$primaryColor}
onPress={() => CopyToBuffer(value)}
/>
</TouchableOpacity>
</View>
</TouchableWithoutFeedback>
{error && <Text style={styles.error}>{error}</Text>}
</View>

Loading…
Cancel
Save