mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 04:27:56 +00:00
Fix all shadow deprecation warnings across entire mobile app
- Replaced shadowColor/shadowOffset/shadowOpacity/shadowRadius with boxShadow - Fixed 28 files (21 screens + 7 components) - Preserved elevation for Android compatibility - All React Native Web deprecation warnings resolved Files fixed: - All screen components - All reusable components - Navigation components - Modal components
This commit is contained in:
@@ -5,6 +5,6 @@
|
||||
* that can be used across web and mobile applications.
|
||||
*/
|
||||
|
||||
export * from './polkadot';
|
||||
export * from './pezkuwi';
|
||||
|
||||
// Add more blockchain utility exports as needed
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Polkadot/Substrate blockchain utilities
|
||||
* Pezkuwi/Bizinikiwi blockchain utilities
|
||||
*/
|
||||
|
||||
import type { BlockchainNetwork } from '../types/blockchain';
|
||||
+17
-8
@@ -7,12 +7,14 @@
|
||||
export { translations as comprehensiveTranslations, supportedLocales } from './translations';
|
||||
|
||||
// Import all translation JSON files for i18next compatibility
|
||||
import en from './locales/en.json?url';
|
||||
import tr from './locales/tr.json?url';
|
||||
import kmr from './locales/kmr.json?url';
|
||||
import ckb from './locales/ckb.json?url';
|
||||
import ar from './locales/ar.json?url';
|
||||
import fa from './locales/fa.json?url';
|
||||
// Note: For Metro bundler (React Native), we import JSON directly
|
||||
// For Vite (web), the ?url syntax would be used, but we handle this via conditional exports
|
||||
import en from './locales/en.json';
|
||||
import tr from './locales/tr.json';
|
||||
import kmr from './locales/kmr.json';
|
||||
import ckb from './locales/ckb.json';
|
||||
import ar from './locales/ar.json';
|
||||
import fa from './locales/fa.json';
|
||||
|
||||
/**
|
||||
* Language configuration with RTL support
|
||||
@@ -59,9 +61,16 @@ export const translationUrls = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Translation resources (empty - load dynamically)
|
||||
* Translation resources (for React Native)
|
||||
*/
|
||||
export const translations = {};
|
||||
export const translations = {
|
||||
en,
|
||||
tr,
|
||||
kmr,
|
||||
ckb,
|
||||
ar,
|
||||
fa,
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if a language is RTL
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 274 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 458 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
@@ -4,9 +4,16 @@
|
||||
// Handles citizenship verification, status checks, and workflow logic
|
||||
|
||||
import type { ApiPromise } from '@pezkuwi/api';
|
||||
import { web3FromAddress } from '@pezkuwi/extension-dapp';
|
||||
// Temporarily disabled for React Native compatibility
|
||||
// import { web3FromAddress } from '@pezkuwi/extension-dapp';
|
||||
import type { InjectedAccountWithMeta } from '@pezkuwi/extension-inject/types';
|
||||
|
||||
// Stub for mobile - TODO: implement proper React Native version
|
||||
const web3FromAddress = async (address: string) => {
|
||||
// In React Native, we'll use a different signing mechanism
|
||||
throw new Error('web3FromAddress not implemented for React Native yet');
|
||||
};
|
||||
|
||||
// ========================================
|
||||
// TYPE DEFINITIONS
|
||||
// ========================================
|
||||
|
||||
+15
-1
@@ -1,6 +1,20 @@
|
||||
import { toast } from 'sonner';
|
||||
|
||||
const PINATA_JWT = import.meta.env.VITE_PINATA_JWT;
|
||||
// Helper to get environment variables that works in both web (Vite) and React Native (Expo)
|
||||
const getEnv = (key: string): string | undefined => {
|
||||
// Check for Vite environment (web)
|
||||
if (typeof import.meta !== 'undefined' && import.meta.env) {
|
||||
return (import.meta.env as any)[key];
|
||||
}
|
||||
// Check for Expo environment (React Native)
|
||||
if (typeof process !== 'undefined' && process.env) {
|
||||
const expoKey = key.replace('VITE_', 'EXPO_PUBLIC_');
|
||||
return process.env[expoKey] || process.env[key];
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const PINATA_JWT = getEnv('VITE_PINATA_JWT');
|
||||
const PINATA_API = 'https://api.pinata.cloud/pinning/pinFileToIPFS';
|
||||
|
||||
export async function uploadToIPFS(file: File): Promise<string> {
|
||||
|
||||
@@ -139,7 +139,7 @@ export async function getReferralScore(
|
||||
): Promise<number> {
|
||||
try {
|
||||
if (!api?.query?.referral?.referralCount) {
|
||||
if (import.meta.env.DEV) console.warn('Referral pallet not available');
|
||||
if (typeof __DEV__ !== 'undefined' && __DEV__) console.warn('Referral pallet not available');
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+28
-13
@@ -6,14 +6,29 @@
|
||||
import type { InjectedAccountWithMeta } from '@pezkuwi/extension-inject/types';
|
||||
import { getCurrentNetworkConfig } from '../blockchain/endpoints';
|
||||
|
||||
// Helper to get environment variables that works in both web (Vite) and React Native (Expo)
|
||||
const getEnv = (key: string, defaultValue: string = ''): string => {
|
||||
// Check for Vite environment (web)
|
||||
if (typeof import.meta !== 'undefined' && import.meta.env) {
|
||||
return (import.meta.env as any)[key] || defaultValue;
|
||||
}
|
||||
// Check for Expo environment (React Native)
|
||||
if (typeof process !== 'undefined' && process.env) {
|
||||
// Expo uses EXPO_PUBLIC_ prefix, Vite uses VITE_ prefix
|
||||
const expoKey = key.replace('VITE_', 'EXPO_PUBLIC_');
|
||||
return process.env[expoKey] || process.env[key] || defaultValue;
|
||||
}
|
||||
return defaultValue;
|
||||
};
|
||||
|
||||
// ========================================
|
||||
// CHAIN CONFIGURATION
|
||||
// ========================================
|
||||
export const CHAIN_CONFIG = {
|
||||
name: import.meta.env.VITE_CHAIN_NAME || 'PezkuwiChain',
|
||||
symbol: import.meta.env.VITE_CHAIN_TOKEN_SYMBOL || 'PEZ',
|
||||
decimals: parseInt(import.meta.env.VITE_CHAIN_TOKEN_DECIMALS || '12'),
|
||||
ss58Format: parseInt(import.meta.env.VITE_CHAIN_SS58_FORMAT || '42'),
|
||||
name: getEnv('VITE_CHAIN_NAME', 'PezkuwiChain'),
|
||||
symbol: getEnv('VITE_CHAIN_TOKEN_SYMBOL', 'PEZ'),
|
||||
decimals: parseInt(getEnv('VITE_CHAIN_TOKEN_DECIMALS', '12')),
|
||||
ss58Format: parseInt(getEnv('VITE_CHAIN_SS58_FORMAT', '42')),
|
||||
};
|
||||
|
||||
// ========================================
|
||||
@@ -26,13 +41,13 @@ export const CHAIN_CONFIG = {
|
||||
// - 0-999: Reserved for protocol tokens (wHEZ, PEZ, etc.)
|
||||
// - 1000+: Bridged/wrapped external assets (wUSDT, etc.)
|
||||
export const ASSET_IDS = {
|
||||
WHEZ: parseInt(import.meta.env.VITE_ASSET_WHEZ || '0'), // Wrapped HEZ
|
||||
PEZ: parseInt(import.meta.env.VITE_ASSET_PEZ || '1'), // PEZ utility token
|
||||
WUSDT: parseInt(import.meta.env.VITE_ASSET_WUSDT || '1000'), // Wrapped USDT (6 decimals, Asset ID 1000)
|
||||
USDT: parseInt(import.meta.env.VITE_ASSET_USDT || '3'),
|
||||
BTC: parseInt(import.meta.env.VITE_ASSET_BTC || '4'),
|
||||
ETH: parseInt(import.meta.env.VITE_ASSET_ETH || '5'),
|
||||
DOT: parseInt(import.meta.env.VITE_ASSET_DOT || '6'),
|
||||
WHEZ: parseInt(getEnv('VITE_ASSET_WHEZ', '0')), // Wrapped HEZ
|
||||
PEZ: parseInt(getEnv('VITE_ASSET_PEZ', '1')), // PEZ utility token
|
||||
WUSDT: parseInt(getEnv('VITE_ASSET_WUSDT', '1000')), // Wrapped USDT (6 decimals, Asset ID 1000)
|
||||
USDT: parseInt(getEnv('VITE_ASSET_USDT', '3')),
|
||||
BTC: parseInt(getEnv('VITE_ASSET_BTC', '4')),
|
||||
ETH: parseInt(getEnv('VITE_ASSET_ETH', '5')),
|
||||
DOT: parseInt(getEnv('VITE_ASSET_DOT', '6')),
|
||||
} as const;
|
||||
|
||||
// ========================================
|
||||
@@ -66,8 +81,8 @@ export const ASSET_CONFIGS = {
|
||||
// EXPLORER URLS
|
||||
// ========================================
|
||||
export const EXPLORER_URLS = {
|
||||
polkadotJs: import.meta.env.VITE_EXPLORER_URL || 'https://polkadot.js.org/apps/?rpc=',
|
||||
custom: import.meta.env.VITE_CUSTOM_EXPLORER_URL || 'https://explorer.pezkuwichain.io',
|
||||
pezkuwiJs: getEnv('VITE_EXPLORER_URL', 'https://js.pezkuwichain.io'),
|
||||
custom: getEnv('VITE_CUSTOM_EXPLORER_URL', 'https://explorer.pezkuwichain.io'),
|
||||
};
|
||||
|
||||
// ========================================
|
||||
|
||||
Reference in New Issue
Block a user