Skip to content

Commit

Permalink
refactor: improve status buttons display
Browse files Browse the repository at this point in the history
  • Loading branch information
lme-axelor committed Dec 19, 2024
1 parent c111e54 commit 027bc84
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,83 +36,54 @@ const RequestButtons = () => {
case PurchaseRequest.statusSelect.Draft:
return [
{
title: I18n.t('Base_Cancel'),
title: I18n.t('Purchase_Request'),
onPress: () => {},
width: '45%',
color: Colors.errorColor,
iconName: 'x-lg',
iconName: 'check-lg',
},
{
title: I18n.t('Purchase_Request'),
title: I18n.t('Base_Cancel'),
onPress: () => {},
width: '45%',
iconName: 'check-lg',
color: Colors.cautionColor,
iconName: 'reply-fill',
},
];

case PurchaseRequest.statusSelect.Requested:
return [
{
title: I18n.t('Purchase_Accept'),
onPress: () => {},
width: '92%',
width: '45%',
iconName: 'check-lg',
},
{
title: I18n.t('Purchase_Refuse'),
onPress: () => {},
width: '44%',
width: '45%',
color: Colors.errorColor,
iconName: 'x-lg',
},
{
title: I18n.t('Base_Cancel'),
onPress: () => {},
width: '44%',
color: Colors.errorColor,
iconName: 'x-lg',
width: '94%',
color: Colors.cautionColor,
iconName: 'reply-fill',
},
];

case PurchaseRequest.statusSelect.Accepted:
return [
{
title: I18n.t('Base_Cancel'),
onPress: () => {},
width: '45%',
color: Colors.errorColor,
iconName: 'x-lg',
},
{
title: I18n.t('Purchase_Purchase'),
onPress: () => {},
width: '45%',
iconName: 'cart-fill',
},
];

case PurchaseRequest.statusSelect.Purchased:
case PurchaseRequest.statusSelect.Refused:
return [
{
title: I18n.t('Base_Cancel'),
onPress: () => {},
width: '90%',
color: Colors.errorColor,
iconName: 'x-lg',
color: Colors.cautionColor,
iconName: 'reply-fill',
},
];

case PurchaseRequest.statusSelect.Canceled:
return [
{
title: I18n.t('Purchase_Draft'),
onPress: () => {},
width: '90%',
iconName: 'pencil-fill',
},
];

default:
return [];
}
Expand Down
1 change: 0 additions & 1 deletion packages/apps/purchase/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"Purchase_Request": "Request",
"Purchase_Accept": "Accept",
"Purchase_Refuse": "Refuse",
"Purchase_Draft": "Draft",
"Purchase_NoInformationAvailable": "No information available",
"Purchase_SliceAction_SearchPurchaseRequest": "search purchase request",
"Purchase_SliceAction_SearchSupplier": "search supplier",
Expand Down
1 change: 0 additions & 1 deletion packages/apps/purchase/src/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"Purchase_Request": "Demander",
"Purchase_Accept": "Accepter",
"Purchase_Refuse": "Refuser",
"Purchase_Draft": "Brouillon",
"Purchase_NoInformationAvailable": "Aucune information disponible",
"Purchase_SliceAction_SearchPurchaseRequest": "recherche sur les demandes d'achat",
"Purchase_SliceAction_SearchSupplier": "recherche sur les fournisseurs",
Expand Down

0 comments on commit 027bc84

Please sign in to comment.