Browse Source
fix (API) : changes related to passengers lable connected to API
fix (API) : changes related to passengers lable connected to API
fix(bills) : bills page connected to APImain
sina_sajjadi
2 weeks ago
28 changed files with 823 additions and 331 deletions
-
2next-i18next.config.js
-
1next.config.js
-
116public/locales/ar/common.json
-
4public/locales/en/common.json
-
111public/locales/fr/common.json
-
85src/app/[locale]/(account-pages)/bills/BillCard.tsx
-
179src/app/[locale]/(account-pages)/bills/[slug]/page.tsx
-
144src/app/[locale]/(account-pages)/bills/page.tsx
-
14src/app/[locale]/(client-components)/(Header)/LangDropdown.tsx
-
27src/app/[locale]/(client-components)/(Header)/MainNav1.tsx
-
2src/app/[locale]/(client-components)/(Header)/SearchDropdown.tsx
-
2src/app/[locale]/(client-components)/(HeroSearchForm)/(stay-search-form)/StaySearchForm.tsx
-
2src/app/[locale]/(client-components)/(HeroSearchForm)/LocationInput.tsx
-
2src/app/[locale]/add-listing/[[...stepIndex]]/page.tsx
-
69src/app/[locale]/add-new-passenger/page.tsx
-
17src/app/[locale]/blog/SectionMagazine5.tsx
-
16src/app/[locale]/layout.tsx
-
79src/app/[locale]/tours/[slug]/page.tsx
-
9src/components/MobileFooterSticky.tsx
-
2src/components/SearchCard.tsx
-
1src/components/SectionGridFeaturePlaces.tsx
-
42src/components/UserMenu.tsx
-
22src/components/api/axios.tsx
-
14src/components/contexts/tourDetails.tsx
-
5src/components/contexts/userContext.tsx
-
4src/i18n.ts
-
15src/middleware.ts
-
2src/shared/Navigation/Navigation.tsx
@ -0,0 +1,116 @@ |
|||||
|
{ |
||||
|
"home": "Accueil", |
||||
|
"allTours": "Tous les Tours", |
||||
|
"blogs": "Blogs", |
||||
|
"faq": "FAQ", |
||||
|
"aboutUs": "À Propos de Nous", |
||||
|
"customTour": "Tour Personnalisé", |
||||
|
"searchPlaceholder": "Où aller ?", |
||||
|
"searchDescription": "Partout • N'importe quelle semaine • Ajouter des invités", |
||||
|
"beginAdventure": "Commencez votre aventure spirituelle", |
||||
|
"planPilgrimage": "Planifiez votre pèlerinage facilement. Trouvez les meilleures accommodations, transports et expériences guidées vers les sanctuaires chiites à travers le monde", |
||||
|
"startJourney": "Commencez votre voyage", |
||||
|
"listOfTours": "Liste des Tours", |
||||
|
"exploreTours": "Explorez les tours et accommodations adaptées pour un voyage spirituel et mémorable", |
||||
|
"tourPeriod": "Période du Tour", |
||||
|
"tourPeriodDescription": "Début - Fin", |
||||
|
"guests": "Invités", |
||||
|
"addGuests": "Ajouter des invités", |
||||
|
"available": "Disponible", |
||||
|
"soldOut": "Épuisé", |
||||
|
"showMore": "Montrez-moi plus", |
||||
|
"happeningCities": "Villes Animées", |
||||
|
"costEffectiveAdvertising": "Publicité Rentable", |
||||
|
"costEffectiveDescription": "Avec une annonce gratuite, vous pouvez faire la publicité de votre location sans frais initiaux", |
||||
|
"reachMillions": "Atteignez des millions avec Chisfis", |
||||
|
"reachMillionsDescription": "Des millions de personnes recherchent des lieux uniques où séjourner à travers le monde", |
||||
|
"secureAndSimple": "Securisé et Simple", |
||||
|
"secureDescription": "Une annonce sur Holiday Lettings vous offre un moyen sécurisé et facile de prendre des réservations et des paiements en ligne", |
||||
|
"mobileApps": "Applications Mobiles", |
||||
|
"mobileAppsDescription": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed dapibus porttitor nisl, sit amet finibus libero.", |
||||
|
"installation": "Installation", |
||||
|
"releaseNotes": "Notes de Version", |
||||
|
"upgradeGuide": "Guide de Mise à Niveau", |
||||
|
"browserSupport": "Support des Navigateurs", |
||||
|
"editorSupport": "Support de l'Éditeur", |
||||
|
"designFeatures": "Caractéristiques de Design", |
||||
|
"prototyping": "Prototypage", |
||||
|
"designSystems": "Systèmes de Design", |
||||
|
"pricing": "Tarification", |
||||
|
"security": "Sécurité", |
||||
|
"bestPractices": "Meilleures Pratiques", |
||||
|
"support": "Support", |
||||
|
"developers": "Développeurs", |
||||
|
"learnDesign": "Apprendre le Design", |
||||
|
"releases": "Versions", |
||||
|
"discussionForums": "Forums de Discussion", |
||||
|
"codeOfConduct": "Code de Conduite", |
||||
|
"communityResources": "Ressources Communautaires", |
||||
|
"contributing": "Contribuer", |
||||
|
"concurrentMode": "Mode Concurrent", |
||||
|
"goodNews": "Bonnes Nouvelles d'Ailleurs", |
||||
|
"whatPeopleThink": "Voyons ce que les gens pensent de Chisfis", |
||||
|
"testimonial": "Cet endroit est exactement comme sur la photo publiée sur Chisfis. Excellent service, nous avons passé un très bon séjour !", |
||||
|
"clientName": "Tiana Abie", |
||||
|
"clientLocation": "Malaisie", |
||||
|
"myTrips": "Mes Voyages", |
||||
|
"account": "Compte", |
||||
|
"menu": "Menu", |
||||
|
"gettingStarted": "Premiers Pas", |
||||
|
"explore": "Explorer", |
||||
|
"resources": "Ressources", |
||||
|
"community": "Communauté", |
||||
|
"placeType": "Type de Lieu", |
||||
|
"noTours": "Aucun tour disponible", |
||||
|
"itinerary": "Itinéraire", |
||||
|
"itineraryTitle": "Itinéraire", |
||||
|
"total": "Total", |
||||
|
"reserve": "Réserver", |
||||
|
"tourFeatures": "Caractéristiques du Tour", |
||||
|
"tourFeaturesTitle": "Caractéristiques du Tour", |
||||
|
"startRating": "Évaluation de Début", |
||||
|
"listingDetails": "Détails", |
||||
|
"imageAlt": "Image du tour", |
||||
|
"loading": "Chargement...", |
||||
|
"adults": "Adultes", |
||||
|
"adultsDesc": "Âges 13 ou plus", |
||||
|
"children": "Enfants", |
||||
|
"childrenDesc": "Âges 2–12", |
||||
|
"infants": "Bébés", |
||||
|
"infantsDesc": "Âges 0–2", |
||||
|
"traveler": "Voyageur", |
||||
|
"responses": "Réponses ({{count}})", |
||||
|
"submit": "Soumettre", |
||||
|
"cancel": "Annuler", |
||||
|
"relatedPosts": "Articles Connexes", |
||||
|
"aboutUsHeading": "👋 À Propos de Nous.", |
||||
|
"aboutUsSubheading": "Nous sommes une équipe passionnée dédiée à la création d'expériences de voyage inoubliables pour les explorateurs et les rêveurs. Des escapades sereines sur des plages tropicales aux aventures à sensations fortes dans des lieux exotiques, nous concevons des voyages aussi uniques que vous. Rejoignez-nous et explorons le monde, une aventure à la fois !", |
||||
|
"statisticTitle": "🚀 Faits Rapides", |
||||
|
"statisticDescription": "Nous sommes impartiaux et indépendants, et chaque jour nous créons des programmes et du contenu distinctifs de classe mondiale.", |
||||
|
"statisticHeading1": "10 millions", |
||||
|
"statisticSubHeading1": "D'articles ont été publiés à travers le monde (au 30 septembre 2021)", |
||||
|
"statisticHeading2": "100 000", |
||||
|
"statisticSubHeading2": "Utilisateurs enregistrés (au 30 septembre 2021)", |
||||
|
"statisticHeading3": "220+", |
||||
|
"statisticSubHeading3": "Pays et régions où nous sommes présents (au 30 septembre 2021)", |
||||
|
"customTrip": "Voyage Personnalisé", |
||||
|
"guide": "Guide", |
||||
|
"guideDescription": "Tout d'abord, écrivez l'origine de votre départ, puis choisissez la première destination de votre voyage, le nombre de nuits de séjour et le moyen de transport, puis choisissez vos destinations de voyage si vous le souhaitez.", |
||||
|
"beginYourTrip": "Commencez Votre Voyage", |
||||
|
"startDate": "Date de Début", |
||||
|
"numberOfPassengers": "Nombre de Passagers", |
||||
|
"destination": "Destination", |
||||
|
"selectCity": "Sélectionner une Ville", |
||||
|
"transportation": "Transport", |
||||
|
"selectTransport": "Sélectionner le Transport", |
||||
|
"hotel": "Hôtel", |
||||
|
"selectHotel": "Sélectionner l'Hôtel", |
||||
|
"duration": "Durée", |
||||
|
"finishDate": "Date de Fin", |
||||
|
"addDestination": "Ajouter une Destination", |
||||
|
"continue": "Continuer", |
||||
|
"successMessage": "Enregistré avec succès", |
||||
|
"to": "à", |
||||
|
"login": "Se Connecter", |
||||
|
"signup": "S'inscrire" |
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
"use client"; |
||||
|
|
||||
|
import React, { FC, useEffect, useState } from "react"; |
||||
|
import { useUserContext } from "@/components/contexts/userContext"; |
||||
|
import Avatar from "@/shared/Avatar"; |
||||
|
import Link from "next/link"; |
||||
|
import ButtonPrimary from "@/shared/ButtonPrimary"; |
||||
|
import { useTranslation } from "react-i18next"; // Import useTranslation
|
||||
|
|
||||
|
export interface UserMenuProps { |
||||
|
className?: string; |
||||
|
} |
||||
|
|
||||
|
const UserMenu: FC<UserMenuProps> = ({ className = "" }) => { |
||||
|
const { user } = useUserContext(); |
||||
|
const { t } = useTranslation("common"); // Initialize useTranslation with the "common" namespace
|
||||
|
const [translation , setTranslation] = useState({logIn : "Log In" , signUp : "Sign Up"}) |
||||
|
useEffect(() => { |
||||
|
setTranslation({ logIn :t("login") , signUp : t("signup")}) |
||||
|
}, [t]); |
||||
|
|
||||
|
return ( |
||||
|
<div className={`nc-UserMenu ${className}`}> |
||||
|
{Object.keys(user).length ? ( |
||||
|
<Link className="self-center" href="/account"> |
||||
|
<Avatar imgUrl={user?.avatar} sizeClass="w-10 h-10" /> |
||||
|
</Link> |
||||
|
) : ( |
||||
|
<div className="flex items-center space-x-4"> |
||||
|
<Link className="text-md" href="/login"> |
||||
|
{translation.logIn} |
||||
|
</Link> |
||||
|
<ButtonPrimary className="self-center" href="/signup"> |
||||
|
{translation.signUp} |
||||
|
</ButtonPrimary> |
||||
|
</div> |
||||
|
)} |
||||
|
</div> |
||||
|
); |
||||
|
}; |
||||
|
|
||||
|
export default UserMenu; |
@ -1,26 +1,38 @@ |
|||||
import axios from "axios"; |
import axios from "axios"; |
||||
|
import Cookies from "js-cookie"; // Import js-cookie
|
||||
|
|
||||
|
// Create an axios instance
|
||||
const axiosInstance = axios.create({ |
const axiosInstance = axios.create({ |
||||
baseURL : "https://aqila.nwhco.ir/" |
|
||||
}) |
|
||||
|
baseURL: "https://aqila.nwhco.ir/", |
||||
|
}); |
||||
|
|
||||
|
// Request interceptor to dynamically set language_code from the locale cookie
|
||||
axiosInstance.interceptors.request.use( |
axiosInstance.interceptors.request.use( |
||||
(config) => { |
(config) => { |
||||
|
// Read the locale cookie
|
||||
|
const locale = Cookies.get("locale") || "en"; // Default to "en" if cookie is not set
|
||||
|
|
||||
|
// Set the language_code param based on the locale
|
||||
|
config.params = { |
||||
|
...config.params, // Include any existing params
|
||||
|
language_code: locale, // Set the language_code
|
||||
|
}; |
||||
|
|
||||
return config; |
return config; |
||||
}, |
}, |
||||
(error) => { |
(error) => { |
||||
console.error('Request Error:', error); |
|
||||
|
console.error("Request Error:", error); |
||||
return Promise.reject(error); |
return Promise.reject(error); |
||||
} |
} |
||||
); |
); |
||||
|
|
||||
|
// Response interceptor to handle response errors
|
||||
axiosInstance.interceptors.response.use( |
axiosInstance.interceptors.response.use( |
||||
(response) => response, |
(response) => response, |
||||
(error) => { |
(error) => { |
||||
console.error('Response Error:', error); |
|
||||
|
console.error("Response Error:", error); |
||||
return Promise.reject(error); |
return Promise.reject(error); |
||||
} |
} |
||||
); |
); |
||||
|
|
||||
|
|
||||
export default axiosInstance; |
export default axiosInstance; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue