Skip to content

Commit

Permalink
Add price page translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-LHOSTE committed Oct 30, 2024
1 parent d9a26a0 commit 74b69ab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@
"FEATURED": "Featured",
"EXCLUSIVE": "Exclusive",
"NEW": "New",
"RESTAURANT_MORE_INFOS": "More information"
"RESTAURANT_MORE_INFOS": "More information",
"PRICE_EXCLUDING_TAX": "Price excluding tax",
"PRICE_TOTAL": "Total price"
}
}
4 changes: 3 additions & 1 deletion src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@
"CART_ZERO_WASTE_POPUP_BUTTON_TEXT": "Jʼai compris",
"TERMS_OF_SERVICE": "Conditions générales",
"PRIVACY": "Confidentialité",
"RESTAURANT_MORE_INFOS": "En savoir plus"
"RESTAURANT_MORE_INFOS": "En savoir plus",
"PRICE_EXCLUDING_TAX": "Prix hors taxes",
"PRICE_TOTAL": "Prix total"
}
}
7 changes: 4 additions & 3 deletions src/navigation/store/NewDeliveryPrice.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Formik } from 'formik';
import { t } from 'i18next';
import { Text, View } from 'native-base';
import { withTranslation } from 'react-i18next';
import { StyleSheet } from 'react-native';
Expand All @@ -11,6 +10,8 @@ import ModalFormWrapper from './ModalFormWrapper';
function NewDeliveryPrice(props) {
const dispatch = useDispatch();
const delivery = props.route.params?.delivery;
const { t } = props;

if (!delivery) return;
dispatch(getPrice(delivery));

Expand All @@ -31,11 +32,11 @@ function NewDeliveryPrice(props) {
{({ handleSubmit }) => (
<ModalFormWrapper handleSubmit={handleSubmit} t={t} isSubmit>
<View style={styles.formGroup}>
<Text style={styles.label}>Price excluding tax</Text>
<Text style={styles.label}>{t('PRICE_EXCLUDING_TAX')}</Text>
<FormInput value={props.priceExcludingTax} editable={false} />
</View>
<View style={styles.formGroup}>
<Text style={styles.label}>Total</Text>
<Text style={styles.label}>{t('PRICE_TOTAL')}</Text>
<FormInput value={props.price} editable={false} />
</View>
</ModalFormWrapper>
Expand Down
2 changes: 0 additions & 2 deletions src/redux/Store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const GET_PRICE_SUCCESS = '@store/GET_PRICE_SUCCESS';

export const getPriceSuccess = createAction(GET_PRICE_SUCCESS);
export function getPrice(delivery) {
console.log('🚀 ~ delivery:', delivery);
return (dispatch, getState) => {
const { app } = getState();
const { httpClient } = app;
Expand All @@ -31,7 +30,6 @@ export function getPrice(delivery) {
return httpClient
.post(`/api/retail_prices/calculate`, delivery)
.then(res => {
console.log('🚀 ~ res:', res);
dispatch(getPriceSuccess(res));
dispatch(setLoading(false));
})
Expand Down

0 comments on commit 74b69ab

Please sign in to comment.