feat(chat): implement dynamic theme support in chat components
All checks were successful
Frontend CI / build-and-push-web (push) Successful in 7m31s
Frontend CI / ota-android (push) Successful in 13m19s
Frontend CI / build-android-apk (push) Successful in 1h10m3s

- Enhanced ChatHeader and ChatInput components to support dynamic theme colors, improving visual consistency across different themes.
- Updated styles in ChatScreen to utilize new dynamic styles for better responsiveness and user experience.
- Refactored styles in various profile screens to adopt a unified background color scheme and improved spacing for a cleaner layout.

This update significantly enhances the chat interface and profile settings by allowing for dynamic theming and improved visual elements.
This commit is contained in:
lafay
2026-04-02 17:55:56 +08:00
parent 72842352d9
commit e8651215f7
9 changed files with 213 additions and 245 deletions

View File

@@ -190,8 +190,7 @@ export const AccountSecurityScreen: React.FC = () => {
<>
<View style={styles.section}>
<View style={styles.sectionHeader}>
<MaterialCommunityIcons name="email-check-outline" size={18} color={colors.primary.main} />
<Text variant="caption" color={colors.text.secondary} style={styles.sectionTitle}>
<Text variant="caption" style={styles.sectionTitle}>
</Text>
</View>
@@ -206,7 +205,7 @@ export const AccountSecurityScreen: React.FC = () => {
</View>
<View style={styles.inputWrapper}>
<MaterialCommunityIcons name="email-outline" size={20} color={colors.primary.main} style={styles.inputIcon} />
<MaterialCommunityIcons name="email-outline" size={20} color={colors.text.secondary} style={styles.inputIcon} />
<TextInput
style={styles.input}
placeholder="请输入邮箱"
@@ -220,7 +219,7 @@ export const AccountSecurityScreen: React.FC = () => {
<View style={styles.codeRow}>
<View style={[styles.inputWrapper, styles.codeInput]}>
<MaterialCommunityIcons name="shield-key-outline" size={20} color={colors.primary.main} style={styles.inputIcon} />
<MaterialCommunityIcons name="shield-key-outline" size={20} color={colors.text.secondary} style={styles.inputIcon} />
<TextInput
style={styles.input}
placeholder="验证码"
@@ -260,14 +259,13 @@ export const AccountSecurityScreen: React.FC = () => {
<View style={styles.section}>
<View style={styles.sectionHeader}>
<MaterialCommunityIcons name="lock-reset" size={18} color={colors.primary.main} />
<Text variant="caption" color={colors.text.secondary} style={styles.sectionTitle}>
<Text variant="caption" style={styles.sectionTitle}>
</Text>
</View>
<View style={styles.card}>
<View style={styles.inputWrapper}>
<MaterialCommunityIcons name="lock-outline" size={20} color={colors.primary.main} style={styles.inputIcon} />
<MaterialCommunityIcons name="lock-outline" size={20} color={colors.text.secondary} style={styles.inputIcon} />
<TextInput
style={styles.input}
placeholder="当前密码"
@@ -278,7 +276,7 @@ export const AccountSecurityScreen: React.FC = () => {
/>
</View>
<View style={styles.inputWrapper}>
<MaterialCommunityIcons name="lock-plus-outline" size={20} color={colors.primary.main} style={styles.inputIcon} />
<MaterialCommunityIcons name="lock-plus-outline" size={20} color={colors.text.secondary} style={styles.inputIcon} />
<TextInput
style={styles.input}
placeholder="新密码至少6位"
@@ -290,7 +288,7 @@ export const AccountSecurityScreen: React.FC = () => {
</View>
<View style={styles.codeRow}>
<View style={[styles.inputWrapper, styles.codeInput]}>
<MaterialCommunityIcons name="shield-key-outline" size={20} color={colors.primary.main} style={styles.inputIcon} />
<MaterialCommunityIcons name="shield-key-outline" size={20} color={colors.text.secondary} style={styles.inputIcon} />
<TextInput
style={styles.input}
placeholder="邮箱验证码"
@@ -316,7 +314,7 @@ export const AccountSecurityScreen: React.FC = () => {
</TouchableOpacity>
</View>
<View style={styles.inputWrapper}>
<MaterialCommunityIcons name="lock-check-outline" size={20} color={colors.primary.main} style={styles.inputIcon} />
<MaterialCommunityIcons name="lock-check-outline" size={20} color={colors.text.secondary} style={styles.inputIcon} />
<TextInput
style={styles.input}
placeholder="确认新密码"
@@ -358,29 +356,28 @@ function createAccountSecurityStyles(colors: AppColors) {
return StyleSheet.create({
container: {
flex: 1,
backgroundColor: colors.background.default,
backgroundColor: colors.background.paper,
},
scrollContent: {
paddingVertical: spacing.md,
paddingVertical: spacing.lg,
},
section: {
marginBottom: spacing.lg,
marginBottom: spacing['2xl'],
},
sectionHeader: {
flexDirection: 'row',
alignItems: 'center',
paddingHorizontal: spacing.lg,
paddingHorizontal: spacing['2xl'],
marginBottom: spacing.sm,
gap: spacing.xs,
marginTop: spacing.sm,
},
sectionTitle: {
fontWeight: '600',
fontSize: fontSizes.sm,
color: colors.text.secondary,
textTransform: 'uppercase',
letterSpacing: 0.5,
},
card: {
backgroundColor: colors.background.paper,
marginHorizontal: spacing.lg,
borderRadius: borderRadius.lg,
padding: spacing.md,
marginHorizontal: spacing['2xl'],
maxWidth: CONTENT_MAX_WIDTH,
alignSelf: 'center',
width: '100%',
@@ -412,11 +409,9 @@ function createAccountSecurityStyles(colors: AppColors) {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: colors.background.default,
borderRadius: borderRadius.lg,
borderWidth: 1,
borderColor: colors.divider,
borderRadius: 14,
paddingHorizontal: spacing.md,
height: 48,
height: 50,
marginBottom: spacing.sm,
},
inputIcon: {
@@ -426,6 +421,7 @@ function createAccountSecurityStyles(colors: AppColors) {
flex: 1,
color: colors.text.primary,
fontSize: fontSizes.md,
height: 50,
},
codeRow: {
flexDirection: 'row',
@@ -438,9 +434,9 @@ function createAccountSecurityStyles(colors: AppColors) {
marginBottom: 0,
},
sendCodeButton: {
height: 48,
height: 50,
minWidth: 110,
borderRadius: borderRadius.lg,
borderRadius: 14,
backgroundColor: colors.primary.main,
alignItems: 'center',
justifyContent: 'center',
@@ -452,8 +448,8 @@ function createAccountSecurityStyles(colors: AppColors) {
fontWeight: '600',
},
primaryButton: {
height: 48,
borderRadius: borderRadius.lg,
height: 50,
borderRadius: 14,
backgroundColor: colors.primary.main,
alignItems: 'center',
justifyContent: 'center',
@@ -462,7 +458,7 @@ function createAccountSecurityStyles(colors: AppColors) {
primaryButtonText: {
color: colors.text.inverse,
fontSize: fontSizes.md,
fontWeight: '700',
fontWeight: '600',
},
buttonDisabled: {
opacity: 0.6,