remaining headers added with localisation

This commit is contained in:
Kashif Shehzad Baloch 2024-01-09 12:18:43 +05:00
parent 8c829be3df
commit 4fe9049c1e
10 changed files with 46 additions and 14 deletions

1
RiderApp/.gitignore vendored
View File

@ -1 +1,2 @@
/node_modules
/dist

View File

@ -147,5 +147,9 @@ export const de = {
Subtotal: 'Subtotaal',
Assigntome: 'Toewijzen aan mij',
'About Us': 'Over Ons',
'Product Page': 'Product Pagina',
'Product Page': 'Product Pagina',
Order: 'Bestelling',
OrderMarkedAs: 'Bestelling gemarkeerd als',
titleLogin: 'Inloggen',
Picked: 'Gekozen',
}

View File

@ -146,5 +146,9 @@ export const en = {
Subtotal: 'Subtotal',
Assigntome: 'Assign to me',
'About Us': 'About Us',
'Product Page': 'Product Page'
'Product Page': 'Product Page',
Order: 'Order',
OrderMarkedAs: 'Order marked as',
titleLogin: 'Login',
Picked: 'Picked'
}

View File

@ -147,5 +147,9 @@ export const fr = {
Subtotal: 'Sous-total',
Assigntome: 'Attribuer à moi',
'About Us': 'À Propos de Nous',
'Product Page': 'Page Produit',
'Product Page': 'Page Produit',
Order: 'Commande',
OrderMarkedAs: 'Commande marquée comme',
titleLogin: 'Connexion',
Picked: 'Choisi',
}

View File

@ -144,5 +144,8 @@ export const km = {
Subtotal: 'សរុបរង',
Assigntome: 'ផ្ដល់ទៅខ្លួនឯង',
'About Us': 'អំពីយើង',
'Product Page': 'ទំព័រផលិតផល',
'Product Page': 'ទំព័រផលិតផល',
Order: 'បញ្ជាទិញ',
OrderMarkedAs: 'បញ្ជាតម្រៀបជានៅជិត',
Picked: 'បានជ្រើសរើស',
}

View File

@ -141,4 +141,8 @@ export const zh = {
Assigntome: '分配给我',
'About Us': '关于我们',
'Product Page': '产品页面',
Order: '订单',
OrderMarkedAs: '标记为订单',
titleLogin: '登录',
Picked: '已选取',
}

View File

@ -1,6 +1,6 @@
import { Feather, FontAwesome } from '@expo/vector-icons'
import { useNavigation } from '@react-navigation/native'
import React, { useCallback, useEffect, useState } from 'react'
import React, { useCallback, useEffect, useState, useLayoutEffect } from 'react'
import { Keyboard, View } from 'react-native'
import {
Bubble,
@ -13,6 +13,7 @@ import { alignment } from '../../utilities/alignment'
import colors from '../../utilities/colors'
import { scale } from '../../utilities/scaling'
import useStyle from './styles'
import i18n from '../../../i18n'
const UserInfo = {
_id: 1,
@ -42,7 +43,7 @@ function Chat() {
useEffect(() => {
navigation.setOptions({
title: 'Chat'
headerTitle: i18n.t('titleChat')
})
setMessages([
{

View File

@ -4,7 +4,7 @@ import { useNavigation } from '@react-navigation/native'
import Constants from 'expo-constants'
import * as Notifications from 'expo-notifications'
import gql from 'graphql-tag'
import React, { useContext, useEffect, useState } from 'react'
import React, { useContext, useEffect, useState,useLayoutEffect } from 'react'
import {
KeyboardAvoidingView,
Platform,
@ -38,11 +38,13 @@ export default function Login() {
const { setTokenAsync } = useContext(AuthContext)
useEffect(() => {
useLayoutEffect(() => {
navigation.setOptions({
headerLeft: null
headerRight: null,
headerTitle: i18n.t('titleHelp')
})
}, [])
}, [navigation])
const [mutate, { loading }] = useMutation(RIDER_LOGIN, {
onCompleted,

View File

@ -71,13 +71,13 @@ function OrderDetail() {
useLayoutEffect(() => {
if (!selectedOrder) return;
navigation.setOptions({
title: `Order ${selectedOrder.order_id}`,
title: `${i18n.t('Order')} ${selectedOrder.order_id}`,
});
}, [selectedOrder]);
async function onCompleted({ updateOrderStatusRider, assignOrder }) {
if (updateOrderStatusRider) {
FlashMessage({
message: `Order marked as ${updateOrderStatusRider.order_status}`,
message: `${i18n.t('OrderMarkedAs')} ${updateOrderStatusRider.order_status}`,
});
if (updateOrderStatusRider.order_status === "DELIVERED") {
navigation.goBack();

View File

@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react'
import React, { useEffect, useState, useLayoutEffect } from 'react'
import { useNavigation } from '@react-navigation/native'
import {
ImageBackground,
StatusBar,
@ -15,11 +16,19 @@ const BACKGROUND_IMAGE = require('../../../assets/images/ui/BG.png')
export default function Orders() {
const styles = useStyle()
const [isNewOrderSelected, setIsNewOrderSelected] = useState(false)
const navigation = useNavigation()
useEffect(() => {
StatusBar.setBarStyle('light-content')
}, [isNewOrderSelected])
useLayoutEffect(() => {
navigation.setOptions({
headerRight: null,
headerTitle: i18n.t('Orders')
})
}, [navigation])
return (
<View style={[styles.flex, styles.bottom]}>
<ImageBackground style={styles.imageContainer} source={BACKGROUND_IMAGE}>