Initial frontend repository commit.

Include app source and update .gitignore to exclude local release artifacts and signing files.

Made-with: Cursor
This commit is contained in:
2026-03-09 21:29:03 +08:00
commit 3968660048
129 changed files with 55599 additions and 0 deletions

File diff suppressed because it is too large Load Diff

110
src/navigation/types.ts Normal file
View File

@@ -0,0 +1,110 @@
/**
* 导航类型定义
* 定义所有导航栈的类型参数
*/
import { NavigatorScreenParams } from '@react-navigation/native';
import type { SystemMessageResponse } from '../types/dto';
// ==================== 主Tab导航参数 ====================
export type MainTabParamList = {
HomeTab: NavigatorScreenParams<HomeStackParamList>;
MessageTab: NavigatorScreenParams<MessageStackParamList>;
ProfileTab: NavigatorScreenParams<ProfileStackParamList>;
};
// ==================== 首页Stack ====================
export type HomeStackParamList = {
Home: undefined;
PostDetail: { postId: string; scrollToComments?: boolean };
Search: undefined;
UserProfile: { userId: string };
FollowList: { userId: string; type: 'following' | 'followers' };
};
// ==================== 消息Stack ====================
export type MessageStackParamList = {
MessageList: undefined;
Chat: {
conversationId: string;
userId?: string;
isGroupChat?: boolean;
groupId?: number;
groupName?: string;
};
Notifications: undefined;
CreateGroup: undefined;
JoinGroup: undefined;
GroupInfo: { groupId: number; conversationId?: string };
GroupMembers: { groupId: number };
GroupRequestDetail: { message: SystemMessageResponse };
GroupInviteDetail: { message: SystemMessageResponse };
PrivateChatInfo: {
conversationId: string;
userId: string;
userName?: string;
userAvatar?: string | null;
};
};
// ==================== 个人中心Stack ====================
export type ProfileStackParamList = {
Profile: undefined;
Settings: undefined;
EditProfile: undefined;
AccountSecurity: undefined;
MyPosts: undefined;
Bookmarks: undefined;
NotificationSettings: undefined;
BlockedUsers: undefined;
};
// ==================== 认证Stack ====================
export type AuthStackParamList = {
Login: undefined;
Register: undefined;
ForgotPassword: undefined;
};
// ==================== 根导航 ====================
export type RootStackParamList = {
Main: NavigatorScreenParams<MainTabParamList>;
Auth: undefined;
PostDetail: { postId: string; scrollToComments?: boolean };
UserProfile: { userId: string };
CreatePost: undefined;
Chat: {
conversationId: string;
userId?: string;
isGroupChat?: boolean;
groupId?: number;
groupName?: string;
};
FollowList: { userId: string; type: 'following' | 'followers' };
CreateGroup: undefined;
JoinGroup: undefined;
GroupInfo: { groupId: number; conversationId?: string };
GroupMembers: { groupId: number };
GroupRequestDetail: { message: SystemMessageResponse };
GroupInviteDetail: { message: SystemMessageResponse };
PrivateChatInfo: {
conversationId: string;
userId: string;
userName?: string;
userAvatar?: string | null;
};
};
// ==================== 全局类型声明 ====================
declare global {
namespace ReactNavigation {
interface RootParamList extends RootStackParamList {}
}
}
// ==================== 屏幕名称类型(用于路由)====================
export type HomeScreenNames = keyof HomeStackParamList;
export type MessageScreenNames = keyof MessageStackParamList;
export type ProfileScreenNames = keyof ProfileStackParamList;
export type MainTabScreenNames = keyof MainTabParamList;
export type RootScreenNames = keyof RootStackParamList;