refactor(home): redesign home screen with sort bar and add recommendation feed
- Replace PagerView-based tabs with modern sort bar navigation - Add "推荐" (recommended) feed option with "hot" sort type - Update tab icons and labels to match new sort paradigm - Optimize PostCard, MessageBubble conditional styles perf(chat): migrate FlatList to FlashList for emoji/sticker panels - Improve virtualized rendering performance for emoji and sticker grids - Fix jump-to-latest scroll behavior for inverted FlashList perf(profile): extract user header and tab bar into separate memoized renders - Prevent unnecessary re-renders when switching tabs feat(api): add channel_id filter support for post queries - Include channel_id in cursor pagination requests - Update CursorPaginationRequest type definition style(chat-info): redesign group and private chat info screens with flat layout - Remove card borders and shadows for cleaner appearance - Adjust avatar sizes and spacing for consistency
This commit is contained in:
@@ -608,12 +608,12 @@ const GroupInfoScreen: React.FC = () => {
|
||||
contentContainerStyle={styles.scrollContent}
|
||||
showsVerticalScrollIndicator={false}
|
||||
>
|
||||
{/* 群组基本信息卡片 */}
|
||||
{/* 群组基本信息 */}
|
||||
<View style={styles.headerCard}>
|
||||
<View style={styles.groupHeader}>
|
||||
<Avatar
|
||||
source={group.avatar}
|
||||
size={90}
|
||||
size={80}
|
||||
name={group.name}
|
||||
/>
|
||||
<View style={styles.groupInfo}>
|
||||
@@ -621,7 +621,7 @@ const GroupInfoScreen: React.FC = () => {
|
||||
{group.name}
|
||||
</Text>
|
||||
<View style={styles.groupMeta}>
|
||||
<MaterialCommunityIcons name="account-group" size={16} color={colors.text.secondary} />
|
||||
<MaterialCommunityIcons name="account-group" size={14} color={colors.text.secondary} />
|
||||
<Text variant="caption" color={colors.text.secondary}>
|
||||
{group.member_count} 人
|
||||
</Text>
|
||||
@@ -661,7 +661,7 @@ const GroupInfoScreen: React.FC = () => {
|
||||
)}
|
||||
</View>
|
||||
|
||||
{/* 群公告卡片 */}
|
||||
{/* 群公告 */}
|
||||
{announcements.length > 0 && (
|
||||
<View style={styles.card}>
|
||||
<View style={styles.cardHeader}>
|
||||
@@ -684,7 +684,7 @@ const GroupInfoScreen: React.FC = () => {
|
||||
</View>
|
||||
)}
|
||||
|
||||
{/* 成员预览卡片 */}
|
||||
{/* 成员预览 */}
|
||||
<View style={styles.card}>
|
||||
<TouchableOpacity style={styles.cardHeader} onPress={goToMembers} activeOpacity={0.7}>
|
||||
<View style={styles.cardIconContainer}>
|
||||
@@ -813,6 +813,7 @@ const GroupInfoScreen: React.FC = () => {
|
||||
thumbColor={isPinned ? colors.primary.main : colors.background.paper}
|
||||
/>
|
||||
</View>
|
||||
<Divider style={styles.settingDivider} />
|
||||
<View style={styles.settingItem}>
|
||||
<View style={styles.settingIconContainer}>
|
||||
<MaterialCommunityIcons name="bell-off-outline" size={20} color={colors.primary.main} />
|
||||
@@ -1126,22 +1127,20 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
return StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: colors.background.default,
|
||||
backgroundColor: colors.background.paper,
|
||||
},
|
||||
pageHeader: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
paddingHorizontal: spacing.md,
|
||||
paddingHorizontal: spacing.lg,
|
||||
paddingVertical: spacing.md,
|
||||
backgroundColor: colors.background.paper,
|
||||
borderBottomWidth: 0.5,
|
||||
borderBottomColor: colors.divider + '60',
|
||||
borderBottomWidth: 0,
|
||||
},
|
||||
pageTitle: {
|
||||
fontWeight: '700',
|
||||
fontWeight: '600',
|
||||
fontSize: fontSizes.xl,
|
||||
letterSpacing: 0.5,
|
||||
},
|
||||
pageHeaderPlaceholder: {
|
||||
width: 40,
|
||||
@@ -1151,7 +1150,7 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
flex: 1,
|
||||
},
|
||||
scrollContent: {
|
||||
padding: spacing.md,
|
||||
paddingHorizontal: spacing.lg,
|
||||
paddingBottom: spacing.xl * 2,
|
||||
},
|
||||
errorContainer: {
|
||||
@@ -1160,29 +1159,25 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
alignItems: 'center',
|
||||
},
|
||||
|
||||
// 头部卡片样式 - 扁平化设计
|
||||
// 头部区域 - 扁平化无卡片
|
||||
headerCard: {
|
||||
backgroundColor: colors.background.paper,
|
||||
borderRadius: borderRadius.xl,
|
||||
padding: spacing.lg,
|
||||
paddingVertical: spacing.lg,
|
||||
marginBottom: spacing.md,
|
||||
borderWidth: 0.5,
|
||||
borderColor: colors.divider + '40',
|
||||
},
|
||||
groupHeader: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginBottom: spacing.md,
|
||||
marginBottom: spacing.lg,
|
||||
},
|
||||
groupInfo: {
|
||||
marginLeft: spacing.lg,
|
||||
flex: 1,
|
||||
},
|
||||
groupName: {
|
||||
fontWeight: '800',
|
||||
fontSize: fontSizes.xl + 2,
|
||||
fontWeight: '700',
|
||||
fontSize: fontSizes['2xl'],
|
||||
marginBottom: spacing.xs,
|
||||
letterSpacing: 0.3,
|
||||
},
|
||||
groupMeta: {
|
||||
flexDirection: 'row',
|
||||
@@ -1213,8 +1208,6 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
backgroundColor: colors.background.default,
|
||||
borderRadius: borderRadius.lg,
|
||||
padding: spacing.md,
|
||||
borderWidth: 0.5,
|
||||
borderColor: colors.divider + '30',
|
||||
},
|
||||
groupDesc: {
|
||||
marginLeft: spacing.sm,
|
||||
@@ -1223,19 +1216,16 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
fontWeight: '400',
|
||||
},
|
||||
|
||||
// 通用卡片样式 - 扁平化
|
||||
// 通用卡片样式 - 扁平化:无阴影无圆角,使用分割线
|
||||
card: {
|
||||
backgroundColor: colors.background.paper,
|
||||
borderRadius: borderRadius.xl,
|
||||
padding: spacing.lg,
|
||||
marginBottom: spacing.md,
|
||||
borderWidth: 0.5,
|
||||
borderColor: colors.divider + '40',
|
||||
},
|
||||
cardHeader: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginBottom: spacing.md,
|
||||
paddingTop: spacing.sm,
|
||||
},
|
||||
cardIconContainer: {
|
||||
width: 36,
|
||||
@@ -1247,13 +1237,12 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
marginRight: spacing.sm,
|
||||
},
|
||||
cardTitle: {
|
||||
fontWeight: '700',
|
||||
fontSize: fontSizes.md + 1,
|
||||
fontWeight: '600',
|
||||
fontSize: fontSizes.md,
|
||||
flex: 1,
|
||||
letterSpacing: 0.3,
|
||||
},
|
||||
|
||||
// 公告样式 - 更现代的卡片
|
||||
// 公告样式 - 扁平化
|
||||
announcementContent: {
|
||||
backgroundColor: colors.warning.light + '08',
|
||||
borderRadius: borderRadius.lg,
|
||||
@@ -1324,7 +1313,7 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
fontSize: fontSizes.sm,
|
||||
},
|
||||
|
||||
// 邀请按钮样式 - 更加醒目
|
||||
// 邀请按钮样式 - 扁平化
|
||||
inviteButton: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
@@ -1348,25 +1337,23 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
inviteButtonText: {
|
||||
fontWeight: '700',
|
||||
marginRight: spacing.xs,
|
||||
letterSpacing: 0.3,
|
||||
},
|
||||
|
||||
// 设置项样式 - 更加扁平
|
||||
// 设置项样式 - 扁平化:无圆角背景,简洁分割线
|
||||
settingsList: {
|
||||
marginTop: spacing.sm,
|
||||
marginTop: 0,
|
||||
},
|
||||
settingItem: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
paddingVertical: spacing.md,
|
||||
borderRadius: borderRadius.md,
|
||||
paddingHorizontal: spacing.sm,
|
||||
marginLeft: -spacing.sm,
|
||||
marginRight: -spacing.sm,
|
||||
paddingHorizontal: 0,
|
||||
marginLeft: 0,
|
||||
marginRight: 0,
|
||||
},
|
||||
settingIconContainer: {
|
||||
width: 40,
|
||||
height: 40,
|
||||
width: 36,
|
||||
height: 36,
|
||||
borderRadius: borderRadius.md,
|
||||
backgroundColor: colors.background.default,
|
||||
justifyContent: 'center',
|
||||
@@ -1384,18 +1371,16 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
fontWeight: '600',
|
||||
},
|
||||
settingDivider: {
|
||||
marginLeft: 56,
|
||||
marginLeft: 52,
|
||||
width: 'auto',
|
||||
marginVertical: spacing.xs,
|
||||
marginVertical: 0,
|
||||
opacity: 0.5,
|
||||
},
|
||||
|
||||
// 危险操作卡片 - 更加醒目
|
||||
// 危险操作区域 - 扁平化
|
||||
dangerCard: {
|
||||
padding: 0,
|
||||
overflow: 'hidden',
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: colors.error.light + '30',
|
||||
marginTop: spacing.sm,
|
||||
},
|
||||
dangerButton: {
|
||||
@@ -1404,14 +1389,12 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
justifyContent: 'center',
|
||||
paddingVertical: spacing.lg,
|
||||
gap: spacing.sm,
|
||||
backgroundColor: colors.error.light + '08',
|
||||
},
|
||||
dangerButtonText: {
|
||||
fontWeight: '700',
|
||||
letterSpacing: 0.3,
|
||||
fontWeight: '600',
|
||||
},
|
||||
|
||||
// 模态框样式 - 更现代
|
||||
// 模态框样式 - 扁平化
|
||||
modalOverlay: {
|
||||
flex: 1,
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.45)',
|
||||
@@ -1440,20 +1423,18 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
minWidth: 60,
|
||||
},
|
||||
modalTitle: {
|
||||
fontWeight: '800',
|
||||
fontSize: fontSizes.xl + 1,
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: '700',
|
||||
fontSize: fontSizes.xl,
|
||||
},
|
||||
saveButton: {
|
||||
fontWeight: '700',
|
||||
letterSpacing: 0.3,
|
||||
fontWeight: '600',
|
||||
},
|
||||
confirmButton: {
|
||||
fontWeight: '700',
|
||||
fontWeight: '600',
|
||||
textAlign: 'right',
|
||||
},
|
||||
|
||||
// 编辑表单样式 - 更现代
|
||||
// 编辑表单样式 - 扁平化
|
||||
editForm: {
|
||||
alignItems: 'center',
|
||||
},
|
||||
@@ -1465,7 +1446,7 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
width: 90,
|
||||
height: 90,
|
||||
borderRadius: 45,
|
||||
borderWidth: 3,
|
||||
borderWidth: 2,
|
||||
borderColor: colors.primary.light + '40',
|
||||
},
|
||||
editAvatarPlaceholder: {
|
||||
@@ -1496,9 +1477,8 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
},
|
||||
editLabel: {
|
||||
marginBottom: spacing.sm,
|
||||
fontWeight: '700',
|
||||
fontSize: fontSizes.sm + 1,
|
||||
letterSpacing: 0.3,
|
||||
fontWeight: '600',
|
||||
fontSize: fontSizes.sm,
|
||||
},
|
||||
editInput: {
|
||||
backgroundColor: colors.background.default,
|
||||
@@ -1507,7 +1487,7 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
paddingVertical: spacing.md,
|
||||
fontSize: fontSizes.md,
|
||||
color: colors.text.primary,
|
||||
borderWidth: 1.5,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.divider + '80',
|
||||
fontWeight: '400',
|
||||
},
|
||||
@@ -1533,7 +1513,7 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
padding: spacing.md,
|
||||
fontSize: fontSizes.md,
|
||||
color: colors.text.primary,
|
||||
borderWidth: 1.5,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.divider + '80',
|
||||
lineHeight: 22,
|
||||
textAlignVertical: 'top',
|
||||
@@ -1553,14 +1533,14 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
alignItems: 'center',
|
||||
padding: spacing.md,
|
||||
borderRadius: borderRadius.lg,
|
||||
borderWidth: 1.5,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.divider + '80',
|
||||
backgroundColor: colors.background.default,
|
||||
},
|
||||
joinTypeItemSelected: {
|
||||
borderColor: colors.primary.main,
|
||||
backgroundColor: colors.primary.light + '12',
|
||||
borderWidth: 2,
|
||||
borderWidth: 1.5,
|
||||
},
|
||||
joinTypeIcon: {
|
||||
width: 48,
|
||||
@@ -1602,7 +1582,7 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
},
|
||||
transferItemSelected: {
|
||||
backgroundColor: colors.primary.light + '12',
|
||||
borderWidth: 1.5,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.primary.light + '60',
|
||||
},
|
||||
transferItemInfo: {
|
||||
@@ -1681,7 +1661,7 @@ function createGroupInfoStyles(colors: AppColors) {
|
||||
},
|
||||
friendItemSelected: {
|
||||
backgroundColor: colors.primary.light + '12',
|
||||
borderWidth: 1.5,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.primary.light + '60',
|
||||
},
|
||||
friendInfo: {
|
||||
|
||||
Reference in New Issue
Block a user