mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-28 02:38:00 +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:
@@ -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