Skip to content

Commit

Permalink
feat: add popup in case agreement not selected
Browse files Browse the repository at this point in the history
  • Loading branch information
jsapro committed Jan 7, 2024
1 parent 4e47906 commit f1bf63c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ export const popupInfoText = {
enterAddress: 'Пожалуйста, введите адрес',
errorShort: 'Ошибка при создании заказа: ',
errorLong: 'Ошибка при создании заказа: ',
selectAgreement:
'Для оформление заказа необходимо согласие с условиями обработки персональных данных и условиями продажи.',
};
2 changes: 2 additions & 0 deletions src/pages/checkout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ const Checkout: React.FC = () => {
return openInfoPopup(popupInfoText.enterAddress);
case !isLoggedIn && !selectedPayment:
return openInfoPopup(popupInfoText.choosePaymentMethod);
case !isAgreed:
return openInfoPopup(popupInfoText.selectAgreement);
default:
return true;
}
Expand Down

0 comments on commit f1bf63c

Please sign in to comment.