From 8565142055c64236912116b009df8e1ae6e30931 Mon Sep 17 00:00:00 2001 From: Gregory <117281520+gca-axelor@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:56:16 +0100 Subject: [PATCH] feat: clean code --- .../RequestCreationButton/RequestCreationButton.tsx | 11 +---------- .../RequestCreationQuantityCard.tsx | 12 ++---------- packages/apps/purchase/src/i18n/en.json | 4 +++- packages/apps/purchase/src/i18n/fr.json | 2 ++ .../purchase/src/screens/RequestCreationScreen.tsx | 3 --- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/packages/apps/purchase/src/components/templates/RequestCreationButton/RequestCreationButton.tsx b/packages/apps/purchase/src/components/templates/RequestCreationButton/RequestCreationButton.tsx index 9c843054d..0daeff796 100644 --- a/packages/apps/purchase/src/components/templates/RequestCreationButton/RequestCreationButton.tsx +++ b/packages/apps/purchase/src/components/templates/RequestCreationButton/RequestCreationButton.tsx @@ -18,14 +18,8 @@ import React from 'react'; import {StyleSheet, View} from 'react-native'; -import { - useDispatch, - useNavigation, - useSelector, - useTranslator, -} from '@axelor/aos-mobile-core'; +import {useNavigation, useTranslator} from '@axelor/aos-mobile-core'; import {Button, useThemeColor} from '@axelor/aos-mobile-ui'; -//import {createInternalMove} from '../../../../features/internalMoveSlice'; import {RequestCreation} from '../../../types'; interface RequestCreationButtonProps { @@ -48,9 +42,6 @@ const RequestCreationButton = ({ const Colors = useThemeColor(); const I18n = useTranslator(); const navigation = useNavigation(); - const dispatch = useDispatch(); - - const {user} = useSelector((state: any) => state.user); const handleFinishPress = () => { if (step === RequestCreation.step.validateLine) { diff --git a/packages/apps/purchase/src/components/templates/RequestCreationQuantityCard/RequestCreationQuantityCard.tsx b/packages/apps/purchase/src/components/templates/RequestCreationQuantityCard/RequestCreationQuantityCard.tsx index 20c3ad6f7..74557d4cb 100644 --- a/packages/apps/purchase/src/components/templates/RequestCreationQuantityCard/RequestCreationQuantityCard.tsx +++ b/packages/apps/purchase/src/components/templates/RequestCreationQuantityCard/RequestCreationQuantityCard.tsx @@ -18,12 +18,7 @@ import React from 'react'; import {useTranslator} from '@axelor/aos-mobile-core'; -import { - checkNullString, - QuantityCard, - Text, - useDigitFormat, -} from '@axelor/aos-mobile-ui'; +import {checkNullString, QuantityCard, Text} from '@axelor/aos-mobile-ui'; interface RequestCreationQuantityCardProps { movedQty: number; @@ -41,15 +36,12 @@ const RequestCreationQuantityCard = ({ cancelMove, productName, trackingNumber, - availableQty, - productUnit, }: RequestCreationQuantityCardProps) => { const I18n = useTranslator(); - const formatNumber = useDigitFormat(); return ( { [lines, newLine], ); - console.log(unit); - return ( { const styles = StyleSheet.create({ container: { alignItems: 'center', - //height: '100%', }, rule: { marginVertical: 15,