fix: update UI components and improve keyboard handling

- Modified the FollowFeed component to remove unnecessary wrapper classes for better layout management.
- Enhanced the EditProfileScreen by wrapping the main view in a KeyboardAvoidingView to improve keyboard interaction.
- Added keyboard handling to the EditEmailScreen for better user experience.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2025-06-12 23:41:43 +08:00
parent b69ead18e5
commit 745abec03a
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
4 changed files with 39 additions and 29 deletions

View File

@ -1,6 +1,6 @@
---
description:
globs:
globs: apps/desktop/**/*,packages/internal/components/**/*
alwaysApply: false
---
# UIKit Colors for Tailwind CSS

View File

@ -212,7 +212,7 @@ function FollowImpl(props: { feedId: string }) {
{/* Group 2 */}
<GroupedInsetListCard className="gap-y-4 p-4">
<FormProvider form={form}>
<View className="-mx-2.5">
<View>
<Controller
name="title"
control={form.control}
@ -223,13 +223,12 @@ function FollowImpl(props: { feedId: string }) {
onChangeText={onChange}
value={value}
ref={ref}
wrapperClassName="ml-2.5"
/>
)}
/>
</View>
<View className="-mx-2.5">
<View>
<Controller
name="category"
control={form.control}
@ -240,13 +239,12 @@ function FollowImpl(props: { feedId: string }) {
onChangeText={onChange}
value={value || ""}
ref={ref}
wrapperClassName="ml-2.5"
/>
)}
/>
</View>
<View className="-mx-1">
<View>
<Controller
name="isPrivate"
control={form.control}
@ -262,7 +260,7 @@ function FollowImpl(props: { feedId: string }) {
/>
</View>
<View className="-mx-4">
<View className="-mx-3">
<FormLabel className="mb-4 pl-4" label={t("subscription_form.view")} optional />
<Controller

View File

@ -6,7 +6,14 @@ import { useMutation } from "@tanstack/react-query"
import type { FC } from "react"
import { useState } from "react"
import { useTranslation } from "react-i18next"
import { Text, TextInput, TouchableOpacity, TouchableWithoutFeedback, View } from "react-native"
import {
KeyboardAvoidingView,
Text,
TextInput,
TouchableOpacity,
TouchableWithoutFeedback,
View,
} from "react-native"
import { KeyboardController } from "react-native-keyboard-controller"
import { HeaderSubmitTextButton } from "@/src/components/layouts/header/HeaderElements"
@ -61,27 +68,30 @@ export const EditProfileScreen = () => {
}
return (
<SafeNavigationScrollView
Header={
<NavigationBlurEffectHeaderView
headerRight={
<HeaderSubmitTextButton
label={t("words.save", { ns: "common" })}
isValid={Object.keys(dirtyFields).length > 0}
isLoading={isPending}
onPress={() => {
updateProfile()
}}
/>
}
title={t("profile.edit_profile")}
/>
}
className="bg-system-grouped-background"
>
<AvatarSection whoami={whoami} />
<ProfileForm whoami={whoami} dirtyFields={dirtyFields} setDirtyFields={setDirtyFields} />
</SafeNavigationScrollView>
<KeyboardAvoidingView behavior="padding" className="flex-1">
<SafeNavigationScrollView
keyboardShouldPersistTaps="handled"
Header={
<NavigationBlurEffectHeaderView
headerRight={
<HeaderSubmitTextButton
label={t("words.save", { ns: "common" })}
isValid={Object.keys(dirtyFields).length > 0}
isLoading={isPending}
onPress={() => {
updateProfile()
}}
/>
}
title={t("profile.edit_profile")}
/>
}
className="bg-system-grouped-background"
>
<AvatarSection whoami={whoami} />
<ProfileForm whoami={whoami} dirtyFields={dirtyFields} setDirtyFields={setDirtyFields} />
</SafeNavigationScrollView>
</KeyboardAvoidingView>
)
}
@ -208,6 +218,7 @@ const ProfileForm: FC<{
<GroupedInsetListCard>
<View className="flex-1">
<TextInput
clearButtonMode="always"
className="text-label h-[100px] w-full flex-1 px-4 py-3"
value={dirtyFields.bio ?? whoami?.bio ?? ""}
hitSlop={10}

View File

@ -50,6 +50,7 @@ export const EditEmailScreen: NavigationControllerView = () => {
return (
<SafeNavigationScrollView
keyboardShouldPersistTaps="handled"
Header={
<NavigationBlurEffectHeaderView
title={t("profile.edit_email")}