update lang
This commit is contained in:
1 parent
46f00c76a4
commit
f5b60ff63e
30 files changed
+546
-652
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import { useNavigate, Link } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Navbar from '../components/Navbar'
|
||||
import Footer from '../components/Footer'
|
||||
import DynamicPageRenderer from '../components/DynamicPageRenderer'
|
||||
@@ -18,6 +19,7 @@ interface OrderHistoryItem {
|
||||
export default function TrackOrderPage() {
|
||||
const navigate = useNavigate()
|
||||
const { customer } = useAuthStore()
|
||||
const { i18n } = useTranslation()
|
||||
const [categories, setCategories] = useState<Category[]>([])
|
||||
const [localOrders, setLocalOrders] = useState<number[]>([])
|
||||
const [historyOrders, setHistoryOrders] = useState<OrderHistoryItem[]>([])
|
||||
@@ -46,7 +48,7 @@ export default function TrackOrderPage() {
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
fetch(`${API_BASE}/categories`)
|
||||
fetch(`${API_BASE}/categories?lang=${i18n.language}`)
|
||||
.then(res => res.json())
|
||||
.then(setCategories)
|
||||
.catch(console.error)
|
||||
@@ -67,7 +69,7 @@ export default function TrackOrderPage() {
|
||||
setLocalOrders(JSON.parse(storedStr))
|
||||
}
|
||||
}
|
||||
}, [customer])
|
||||
}, [customer, i18n.language])
|
||||
|
||||
const handleTrackForm = async (e: React.FormEvent) => {
|
||||
e.preventDefault()
|
||||
|
||||
Reference in new issue
Block a user