From f59bc6c02dff781df8079bd1fb627ffa1c7fe5c1 Mon Sep 17 00:00:00 2001 From: "Nikita.Zheleznov" Date: Fri, 9 Sep 2022 21:56:20 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=A7=AC=20upd.=20CardAddress.=20+?= =?UTF-8?q?=20error=20message=20#65?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/moleculs/CardAddress.tsx | 121 +++++++++--------- .../components/templates/SelectReceiver.tsx | 23 ++-- modals/wallets/openSend.tsx | 3 +- 3 files changed, 75 insertions(+), 72 deletions(-) diff --git a/modals/wallets/components/moleculs/CardAddress.tsx b/modals/wallets/components/moleculs/CardAddress.tsx index 095a622a..44423243 100644 --- a/modals/wallets/components/moleculs/CardAddress.tsx +++ b/modals/wallets/components/moleculs/CardAddress.tsx @@ -1,69 +1,64 @@ -import { StyleProp, StyleSheet, View, ViewStyle } from "react-native"; -import { observer } from "mobx-react-lite"; -import { Card, Icon2 } from "components/atoms"; -import { useTheme } from "hooks"; -import { TextInput, TouchableOpacity } from "react-native-gesture-handler"; -import { COLOR, InputHandler } from "utils"; -import { useMemo } from "react"; -import { trimAddress } from "utils/string"; +import { StyleProp, StyleSheet, View, ViewStyle } from "react-native" +import { observer } from "mobx-react-lite" +import { Icon2, Input } from "components/atoms" +import { useTheme } from "hooks" +import { TouchableOpacity } from "react-native-gesture-handler" +import { COLOR, InputHandler } from "utils" +import { useMemo } from "react" +import { trimAddress } from "utils/string" type Props = { - input: InputHandler; - onPressQR(): void; - style?: StyleProp; -}; + input: InputHandler + onPressQR(): void + style?: StyleProp + isError?: boolean +} -export default observer(function CardWallet({ - onPressQR, - input, - style, -}: Props) { - const theme = useTheme(); - const value = useMemo(() => { - const text = input.value; - if (input.isFocused || text.length < 25) return text; - return trimAddress(text); - }, [input.isFocused, input.value]); +export default observer(function CardWallet({ onPressQR, input, style, isError }: Props) { + const theme = useTheme() - return ( - - - - - - - - - ); -}); + const value = useMemo(() => { + const text = input.value + if (input.isFocused || text.length < 25) return text + return trimAddress(text) + }, [input.isFocused, input.value]) + + return ( + + + + + + } + /> + ) +}) const styles = StyleSheet.create({ - container: { - backgroundColor: COLOR.Dark3, - height: 70, - justifyContent: "space-between", - flexDirection: "row", - overflow: "hidden", - }, - input: { - paddingLeft: 26, - flex: 1, - }, - touchable: { - justifyContent: "center", - alignItems: "center", - borderRadius: 40, - padding: 26, - }, - buttonContainer: { - justifyContent: "center", - }, -}); + container: { + backgroundColor: COLOR.Dark3, + borderRadius: 20, + }, + input: { height: 70 }, + error: { left: 0 }, + touchable: { + justifyContent: "center", + alignItems: "center", + borderRadius: 40, + padding: 26, + }, + buttonContainer: { justifyContent: "center" }, +}) diff --git a/modals/wallets/components/templates/SelectReceiver.tsx b/modals/wallets/components/templates/SelectReceiver.tsx index c78d8bd1..64da8e33 100644 --- a/modals/wallets/components/templates/SelectReceiver.tsx +++ b/modals/wallets/components/templates/SelectReceiver.tsx @@ -66,12 +66,19 @@ export default observer(function SelectReceiver({ return ( - - + + + + {contactsStore.contacts.length > 0 && ( @@ -115,7 +122,7 @@ const styles = StyleSheet.create({ wrapper: { marginHorizontal: HORIZONTAL_WRAPPER }, input: { marginTop: 31, - marginBottom: 26, + marginBottom: 40, }, hidden: { opacity: 0.1 }, self: { marginTop: 21 }, @@ -136,7 +143,7 @@ const styles = StyleSheet.create({ touchContact: { marginRight: 22 }, contacts: { marginBottom: 32 }, - contactList: { marginTop: 24 }, + contactList: { marginTop: 18 }, contactListContent: { paddingHorizontal: HORIZONTAL_WRAPPER, paddingBottom: 8, diff --git a/modals/wallets/openSend.tsx b/modals/wallets/openSend.tsx index e8f0632a..3064a48c 100644 --- a/modals/wallets/openSend.tsx +++ b/modals/wallets/openSend.tsx @@ -1,7 +1,7 @@ import { SupportedCoins } from "constants/Coins" import { gbs } from "modals" import { navigate } from "navigation/utils" -import { StyleProp, ViewStyle } from "react-native" +import { Keyboard, StyleProp, ViewStyle } from "react-native" import { SendController } from "./controllers" import { SendModal } from "./modals" import { store } from "stores/Store" @@ -38,6 +38,7 @@ export default function openSendModal(style: StyleProp) { } const close = () => { + Keyboard.dismiss() gbs.close() controller.clear() }