diff --git a/apps/mobile/src/components/common/HeaderTitleExtra.tsx b/apps/mobile/src/components/common/HeaderTitleExtra.tsx new file mode 100644 index 000000000..6ab1ea797 --- /dev/null +++ b/apps/mobile/src/components/common/HeaderTitleExtra.tsx @@ -0,0 +1,61 @@ +import { cn } from "@follow/utils" +import { useTheme } from "@react-navigation/native" +import type { StyleProp, TextProps, TextStyle } from "react-native" +import { Animated, Platform, StyleSheet, Text, View } from "react-native" + +type Props = Omit & { + tintColor?: string + children?: string + style?: Animated.WithAnimatedValue> + subText?: string + subTextStyle?: StyleProp + subTextClassName?: string +} + +export function HeaderTitleExtra({ + tintColor, + style, + subText, + subTextStyle, + subTextClassName, + ...rest +}: Props) { + const { colors, fonts } = useTheme() + + return ( + + + + {subText} + + + ) +} + +const styles = StyleSheet.create({ + title: Platform.select({ + ios: { + fontSize: 17, + }, + android: { + fontSize: 20, + }, + default: { + fontSize: 18, + }, + }), +}) diff --git a/apps/mobile/src/screens/(modal)/rsshub-form.tsx b/apps/mobile/src/screens/(modal)/rsshub-form.tsx index 466f22743..0e69c7ce2 100644 --- a/apps/mobile/src/screens/(modal)/rsshub-form.tsx +++ b/apps/mobile/src/screens/(modal)/rsshub-form.tsx @@ -9,6 +9,7 @@ import { Linking, Text, TouchableOpacity, View } from "react-native" import { KeyboardAwareScrollView } from "react-native-keyboard-controller" import { z } from "zod" +import { HeaderTitleExtra } from "@/src/components/common/HeaderTitleExtra" import { ModalHeaderCloseButton } from "@/src/components/common/ModalSharedComponents" import { FormProvider, useFormContext } from "@/src/components/ui/form/FormProvider" import { FormLabel } from "@/src/components/ui/form/Label" @@ -16,7 +17,6 @@ import { Select } from "@/src/components/ui/form/Select" import { TextField } from "@/src/components/ui/form/TextField" import MarkdownWeb from "@/src/components/ui/typography/MarkdownWeb" import { CheckLineIcon } from "@/src/icons/check_line" -import { PreviewUrl } from "@/src/modules/rsshub/preview-url" import { useColor } from "@/src/theme/colors" interface RsshubFormParams { @@ -105,18 +105,15 @@ function FormImpl({ route, routePrefix, name }: RsshubFormParams) { return ( - + - - {/* Form */} - {keys.map((keyItem) => { const parameters = normalizeRSSHubParameters(route.parameters[keyItem.name]) @@ -211,7 +208,13 @@ const normalizeRSSHubParameters = (parameters: RSSHubParameter): RSSHubParameter : parameters : null -const ScreenOptions = memo(({ name, routeName }: { name: string; routeName: string }) => { +type ScreenOptionsProps = { + name: string + routeName: string + route: string + routePrefix: string +} +const ScreenOptions = memo(({ name, routeName, route, routePrefix }: ScreenOptionsProps) => { const form = useFormContext() return ( @@ -223,12 +226,23 @@ const ScreenOptions = memo(({ name, routeName }: { name: string; routeName: stri ), - headerTitle: `${name} - ${routeName}`, + + headerTitle: () => ( + + ), }} /> ) }) +const Title = ({ name, routeName, route, routePrefix }: ScreenOptionsProps) => { + return ( + <HeaderTitleExtra subText={`rsshub://${routePrefix}${route}`}> + {`${name} - ${routeName}`} + </HeaderTitleExtra> + ) +} + const ModalHeaderSubmitButton = () => { return <ModalHeaderSubmitButtonImpl /> }