From cc1dd0e8c9f6a93e7902edff085b4a95536d5cee Mon Sep 17 00:00:00 2001 From: Sofia Cantero Date: Tue, 17 Dec 2024 14:19:28 -0500 Subject: [PATCH] feat: replace hardcoded strings with JSON --- src/app/(app)/favorites.tsx | 3 +- src/app/(app)/index.tsx | 14 +- src/app/(app)/payment.tsx | 5 +- src/app/(app)/product-list.tsx | 13 +- src/app/(app)/purchases.tsx | 3 +- src/app/(app)/shopping-cart.tsx | 59 +++++--- src/app/details/[id].tsx | 5 +- src/components/details/add-to-cart.tsx | 10 +- src/components/favourites/favorite-card.tsx | 3 +- src/components/home/carousel.tsx | 5 +- src/components/home/payment-methods.tsx | 7 +- src/components/login-form.tsx | 19 +-- src/components/payment/buy-form.tsx | 83 +++++------ src/components/search-bar.tsx | 3 +- .../shopping-cart/shopping-card.tsx | 9 +- src/components/signup-form.tsx | 31 ++-- src/core/hoc/multiple-input.tsx | 3 +- src/translations/en.json | 132 ++++++++++++++++++ 18 files changed, 297 insertions(+), 110 deletions(-) diff --git a/src/app/(app)/favorites.tsx b/src/app/(app)/favorites.tsx index 5dcd829..0be993c 100644 --- a/src/app/(app)/favorites.tsx +++ b/src/app/(app)/favorites.tsx @@ -7,6 +7,7 @@ import { API_CONSTS } from '@/api/consts'; import { useFavorites } from '@/api/favorites/use-favorites'; import { FavoriteCard } from '@/components/favourites/favorite-card'; import { HeaderLogo } from '@/components/header-logo'; +import { favorites } from '@/translations/en.json'; import { SafeAreaView, Text, View } from '@/ui'; export default function Favorite() { @@ -32,7 +33,7 @@ export default function Favorite() { - My favourites + {favorites.labels.tittle} - Check out our new and restored furniture + {dashboard.promotions.checkOutPromotion} - Shop today and get a 10% discount! + {dashboard.promotions.shopTodayDiscount} - Payment methods + {dashboard.labels.paymentMethods} @@ -36,10 +37,13 @@ export default function Feed() { image={images.fedexBanner()} > - We upgraded our shipments many levels up + {dashboard.promotions.shipmentUpgrade} - Powered by FedEx + {dashboard.promotions.poweredByFedEx}{' '} + + {dashboard.promotions.fedEx} + diff --git a/src/app/(app)/payment.tsx b/src/app/(app)/payment.tsx index bcf21d6..f38a727 100644 --- a/src/app/(app)/payment.tsx +++ b/src/app/(app)/payment.tsx @@ -6,6 +6,7 @@ import { KeyboardAvoidingView } from 'react-native-keyboard-controller'; import { usePurchaseOrder } from '@/api/purchase/use-purchase'; import type { BuyFormSubmitHandler } from '@/components/payment/buy-form'; import { BuyForm } from '@/components/payment/buy-form'; +import { purchaseForm } from '@/translations/en.json'; import { Button, SafeAreaView, ScrollView, showErrorMessage, View } from '@/ui'; type FormButtonsProps = { @@ -16,14 +17,14 @@ const FormButtons = ({ handleSubmit }: FormButtonsProps) => { return (