From ddcc09a593e7a6ddf34e931dd6d3993954d1bc18 Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Thu, 15 Jan 2026 07:38:33 +0300 Subject: [PATCH] feat(mobile): Enable shared/lib imports via symlink for production blockchain integration - Create symlink mobile/shared -> ../shared for Metro bundler access - Update all @pezkuwi/lib/* imports to use relative paths (../../shared/lib/*) - Dashboard Roles card now fetches real tiki data from blockchain - Staking screen uses production getStakingInfo and getAllScores - All citizenship, referral, and NFT screens use real blockchain queries Co-Authored-By: Claude Opus 4.5 --- mobile/shared | 1 + mobile/src/screens/BeCitizenApplyScreen.tsx | 4 ++-- mobile/src/screens/BeCitizenClaimScreen.tsx | 2 +- mobile/src/screens/BeCitizenScreen.tsx | 2 +- mobile/src/screens/DashboardScreen.tsx | 6 +++--- mobile/src/screens/NFTGalleryScreen.tsx | 2 +- mobile/src/screens/ReferralScreen.tsx | 2 +- mobile/src/screens/StakingScreen.tsx | 6 +++--- 8 files changed, 13 insertions(+), 12 deletions(-) create mode 120000 mobile/shared diff --git a/mobile/shared b/mobile/shared new file mode 120000 index 00000000..8fba6b66 --- /dev/null +++ b/mobile/shared @@ -0,0 +1 @@ +../shared \ No newline at end of file diff --git a/mobile/src/screens/BeCitizenApplyScreen.tsx b/mobile/src/screens/BeCitizenApplyScreen.tsx index 3e916160..b75f6c7c 100644 --- a/mobile/src/screens/BeCitizenApplyScreen.tsx +++ b/mobile/src/screens/BeCitizenApplyScreen.tsx @@ -18,8 +18,8 @@ import { submitKycApplication, uploadToIPFS, FOUNDER_ADDRESS, -} from '@pezkuwi/lib/citizenship-workflow'; -import type { Region, MaritalStatus } from '@pezkuwi/lib/citizenship-workflow'; +} from '../../shared/lib/citizenship-workflow'; +import type { Region, MaritalStatus } from '../../shared/lib/citizenship-workflow'; import { KurdistanColors } from '../theme/colors'; // Temporary custom picker component (until we fix @react-native-picker/picker installation) diff --git a/mobile/src/screens/BeCitizenClaimScreen.tsx b/mobile/src/screens/BeCitizenClaimScreen.tsx index ca08b40e..864d4ee0 100644 --- a/mobile/src/screens/BeCitizenClaimScreen.tsx +++ b/mobile/src/screens/BeCitizenClaimScreen.tsx @@ -12,7 +12,7 @@ import { } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import { usePezkuwi } from '../contexts/PezkuwiContext'; -import { getCitizenshipStatus } from '@pezkuwi/lib/citizenship-workflow'; +import { getCitizenshipStatus } from '../../shared/lib/citizenship-workflow'; import { KurdistanColors } from '../theme/colors'; const BeCitizenClaimScreen: React.FC = () => { diff --git a/mobile/src/screens/BeCitizenScreen.tsx b/mobile/src/screens/BeCitizenScreen.tsx index 2af94a3f..c6e2d9a0 100644 --- a/mobile/src/screens/BeCitizenScreen.tsx +++ b/mobile/src/screens/BeCitizenScreen.tsx @@ -17,7 +17,7 @@ import { submitKycApplication, uploadToIPFS, getCitizenshipStatus, -} from '@pezkuwi/lib/citizenship-workflow'; +} from '../../shared/lib/citizenship-workflow'; import { KurdistanColors } from '../theme/colors'; const BeCitizenScreen: React.FC = () => { diff --git a/mobile/src/screens/DashboardScreen.tsx b/mobile/src/screens/DashboardScreen.tsx index 4aeb4239..8aee8c63 100644 --- a/mobile/src/screens/DashboardScreen.tsx +++ b/mobile/src/screens/DashboardScreen.tsx @@ -23,9 +23,9 @@ import { useAuth } from '../contexts/AuthContext'; import { usePezkuwi } from '../contexts/PezkuwiContext'; import { supabase } from '../lib/supabase'; import AvatarPickerModal from '../components/AvatarPickerModal'; -import { fetchUserTikis, getPrimaryRole, getTikiDisplayName, getTikiEmoji, getTikiColor } from '@pezkuwi/lib/tiki'; -import { getAllScores, type UserScores } from '@pezkuwi/lib/scores'; -import { getKycStatus } from '@pezkuwi/lib/kyc'; +import { fetchUserTikis, getPrimaryRole, getTikiDisplayName, getTikiEmoji, getTikiColor } from '../../shared/lib/tiki'; +import { getAllScores, type UserScores } from '../../shared/lib/scores'; +import { getKycStatus } from '../../shared/lib/kyc'; // Existing Quick Action Images (Reused) import qaEducation from '../../../shared/images/quick-actions/qa_education.png'; diff --git a/mobile/src/screens/NFTGalleryScreen.tsx b/mobile/src/screens/NFTGalleryScreen.tsx index 9ef9bff6..2db1e3c7 100644 --- a/mobile/src/screens/NFTGalleryScreen.tsx +++ b/mobile/src/screens/NFTGalleryScreen.tsx @@ -17,7 +17,7 @@ import { Badge, CardSkeleton, } from '../components'; -import { fetchUserTikis, getTikiDisplayName, getTikiEmoji } from '@pezkuwi/lib/tiki'; +import { fetchUserTikis, getTikiDisplayName, getTikiEmoji } from '../../shared/lib/tiki'; const { width } = Dimensions.get('window'); const NFT_SIZE = (width - 48) / 2; // 2 columns with padding diff --git a/mobile/src/screens/ReferralScreen.tsx b/mobile/src/screens/ReferralScreen.tsx index f8318ba1..8d586f63 100644 --- a/mobile/src/screens/ReferralScreen.tsx +++ b/mobile/src/screens/ReferralScreen.tsx @@ -20,7 +20,7 @@ import { getMyReferrals, calculateReferralScore, type ReferralStats as BlockchainReferralStats, -} from '@pezkuwi/lib/referral'; +} from '../../shared/lib/referral'; interface ReferralStats { totalReferrals: number; diff --git a/mobile/src/screens/StakingScreen.tsx b/mobile/src/screens/StakingScreen.tsx index c25a2f70..561dd944 100644 --- a/mobile/src/screens/StakingScreen.tsx +++ b/mobile/src/screens/StakingScreen.tsx @@ -18,9 +18,9 @@ import { ValidatorSelectionSheet, CardSkeleton, } from '../components'; -import { getStakingInfo } from '@pezkuwi/lib/staking'; -import { getAllScores } from '@pezkuwi/lib/scores'; -import { formatBalance } from '@pezkuwi/lib/wallet'; +import { getStakingInfo } from '../../shared/lib/staking'; +import { getAllScores } from '../../shared/lib/scores'; +import { formatBalance } from '../../shared/lib/wallet'; // Helper types derived from shared lib interface StakingScreenData {