From ef4c864e0f4bbf5fa3f7acee46876f61e12b2921 Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 13 Mar 2025 23:33:00 +0800 Subject: [PATCH] refactor(mobile): enhance RSSHub form layout and keyboard handling - Wrapped the main content in a `KeyboardAvoidingView` to improve keyboard handling on mobile devices. - Cleaned up the structure of the form by removing unnecessary nesting and ensuring consistent formatting. - Maintained existing functionality while improving the overall user experience in the RSSHub form. Signed-off-by: Innei --- .../src/screens/(modal)/rsshub-form.tsx | 169 +++++++++--------- 1 file changed, 84 insertions(+), 85 deletions(-) diff --git a/apps/mobile/src/screens/(modal)/rsshub-form.tsx b/apps/mobile/src/screens/(modal)/rsshub-form.tsx index 51a06ac25..f097c0b48 100644 --- a/apps/mobile/src/screens/(modal)/rsshub-form.tsx +++ b/apps/mobile/src/screens/(modal)/rsshub-form.tsx @@ -114,96 +114,95 @@ function FormImpl({ route, routePrefix, name }: RsshubFormParams) { return ( - - - {keys.length === 0 && ( - - This feed has no parameters. - - )} - {keys.length > 0 && ( - - {keys.map((keyItem) => { - const parameters = normalizeRSSHubParameters(route.parameters[keyItem.name]!) + + + + {keys.length === 0 && ( + + This feed has no parameters. + + )} + {keys.length > 0 && ( + + {keys.map((keyItem) => { + const parameters = normalizeRSSHubParameters(route.parameters[keyItem.name]!) - return ( - - {!parameters?.options && ( - { - // return dynamicFormSchema.safeParse({ - // [keyItem.name]: value, - // }).success - // }, - }} - render={({ field: { onChange, onBlur, ref, value } }) => ( - - + {!parameters?.options && ( + { + // return dynamicFormSchema.safeParse({ + // [keyItem.name]: value, + // }).success + // }, + }} + render={({ field: { onChange, onBlur, ref, value } }) => ( + + + + )} + /> + )} + + {!!parameters?.options && ( + ( + - )} - /> - )} + {!!parameters && ( + + {parameters.description} + + )} + + ) + })} + + )} + - {!!parameters && ( - - {parameters.description} - - )} - - ) - })} - - )} - - - {!!route.description && ( - - - - )} - + {!!route.description && ( + + + + )} + + )