diff --git a/packages/apps/purchase/src/components/atoms/RequestHeader/RequestHeader.tsx b/packages/apps/purchase/src/components/atoms/RequestHeader/RequestHeader.tsx index 5ce838b1c..92d1f0fa3 100644 --- a/packages/apps/purchase/src/components/atoms/RequestHeader/RequestHeader.tsx +++ b/packages/apps/purchase/src/components/atoms/RequestHeader/RequestHeader.tsx @@ -18,13 +18,12 @@ import React from 'react'; import {StyleSheet, View} from 'react-native'; -import {Text, LabelText, Badge, useThemeColor} from '@axelor/aos-mobile-ui'; +import {Text, LabelText, Badge} from '@axelor/aos-mobile-ui'; import {useSelector, useTypeHelpers, useTypes} from '@axelor/aos-mobile-core'; const RequestHeader = ({}) => { - const Colors = useThemeColor(); const {PurchaseRequest} = useTypes(); - const {getItemTitle} = useTypeHelpers(); + const {getItemColor, getItemTitle} = useTypeHelpers(); const {purchaseRequest} = useSelector( state => state.purchase_purchaseRequest, @@ -39,7 +38,10 @@ const RequestHeader = ({}) => { PurchaseRequest?.statusSelect, purchaseRequest.statusSelect, )} - color={Colors.infoColor} + color={getItemColor( + PurchaseRequest?.statusSelect, + purchaseRequest.statusSelect, + )} /> { const styles = StyleSheet.create({ container: { - marginHorizontal: 15, + marginHorizontal: 24, + marginBottom: 5, }, chlidrenContainer: { flexDirection: 'row', diff --git a/packages/apps/purchase/src/components/atoms/RequestValidationButton/RequestValidationButton.tsx b/packages/apps/purchase/src/components/atoms/RequestValidationButton/RequestValidationButton.tsx new file mode 100644 index 000000000..6bbde386d --- /dev/null +++ b/packages/apps/purchase/src/components/atoms/RequestValidationButton/RequestValidationButton.tsx @@ -0,0 +1,62 @@ +/* + * Axelor Business Solutions + * + * Copyright (C) 2024 Axelor (). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import React from 'react'; +import {View, StyleSheet} from 'react-native'; + +import {Button, useThemeColor} from '@axelor/aos-mobile-ui'; +import {useSelector, useTranslator, useTypes} from '@axelor/aos-mobile-core'; + +const RequestValidationButton = ({}) => { + const Colors = useThemeColor(); + const I18n = useTranslator(); + const {PurchaseRequest} = useTypes(); + const {purchaseRequest} = useSelector( + state => state.purchase_purchaseRequest, + ); + + if (purchaseRequest.statusSelect === PurchaseRequest?.statusSelect.Draft) { + return ( + +