test 优化

This commit is contained in:
2026-03-24 16:47:37 +08:00
parent f0e21a2715
commit 9c220f1322
16 changed files with 669 additions and 603 deletions

44
App.tsx
View File

@@ -1,11 +1,32 @@
import React from 'react';
import { Text } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Svg, { Path, Circle, Rect } from 'react-native-svg';
import HomeScreen from './screens/HomeScreen';
import TestScreen from './screens/TestScreen';
import MessageScreen from './screens/MessageScreen';
const WalletIcon = ({ color, size }: { color: string; size: number }) => (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
<Rect x="2" y="5" width="20" height="15" rx="2" stroke={color} strokeWidth="1.8" />
<Path d="M2 10h20" stroke={color} strokeWidth="1.8" />
<Circle cx="17" cy="15" r="1.5" fill={color} />
</Svg>
);
const ToolIcon = ({ color, size }: { color: string; size: number }) => (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
<Path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3-3a6 6 0 0 1-7 7l-6.4 6.4a2 2 0 1 1-2.8-2.8L10.9 10a6 6 0 0 1 7-7l-3.2 3.3z" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" />
</Svg>
);
const MessageIcon = ({ color, size }: { color: string; size: number }) => (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
<Path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" />
</Svg>
);
const Tab = createBottomTabNavigator();
export default function App() {
@@ -30,11 +51,18 @@ export default function App() {
name="Home"
component={HomeScreen}
options={{
title: '首页',
tabBarLabel: '首页',
tabBarIcon: ({ color, size }) => (
<Text style={{ fontSize: size, color }}>🏠</Text>
),
title: '钱包列表',
tabBarLabel: '钱包列表',
tabBarIcon: ({ color, size }) => <WalletIcon color={color} size={size} />,
}}
/>
<Tab.Screen
name="Test"
component={TestScreen}
options={{
title: '测试',
tabBarLabel: '测试',
tabBarIcon: ({ color, size }) => <ToolIcon color={color} size={size} />,
}}
/>
<Tab.Screen
@@ -43,9 +71,7 @@ export default function App() {
options={{
title: 'IM消息',
tabBarLabel: 'IM消息',
tabBarIcon: ({ color, size }) => (
<Text style={{ fontSize: size, color }}>💬</Text>
),
tabBarIcon: ({ color, size }) => <MessageIcon color={color} size={size} />,
}}
/>
</Tab.Navigator>