From b766c9dc3d456e1da4de92ee9153893dc3341ac4 Mon Sep 17 00:00:00 2001 From: desperado1802 Date: Thu, 26 Oct 2023 19:56:19 +0300 Subject: [PATCH] formatted size name --- .../TaskSizeScreen/components/SizeItem.tsx | 77 +++++++++++-------- 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/apps/mobile/app/screens/Authenticated/TaskSizeScreen/components/SizeItem.tsx b/apps/mobile/app/screens/Authenticated/TaskSizeScreen/components/SizeItem.tsx index b3a38157b..f5bb67c9c 100644 --- a/apps/mobile/app/screens/Authenticated/TaskSizeScreen/components/SizeItem.tsx +++ b/apps/mobile/app/screens/Authenticated/TaskSizeScreen/components/SizeItem.tsx @@ -1,72 +1,83 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ -import React, { FC } from 'react'; -import { View, Text, StyleSheet } from 'react-native'; -import { AntDesign, Ionicons } from '@expo/vector-icons'; -import { typography, useAppTheme } from '../../../../theme'; -import { ITaskSizeItem } from '../../../../services/interfaces/ITaskSize'; -import { SvgUri } from 'react-native-svg'; +import React, { FC } from "react" +import { View, Text, StyleSheet } from "react-native" +import { AntDesign, Ionicons } from "@expo/vector-icons" +import { typography, useAppTheme } from "../../../../theme" +import { ITaskSizeItem } from "../../../../services/interfaces/ITaskSize" +import { SvgUri } from "react-native-svg" +import { formatName } from "../../../../helpers/name-format" interface ISizeItem { - size: ITaskSizeItem; - onDeleteSize: () => unknown; - openForEdit: () => unknown; + size: ITaskSizeItem + onDeleteSize: () => unknown + openForEdit: () => unknown } const StatusItem: FC = ({ size, onDeleteSize, openForEdit }) => { - const { colors, dark } = useAppTheme(); + const { colors, dark } = useAppTheme() return ( - {size?.name} + {formatName(size?.name)} - openForEdit()} /> - onDeleteSize()} /> + openForEdit()} + /> + onDeleteSize()} + /> - ); -}; + ) +} const styles = StyleSheet.create({ container: { - alignItems: 'center', + alignItems: "center", borderRadius: 10, borderWidth: 1, - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", marginTop: 16, padding: 6, paddingRight: 16, - width: '100%' + width: "100%", }, rightSection: { - flexDirection: 'row', - justifyContent: 'space-between', - width: '16%' + flexDirection: "row", + justifyContent: "space-between", + width: "16%", }, statusContainer: { - alignItems: 'center', - backgroundColor: '#D4EFDF', + alignItems: "center", + backgroundColor: "#D4EFDF", borderRadius: 10, - flexDirection: 'row', - height: '100%', + flexDirection: "row", + height: "100%", paddingHorizontal: 16, paddingVertical: 12, - width: '60%' + width: "60%", }, text: { fontFamily: typography.primary.medium, fontSize: 14, - marginLeft: 13.5 - } -}); + marginLeft: 13.5, + }, +}) -export default StatusItem; +export default StatusItem