feat(i18n): Implement reactive LanguageContext and refactor all screens

Completed 'HARDCODE YOK' goal by replacing static text in all 19 files. Centralized API calls using 'api.ts' (refactored from DKSapp). Updated HomeScreen with custom 'quick-action' images.
This commit is contained in:
2025-11-09 16:57:46 +03:00
parent 548a97c3d8
commit 7de0aa4476
24 changed files with 1963 additions and 308 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

+1840 -190
View File
File diff suppressed because it is too large Load Diff
+123 -118
View File
@@ -14,30 +14,65 @@ import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import * as ImagePicker from 'expo-image-picker'; import * as ImagePicker from 'expo-image-picker';
import { useAuth } from '../contexts/AuthContext'; import { useAuth } from '../contexts/AuthContext';
import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useSafeAreaInsets } from 'react-native-safe-area-context';
import i18n from '../config/i18n'; import { useLanguage } from '../contexts/LanguageContext';
import { api } from '../config/api';
// YENİ: 13 Quick Action görselini import et
const qa_home = require('../assets/images/quick-actions/qa_home.jpg');
const qa_governance = require('../assets/images/quick-actions/qa_governance.jpg');
const qa_exchange = require('../assets/images/quick-actions/qa_exchange.png');
const qa_b2b = require('../assets/images/quick-actions/qa_b2b.jpg');
const qa_bank = require('../assets/images/quick-actions/qa_bank.png');
const qa_games = require('../assets/images/quick-actions/qa_games.jpg');
const qa_university = require('../assets/images/quick-actions/qa_university.png');
const qa_education = require('../assets/images/quick-actions/qa_education.png');
const qa_dashboard = require('../assets/images/quick-actions/qa_dashboard.jpg');
const qa_trading = require('../assets/images/quick-actions/qa_trading.png');
const qa_kurdmedia = require('../assets/images/quick-actions/qa_kurdmedia.jpg');
const qa_rewards = require('../assets/images/quick-actions/qa_rewards.png');
const qa_forum = require('../assets/images/quick-actions/qa_forum.jpg');
const { width } = Dimensions.get('window'); const { width } = Dimensions.get('window');
// YENİ: 13 özel butonu ve etiket anahtarlarını (i18n) tanımla
const NEW_QUICK_ACTIONS = [
{ id: '1', labelKey: 'quickActions.home', icon: qa_home },
{ id: '2', labelKey: 'quickActions.governance', icon: qa_governance },
{ id: '3', labelKey: 'quickActions.exchange', icon: qa_exchange },
{ id: '4', labelKey: 'quickActions.b2b', icon: qa_b2b },
{ id: '5', labelKey: 'quickActions.bank', icon: qa_bank },
{ id: '6', labelKey: 'quickActions.games', icon: qa_games },
{ id: '7', labelKey: 'quickActions.university', icon: qa_university },
{ id: '8', labelKey: 'quickActions.education', icon: qa_education },
{ id: '9', labelKey: 'quickActions.dashboard', icon: qa_dashboard },
{ id: '10', labelKey: 'quickActions.trading', icon: qa_trading },
{ id: '11', labelKey: 'quickActions.kurdmedia', icon: qa_kurdmedia },
{ id: '12', labelKey: 'quickActions.rewards', icon: qa_rewards },
{ id: '13', labelKey: 'quickActions.forum', icon: qa_forum },
];
function HomeTab({ navigation }: any) { function HomeTab({ navigation }: any) {
const { user } = useAuth(); const { user } = useAuth();
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();
const [profileImage, setProfileImage] = useState<string | null>(null); const [profileImage, setProfileImage] = useState<string | null>(null);
const { t } = useLanguage();
const showImagePickerOptions = () => { const showImagePickerOptions = () => {
Alert.alert( Alert.alert(
'Change Profile Photo', t('imagePicker.title'),
'Choose an option', t('imagePicker.subtitle'),
[ [
{ {
text: 'Take Photo', text: t('imagePicker.takePhoto'),
onPress: takePhoto, onPress: takePhoto,
}, },
{ {
text: 'Choose from Gallery', text: t('imagePicker.chooseFromGallery'),
onPress: pickImageFromGallery, onPress: pickImageFromGallery,
}, },
{ {
text: 'Cancel', text: t('common.cancel'),
style: 'cancel', style: 'cancel',
}, },
], ],
@@ -49,7 +84,7 @@ function HomeTab({ navigation }: any) {
const permissionResult = await ImagePicker.requestCameraPermissionsAsync(); const permissionResult = await ImagePicker.requestCameraPermissionsAsync();
if (permissionResult.granted === false) { if (permissionResult.granted === false) {
Alert.alert('Permission Required', 'Camera permission is required!'); Alert.alert(t('alerts.permissionRequired'), t('alerts.cameraPermission'));
return; return;
} }
@@ -63,7 +98,7 @@ function HomeTab({ navigation }: any) {
if (!result.canceled && result.assets[0].base64) { if (!result.canceled && result.assets[0].base64) {
const base64Image = `data:image/jpeg;base64,${result.assets[0].base64}`; const base64Image = `data:image/jpeg;base64,${result.assets[0].base64}`;
setProfileImage(base64Image); setProfileImage(base64Image);
// TODO: Save to backend // TODO: Save to backend (Backend endpoint'i '/api/auth/profile' güncellenmeli)
} }
}; };
@@ -71,7 +106,7 @@ function HomeTab({ navigation }: any) {
const permissionResult = await ImagePicker.requestMediaLibraryPermissionsAsync(); const permissionResult = await ImagePicker.requestMediaLibraryPermissionsAsync();
if (permissionResult.granted === false) { if (permissionResult.granted === false) {
Alert.alert('Permission Required', 'Gallery access is required!'); Alert.alert(t('alerts.permissionRequired'), t('alerts.galleryPermission'));
return; return;
} }
@@ -86,13 +121,13 @@ function HomeTab({ navigation }: any) {
if (!result.canceled && result.assets[0].base64) { if (!result.canceled && result.assets[0].base64) {
const base64Image = `data:image/jpeg;base64,${result.assets[0].base64}`; const base64Image = `data:image/jpeg;base64,${result.assets[0].base64}`;
setProfileImage(base64Image); setProfileImage(base64Image);
// TODO: Save to backend // TODO: Save to backend (Backend endpoint'i '/api/auth/profile' güncellenmeli)
} }
}; };
return ( return (
<View style={styles.container}> <View style={styles.container}>
<ScrollView showsVerticalScrollIndicator={false} contentContainerStyle={styles.scrollContent}> <ScrollView showsVerticalScrollIndicator={false} contentContainerStyle={styles.scrollContent}>
{/* Header */} {/* Header (TASARIM KORUNDU) */}
<View style={[styles.header, { paddingTop: insets.top + 16 }]}> <View style={[styles.header, { paddingTop: insets.top + 16 }]}>
<View style={styles.headerLeft}> <View style={styles.headerLeft}>
<TouchableOpacity style={styles.profileImage} onPress={showImagePickerOptions}> <TouchableOpacity style={styles.profileImage} onPress={showImagePickerOptions}>
@@ -120,25 +155,26 @@ function HomeTab({ navigation }: any) {
</View> </View>
</View> </View>
{/* Announcements Widget */} {/* Announcements Widget (TASARIM KORUNDU) */}
<View style={styles.announcementWidget}> <View style={styles.announcementWidget}>
<ScrollView horizontal showsHorizontalScrollIndicator={false}> <ScrollView horizontal showsHorizontalScrollIndicator={false}>
<View style={styles.announcement}> <View style={styles.announcement}>
<Text style={styles.announcementTitle}>🎉 Welcome to PezkuwiChain!</Text> <Text style={styles.announcementTitle}>{t('homeTab.welcomeTitle')}</Text>
<Text style={styles.announcementText}>Start your citizenship journey today</Text> <Text style={styles.announcementText}>{t('homeTab.welcomeMessage')}</Text>
</View> </View>
<View style={styles.announcement}> <View style={styles.announcement}>
<Text style={styles.announcementTitle}>📢 New Feature</Text> <Text style={styles.announcementTitle}>{t('homeTab.featureTitle')}</Text>
<Text style={styles.announcementText}>Vote on governance proposals</Text> <Text style={styles.announcementText}>{t('homeTab.featureMessage')}</Text>
</View> </View>
</ScrollView> </ScrollView>
</View> </View>
{/* Quick Actions Grid - 30 Actions */} {/* Quick Actions Grid - YENİ GÖRSELLERLE GÜNCELLENDİ */}
<View style={styles.quickActionsContainer}> <View style={styles.quickActionsContainer}>
<Text style={styles.sectionTitle}>{i18n.t('quickActions')}</Text> <Text style={styles.sectionTitle}>{t('homeTab.quickActions')}</Text>
<View style={styles.actionsGrid}> <View style={styles.actionsGrid}>
{QUICK_ACTIONS.map((action, index) => ( {/* YENİ: Dizi 'NEW_QUICK_ACTIONS' olarak değişti */}
{NEW_QUICK_ACTIONS.map((action, index) => (
<TouchableOpacity <TouchableOpacity
key={action.id} key={action.id}
style={[styles.actionCard, style={[styles.actionCard,
@@ -147,10 +183,12 @@ function HomeTab({ navigation }: any) {
]} ]}
activeOpacity={0.7} activeOpacity={0.7}
> >
<View style={[styles.actionIcon, { backgroundColor: action.color }]}> {/* YENİ: 'Ionicons' yerine 'Image' component'i kullanıldı */}
<Ionicons name={action.icon} size={24} color="#FFF" /> <View style={styles.actionIcon}>
<Image source={action.icon} style={styles.actionIconImage} />
</View> </View>
<Text style={styles.actionLabel}>{i18n.t(action.labelKey)}</Text> {/* YENİ: Etiket 'quickActions' objesinden alınıyor */}
<Text style={styles.actionLabel}>{t(action.labelKey)}</Text>
</TouchableOpacity> </TouchableOpacity>
))} ))}
</View> </View>
@@ -163,43 +201,24 @@ function HomeTab({ navigation }: any) {
function WalletTab() { function WalletTab() {
const { user } = useAuth(); const { user } = useAuth();
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();
const [hezBalance, setHezBalance] = useState('Loading...'); const { t } = useLanguage();
const [pezBalance, setPezBalance] = useState('Loading...'); const [hezBalance, setHezBalance] = useState(t('walletTab.balanceLoading'));
const [pezBalance, setPezBalance] = useState(t('walletTab.balanceLoading'));
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const TEST_WALLET = '5GgTgG9sRmPQAYU1RsTejZYnZRjwzKZKWD3awtuqjHioki45'; const TEST_WALLET = '5GgTgG9sRmPQAYU1RsTejZYnZRjwzKZKWD3awtuqjHioki45';
useEffect(() => { useEffect(() => {
setHezBalance(t('walletTab.balanceLoading'));
setPezBalance(t('walletTab.balanceLoading'));
fetchBalance(); fetchBalance();
}, []); }, [t]);
const fetchBalance = async () => { const fetchBalance = async () => {
try { try {
const backendUrl = process.env.EXPO_PUBLIC_BACKEND_URL || 'http://localhost:8001'; const data = await api.getBalance(TEST_WALLET);
const controller = new AbortController(); setHezBalance(parseFloat(data.hez).toFixed(2));
const timeoutId = setTimeout(() => controller.abort(), 5000); // 5 sec timeout setPezBalance(parseFloat(data.pez).toFixed(2));
const response = await fetch(`${backendUrl}/api/blockchain/balance`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
address: TEST_WALLET,
}),
signal: controller.signal,
});
clearTimeout(timeoutId);
if (response.ok) {
const data = await response.json();
setHezBalance(parseFloat(data.hez).toFixed(2));
setPezBalance(parseFloat(data.pez).toFixed(2));
} else {
setHezBalance('0.00');
setPezBalance('0.00');
}
} catch (error) { } catch (error) {
console.error('Balance fetch error:', error); console.error('Balance fetch error:', error);
setHezBalance('0.00'); setHezBalance('0.00');
@@ -212,15 +231,15 @@ function WalletTab() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<ScrollView contentContainerStyle={styles.walletScrollContent}> <ScrollView contentContainerStyle={styles.walletScrollContent}>
{/* Header */} {/* TASARIM KORUNDU */}
<View style={[styles.walletHeader, { paddingTop: insets.top + 16 }]}> <View style={[styles.walletHeader, { paddingTop: insets.top + 16 }]}>
<Text style={styles.walletTitle}>My Wallet</Text> <Text style={styles.walletTitle}>{t('walletTab.title')}</Text>
<TouchableOpacity onPress={fetchBalance} style={styles.refreshButton}> <TouchableOpacity onPress={fetchBalance} style={styles.refreshButton}>
<Ionicons name="refresh" size={20} color="#EE2A35" /> <Ionicons name="refresh" size={20} color="#EE2A35" />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
{/* Balance Cards - Side by Side */} {/* TASARIM KORUNDU */}
<View style={styles.balanceRow}> <View style={styles.balanceRow}>
<View style={styles.balanceCardNew}> <View style={styles.balanceCardNew}>
<Image <Image
@@ -229,7 +248,7 @@ function WalletTab() {
/> />
<Text style={styles.tokenSymbolNew}>HEZ</Text> <Text style={styles.tokenSymbolNew}>HEZ</Text>
<Text style={styles.balanceAmountNew}>{hezBalance}</Text> <Text style={styles.balanceAmountNew}>{hezBalance}</Text>
<Text style={styles.tokenNameNew}>Hemwelatî Token</Text> <Text style={styles.tokenNameNew}>{t('walletTab.hezName')}</Text>
</View> </View>
<View style={styles.balanceCardNew}> <View style={styles.balanceCardNew}>
@@ -239,57 +258,54 @@ function WalletTab() {
/> />
<Text style={styles.tokenSymbolNew}>PEZ</Text> <Text style={styles.tokenSymbolNew}>PEZ</Text>
<Text style={styles.balanceAmountNew}>{pezBalance}</Text> <Text style={styles.balanceAmountNew}>{pezBalance}</Text>
<Text style={styles.tokenNameNew}>Pezkuwî Token</Text> <Text style={styles.tokenNameNew}>{t('walletTab.pezName')}</Text>
</View> </View>
</View> </View>
{/* Action Buttons Container */} {/* TASARIM KORUNDU */}
<View style={styles.actionsContainer}> <View style={styles.actionsContainer}>
{/* First Row: Send, Receive, Swap, P2P */}
<View style={styles.actionsRow}> <View style={styles.actionsRow}>
<TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#34D399'}]}> <TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#34D399'}]}>
<Ionicons name="arrow-up" size={24} color="#FFF" /> <Ionicons name="arrow-up" size={24} color="#FFF" />
<Text style={styles.actionBtnText}>Send</Text> <Text style={styles.actionBtnText}>{t('homeTab.send')}</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#3B82F6'}]}> <TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#3B82F6'}]}>
<Ionicons name="arrow-down" size={24} color="#FFF" /> <Ionicons name="arrow-down" size={24} color="#FFF" />
<Text style={styles.actionBtnText}>Receive</Text> <Text style={styles.actionBtnText}>{t('homeTab.receive')}</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#8B5CF6'}]}> <TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#8B5CF6'}]}>
<Ionicons name="swap-horizontal" size={24} color="#FFF" /> <Ionicons name="swap-horizontal" size={24} color="#FFF" />
<Text style={styles.actionBtnText}>Swap</Text> <Text style={styles.actionBtnText}>{t('walletTab.swap')}</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#1F2937'}]}> <TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#1F2937'}]}>
<Ionicons name="people" size={24} color="#FFF" /> <Ionicons name="people" size={24} color="#FFF" />
<Text style={styles.actionBtnText}>P2P</Text> <Text style={styles.actionBtnText}>{t('walletTab.p2p')}</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
{/* Second Row: Vote, DApps, Staking, Connect */}
<View style={styles.actionsRow}> <View style={styles.actionsRow}>
<TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#EF4444'}]}> <TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#EF4444'}]}>
<Ionicons name="megaphone" size={24} color="#FFF" /> <Ionicons name="megaphone" size={24} color="#FFF" />
<Text style={styles.actionBtnText}>Vote</Text> <Text style={styles.actionBtnText}>{t('homeTab.vote')}</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#F59E0B'}]}> <TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#F59E0B'}]}>
<Ionicons name="apps" size={24} color="#FFF" /> <Ionicons name="apps" size={24} color="#FFF" />
<Text style={styles.actionBtnText}>DApps</Text> <Text style={styles.actionBtnText}>{t('walletTab.dapps')}</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#10B981'}]}> <TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#10B981'}]}>
<Ionicons name="leaf" size={24} color="#FFF" /> <Ionicons name="leaf" size={24} color="#FFF" />
<Text style={styles.actionBtnText}>Staking</Text> <Text style={styles.actionBtnText}>{t('walletTab.staking')}</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#6366F1'}]}> <TouchableOpacity style={[styles.actionBtn, {backgroundColor: '#6366F1'}]}>
<Ionicons name="link" size={24} color="#FFF" /> <Ionicons name="link" size={24} color="#FFF" />
<Text style={styles.actionBtnText}>Connect</Text> <Text style={styles.actionBtnText}>{t('walletTab.connect')}</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
{/* Tokens List */} {/* TASARIM KORUNDU */}
<View style={styles.tokensContainer}> <View style={styles.tokensContainer}>
<View style={styles.tokensHeader}> <View style={styles.tokensHeader}>
<Text style={styles.tokensTitle}>Tokens</Text> <Text style={styles.tokensTitle}>{t('walletTab.tokens')}</Text>
<View style={styles.tokensHeaderActions}> <View style={styles.tokensHeaderActions}>
<TouchableOpacity style={styles.tokenHeaderButton}> <TouchableOpacity style={styles.tokenHeaderButton}>
<Ionicons name="search" size={20} color="#6B7280" /> <Ionicons name="search" size={20} color="#6B7280" />
@@ -303,8 +319,8 @@ function WalletTab() {
</View> </View>
</View> </View>
{/* USDT with PEZ badge */}
<View style={styles.tokenItem}> <View style={styles.tokenItem}>
{/* ... (Tüm token item'ları ve tasarımları korundu) ... */}
<View style={styles.tokenItemLeft}> <View style={styles.tokenItemLeft}>
<View style={styles.tokenIconContainer}> <View style={styles.tokenIconContainer}>
<Image <Image
@@ -318,7 +334,7 @@ function WalletTab() {
</View> </View>
<View> <View>
<Text style={styles.tokenItemName}>USDT</Text> <Text style={styles.tokenItemName}>USDT</Text>
<Text style={styles.tokenItemNetwork}>PEZ Network</Text> <Text style={styles.tokenItemNetwork}>{t('walletTab.pezNetwork')}</Text>
</View> </View>
</View> </View>
<View style={styles.tokenItemRight}> <View style={styles.tokenItemRight}>
@@ -326,8 +342,6 @@ function WalletTab() {
<Text style={styles.tokenItemUsd}>$0.00</Text> <Text style={styles.tokenItemUsd}>$0.00</Text>
</View> </View>
</View> </View>
{/* DOT (Polkadot) */}
<View style={styles.tokenItem}> <View style={styles.tokenItem}>
<View style={styles.tokenItemLeft}> <View style={styles.tokenItemLeft}>
<Image <Image
@@ -336,7 +350,7 @@ function WalletTab() {
/> />
<View> <View>
<Text style={styles.tokenItemName}>DOT</Text> <Text style={styles.tokenItemName}>DOT</Text>
<Text style={styles.tokenItemNetwork}>Polkadot</Text> <Text style={styles.tokenItemNetwork}>{t('walletTab.polkadotNetwork')}</Text>
</View> </View>
</View> </View>
<View style={styles.tokenItemRight}> <View style={styles.tokenItemRight}>
@@ -344,8 +358,6 @@ function WalletTab() {
<Text style={styles.tokenItemUsd}>$0.00</Text> <Text style={styles.tokenItemUsd}>$0.00</Text>
</View> </View>
</View> </View>
{/* BTC (Bitcoin) */}
<View style={styles.tokenItem}> <View style={styles.tokenItem}>
<View style={styles.tokenItemLeft}> <View style={styles.tokenItemLeft}>
<Image <Image
@@ -354,7 +366,7 @@ function WalletTab() {
/> />
<View> <View>
<Text style={styles.tokenItemName}>BTC</Text> <Text style={styles.tokenItemName}>BTC</Text>
<Text style={styles.tokenItemNetwork}>Bitcoin</Text> <Text style={styles.tokenItemNetwork}>{t('walletTab.bitcoinNetwork')}</Text>
</View> </View>
</View> </View>
<View style={styles.tokenItemRight}> <View style={styles.tokenItemRight}>
@@ -362,8 +374,6 @@ function WalletTab() {
<Text style={styles.tokenItemUsd}>$0.00</Text> <Text style={styles.tokenItemUsd}>$0.00</Text>
</View> </View>
</View> </View>
{/* ETH (Ethereum) */}
<View style={styles.tokenItem}> <View style={styles.tokenItem}>
<View style={styles.tokenItemLeft}> <View style={styles.tokenItemLeft}>
<Image <Image
@@ -372,7 +382,7 @@ function WalletTab() {
/> />
<View> <View>
<Text style={styles.tokenItemName}>ETH</Text> <Text style={styles.tokenItemName}>ETH</Text>
<Text style={styles.tokenItemNetwork}>Ethereum</Text> <Text style={styles.tokenItemNetwork}>{t('walletTab.ethereumNetwork')}</Text>
</View> </View>
</View> </View>
<View style={styles.tokenItemRight}> <View style={styles.tokenItemRight}>
@@ -380,8 +390,6 @@ function WalletTab() {
<Text style={styles.tokenItemUsd}>$0.00</Text> <Text style={styles.tokenItemUsd}>$0.00</Text>
</View> </View>
</View> </View>
{/* BNB (Binance Coin) */}
<View style={styles.tokenItem}> <View style={styles.tokenItem}>
<View style={styles.tokenItemLeft}> <View style={styles.tokenItemLeft}>
<Image <Image
@@ -390,7 +398,7 @@ function WalletTab() {
/> />
<View> <View>
<Text style={styles.tokenItemName}>BNB</Text> <Text style={styles.tokenItemName}>BNB</Text>
<Text style={styles.tokenItemNetwork}>Binance Smart Chain</Text> <Text style={styles.tokenItemNetwork}>{t('walletTab.bscNetwork')}</Text>
</View> </View>
</View> </View>
<View style={styles.tokenItemRight}> <View style={styles.tokenItemRight}>
@@ -398,8 +406,6 @@ function WalletTab() {
<Text style={styles.tokenItemUsd}>$0.00</Text> <Text style={styles.tokenItemUsd}>$0.00</Text>
</View> </View>
</View> </View>
{/* ADA (Cardano) */}
<View style={styles.tokenItem}> <View style={styles.tokenItem}>
<View style={styles.tokenItemLeft}> <View style={styles.tokenItemLeft}>
<Image <Image
@@ -408,7 +414,7 @@ function WalletTab() {
/> />
<View> <View>
<Text style={styles.tokenItemName}>ADA</Text> <Text style={styles.tokenItemName}>ADA</Text>
<Text style={styles.tokenItemNetwork}>Cardano</Text> <Text style={styles.tokenItemNetwork}>{t('walletTab.cardanoNetwork')}</Text>
</View> </View>
</View> </View>
<View style={styles.tokenItemRight}> <View style={styles.tokenItemRight}>
@@ -416,8 +422,6 @@ function WalletTab() {
<Text style={styles.tokenItemUsd}>$0.00</Text> <Text style={styles.tokenItemUsd}>$0.00</Text>
</View> </View>
</View> </View>
{/* SOL (Solana) */}
<View style={styles.tokenItem}> <View style={styles.tokenItem}>
<View style={styles.tokenItemLeft}> <View style={styles.tokenItemLeft}>
<Image <Image
@@ -426,7 +430,7 @@ function WalletTab() {
/> />
<View> <View>
<Text style={styles.tokenItemName}>SOL</Text> <Text style={styles.tokenItemName}>SOL</Text>
<Text style={styles.tokenItemNetwork}>Solana</Text> <Text style={styles.tokenItemNetwork}>{t('walletTab.solanaNetwork')}</Text>
</View> </View>
</View> </View>
<View style={styles.tokenItemRight}> <View style={styles.tokenItemRight}>
@@ -434,6 +438,7 @@ function WalletTab() {
<Text style={styles.tokenItemUsd}>$0.00</Text> <Text style={styles.tokenItemUsd}>$0.00</Text>
</View> </View>
</View> </View>
</View> </View>
</ScrollView> </ScrollView>
</View> </View>
@@ -441,25 +446,28 @@ function WalletTab() {
} }
function CitizensTab() { function CitizensTab() {
const { t } = useLanguage();
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.placeholderText}>Citizens Screen</Text> <Text style={styles.placeholderText}>{t('placeholders.citizens')}</Text>
</View> </View>
); );
} }
function ReferralTab() { function ReferralTab() {
const { t } = useLanguage();
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.placeholderText}>Referral Screen</Text> <Text style={styles.placeholderText}>{t('placeholders.referral')}</Text>
</View> </View>
); );
} }
function ProfileTab() { function ProfileTab() {
const { t } = useLanguage();
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.placeholderText}>Profile Screen</Text> <Text style={styles.placeholderText}>{t('placeholders.profile')}</Text>
</View> </View>
); );
} }
@@ -467,6 +475,8 @@ function ProfileTab() {
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
export default function HomeScreen({ navigation }: any) { export default function HomeScreen({ navigation }: any) {
const { t } = useLanguage();
return ( return (
<Tab.Navigator <Tab.Navigator
screenOptions={{ screenOptions={{
@@ -479,7 +489,7 @@ export default function HomeScreen({ navigation }: any) {
<Tab.Screen <Tab.Screen
name="HomeTab" name="HomeTab"
options={{ options={{
tabBarLabel: i18n.t('home'), tabBarLabel: t('home'),
tabBarIcon: ({ color, size }) => ( tabBarIcon: ({ color, size }) => (
<Ionicons name="home" size={size} color={color} /> <Ionicons name="home" size={size} color={color} />
), ),
@@ -491,7 +501,7 @@ export default function HomeScreen({ navigation }: any) {
name="Wallet" name="Wallet"
component={WalletTab} component={WalletTab}
options={{ options={{
tabBarLabel: i18n.t('wallet'), tabBarLabel: t('wallet'),
tabBarIcon: ({ color, size }) => ( tabBarIcon: ({ color, size }) => (
<Ionicons name="wallet" size={size} color={color} /> <Ionicons name="wallet" size={size} color={color} />
), ),
@@ -501,7 +511,7 @@ export default function HomeScreen({ navigation }: any) {
name="Citizens" name="Citizens"
component={CitizensTab} component={CitizensTab}
options={{ options={{
tabBarLabel: i18n.t('citizens'), tabBarLabel: t('citizens'),
tabBarIcon: ({ color, size }) => ( tabBarIcon: ({ color, size }) => (
<Ionicons name="people" size={size} color={color} /> <Ionicons name="people" size={size} color={color} />
), ),
@@ -511,7 +521,7 @@ export default function HomeScreen({ navigation }: any) {
name="Referral" name="Referral"
component={ReferralTab} component={ReferralTab}
options={{ options={{
tabBarLabel: i18n.t('referral'), tabBarLabel: t('referral'),
tabBarIcon: ({ color, size }) => ( tabBarIcon: ({ color, size }) => (
<Ionicons name="gift" size={size} color={color} /> <Ionicons name="gift" size={size} color={color} />
), ),
@@ -521,7 +531,7 @@ export default function HomeScreen({ navigation }: any) {
name="Profile" name="Profile"
component={ProfileTab} component={ProfileTab}
options={{ options={{
tabBarLabel: i18n.t('profile'), tabBarLabel: t('profile'),
tabBarIcon: ({ color, size }) => ( tabBarIcon: ({ color, size }) => (
<Ionicons name="person" size={size} color={color} /> <Ionicons name="person" size={size} color={color} />
), ),
@@ -531,21 +541,9 @@ export default function HomeScreen({ navigation }: any) {
); );
} }
const QUICK_ACTIONS = [ // ESKİ: 'QUICK_ACTIONS' dizisi kaldırıldı.
{ id: '1', labelKey: 'send', icon: 'arrow-forward', color: '#EE2A35' },
{ id: '2', labelKey: 'receive', icon: 'arrow-down', color: '#00A651' },
{ id: '3', labelKey: 'exchange', icon: 'swap-horizontal', color: '#FFD700' },
{ id: '4', labelKey: 'vote', icon: 'checkmark-circle', color: '#3B82F6' },
{ id: '5', labelKey: 'stake', icon: 'lock-closed', color: '#8B5CF6' },
{ id: '6', labelKey: 'nft', icon: 'card', color: '#10B981' },
{ id: '7', labelKey: 'certificates', icon: 'document-text', color: '#F59E0B' },
{ id: '8', labelKey: 'certificates', icon: 'school', color: '#EC4899' },
{ id: '9', labelKey: 'pay', icon: 'briefcase', color: '#6366F1' },
{ id: '10', labelKey: 'rewards', icon: 'cash', color: '#14B8A6' },
{ id: '11', labelKey: 'vote', icon: 'bulb', color: '#F97316' },
{ id: '12', labelKey: 'assets', icon: 'apps', color: '#9333EA' },
];
// Stillerin TAMAMI korundu ve 'actionIconImage' eklendi
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
@@ -668,6 +666,13 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
marginBottom: 8, marginBottom: 8,
overflow: 'hidden', // YENİ: Resimlerin taşmasını engelle
},
// YENİ: Özel görseller için stil
actionIconImage: {
width: '100%',
height: '100%',
resizeMode: 'cover', // VEYA 'contain', hangisi daha iyi durursa
}, },
actionLabel: { actionLabel: {
fontSize: 11, fontSize: 11,
@@ -792,12 +797,6 @@ const styles = StyleSheet.create({
color: '#1F2937', color: '#1F2937',
marginBottom: 4, marginBottom: 4,
}, },
balanceAmountNew: {
fontSize: 24,
fontWeight: '700',
color: '#EE2A35',
marginBottom: 4,
},
tokenNameNew: { tokenNameNew: {
fontSize: 12, fontSize: 12,
color: '#6B7280', color: '#6B7280',
@@ -919,4 +918,10 @@ const styles = StyleSheet.create({
fontSize: 12, fontSize: 12,
color: '#6B7280', color: '#6B7280',
}, },
}); balanceAmountNew: {
fontSize: 24,
fontWeight: '700',
color: '#EE2A35',
marginBottom: 4,
},
});