Skip to content

Commit 9b26d49

Browse files
committed
Add application version display to NameContainer menu
- Display version number with info icon before logout option - Show only on mobile platforms (iOS/Android) - Add 'version' translation key to all 8 locale files
1 parent a7498e6 commit 9b26d49

File tree

9 files changed

+30
-9
lines changed

9 files changed

+30
-9
lines changed

src/components/menu/NameContainer.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import React, { useState } from 'react'
22
import { Linking, Platform, Pressable, Text, View } from 'react-native'
3+
import * as Application from 'expo-application'
34
import { Avatar } from '@kolking/react-native-avatar'
45
import { AppDispatch, RootState, toggleSideMenu } from '@/store'
56
import { useDispatch, useSelector } from 'react-redux'
67
import { useTranslation } from 'react-i18next'
78
import { useRouter } from 'expo-router'
8-
import { CloseIcon, LikeIcon, LogoutIcon } from '@/components/svg'
9+
import { CloseIcon, InfoIcon, LikeIcon, LogoutIcon } from '@/components/svg'
910
import { useAuth, useLogout } from '@/hooks'
1011
import PopupMenu, { PopupMenuSeparator } from '@/components/PopupMenu'
1112

@@ -93,6 +94,18 @@ const NameContainer: React.FC<NameContainerProps> = ({ name, nameColor, displayN
9394
</>
9495
)}
9596

97+
{Platform.OS !== 'web' && (
98+
<>
99+
<View className='flex-row items-center py-4'>
100+
<InfoIcon width={24} height={24} stroke={theme.textColor} />
101+
<Text className="text-base font-medium px-[10px] font-['Inter']" style={{ color: theme.textColor }}>
102+
{t('version')} {Application.nativeApplicationVersion}
103+
</Text>
104+
</View>
105+
<PopupMenuSeparator />
106+
</>
107+
)}
108+
96109
<Pressable
97110
className='flex-row items-center py-4'
98111
onPress={async () => {

src/i18n/locales/ar/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@
7272
"updateRequiredDescription": "مطلوب إصدار جديد لمواصلة استخدام أنصاري. يرجى التحديث الآن.",
7373
"updateAvailableDescription": "يتوفر إصدار جديد من أنصاري مع ميزات وتحسينات جديدة.",
7474
"updateNow": "التحديث الآن",
75-
"updateLater": "لاحقاً"
75+
"updateLater": "لاحقاً",
76+
"version": "الإصدار"
7677
}

src/i18n/locales/bs/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@
7272
"updateRequiredDescription": "Nova verzija je potrebna za nastavak korištenja Ansari Chata. Molimo vas da ažurirate odmah.",
7373
"updateAvailableDescription": "Nova verzija Ansari Chata je dostupna s novim funkcijama i poboljšanjima.",
7474
"updateNow": "Ažuriraj sada",
75-
"updateLater": "Kasnije"
75+
"updateLater": "Kasnije",
76+
"version": "Verzija"
7677
}

src/i18n/locales/en/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@
7272
"updateRequiredDescription": "A new version is required to continue using Ansari Chat. Please update now.",
7373
"updateAvailableDescription": "A new version of Ansari Chat is available with new features and improvements.",
7474
"updateNow": "Update Now",
75-
"updateLater": "Later"
75+
"updateLater": "Later",
76+
"version": "Version"
7677
}

src/i18n/locales/fr/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@
7272
"updateRequiredDescription": "Une nouvelle version est nécessaire pour continuer à utiliser Ansari Chat. Veuillez mettre à jour maintenant.",
7373
"updateAvailableDescription": "Une nouvelle version d'Ansari Chat est disponible avec de nouvelles fonctionnalités et améliorations.",
7474
"updateNow": "Mettre à jour maintenant",
75-
"updateLater": "Plus tard"
75+
"updateLater": "Plus tard",
76+
"version": "Version"
7677
}

src/i18n/locales/id/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,6 @@
7474
"updateRequiredDescription": "Versi baru diperlukan untuk melanjutkan menggunakan Ansari Chat. Silakan perbarui sekarang.",
7575
"updateAvailableDescription": "Versi baru Ansari Chat tersedia dengan fitur dan peningkatan baru.",
7676
"updateNow": "Perbarui Sekarang",
77-
"updateLater": "Nanti"
77+
"updateLater": "Nanti",
78+
"version": "Versi"
7879
}

src/i18n/locales/tml/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@
7272
"updateRequiredDescription": "அன்சாரி சாட்டைத் தொடர்ந்து பயன்படுத்த புதிய பதிப்பு தேவை. இப்போது புதுப்பிக்கவும்.",
7373
"updateAvailableDescription": "புதிய அம்சங்கள் மற்றும் மேம்பாடுகளுடன் அன்சாரி சாட்டின் புதிய பதிப்பு கிடைக்கிறது.",
7474
"updateNow": "இப்போது புதுப்பி",
75-
"updateLater": "பிறகு"
75+
"updateLater": "பிறகு",
76+
"version": "பதிப்பு"
7677
}

src/i18n/locales/tur/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@
7272
"updateRequiredDescription": "Ansari Chat'i kullanmaya devam etmek için yeni bir sürüm gerekiyor. Lütfen şimdi güncelleyin.",
7373
"updateAvailableDescription": "Yeni özellikler ve iyileştirmelerle Ansari Chat'in yeni bir sürümü mevcut.",
7474
"updateNow": "Şimdi Güncelle",
75-
"updateLater": "Daha Sonra"
75+
"updateLater": "Daha Sonra",
76+
"version": "Sürüm"
7677
}

src/i18n/locales/ur/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@
7272
"updateRequiredDescription": "انصاری چیٹ کو استعمال کرنے کے لیے نیا ورژن درکار ہے۔ براہ کرم ابھی اپڈیٹ کریں۔",
7373
"updateAvailableDescription": "نئی خصوصیات اور بہتریوں کے ساتھ انصاری چیٹ کا نیا ورژن دستیاب ہے۔",
7474
"updateNow": "ابھی اپڈیٹ کریں",
75-
"updateLater": "بعد میں"
75+
"updateLater": "بعد میں",
76+
"version": "ورژن"
7677
}

0 commit comments

Comments
 (0)