@@ -27,6 +27,7 @@ import { useNavigation } from "@/src/lib/navigation/hooks"
27
27
import { useSetModalScreenOptions } from "@/src/lib/navigation/ScreenOptionsContext"
28
28
import type { NavigationControllerView } from "@/src/lib/navigation/types"
29
29
import { toast } from "@/src/lib/toast"
30
+ import { FeedSummary } from "@/src/modules/discover/FeedSummary"
30
31
31
32
import { FollowScreen } from "./FollowScreen"
32
33
@@ -64,23 +65,8 @@ export const RsshubFormScreen: NavigationControllerView<RsshubFormParams> = ({
64
65
}
65
66
66
67
function FormImpl ( { route, routePrefix, name } : RsshubFormParams ) {
67
- const { name : routeName } = route
68
- const keys = useMemo (
69
- ( ) =>
70
- parseRegexpPathParams ( route . path , {
71
- excludeNames : [
72
- "routeParams" ,
73
- "functionalFlag" ,
74
- "fulltext" ,
75
- "disableEmbed" ,
76
- "date" ,
77
- "language" ,
78
- "lang" ,
79
- "sort" ,
80
- ] ,
81
- } ) ,
82
- [ route . path ] ,
83
- )
68
+ const { name : routeName , topFeeds } = route
69
+ const keys = useMemo ( ( ) => parseRegexpPathParams ( route . path ) , [ route . path ] )
84
70
85
71
const formPlaceholder = useMemo < Record < string , string > > ( ( ) => {
86
72
if ( ! route . example ) return { }
@@ -119,6 +105,16 @@ function FormImpl({ route, routePrefix, name }: RsshubFormParams) {
119
105
// eslint-disable-next-line unicorn/prefer-structured-clone
120
106
const nextErrors = JSON . parse ( JSON . stringify ( form . formState . errors ) )
121
107
108
+ const data = form . watch ( ) as Record < string , string | undefined >
109
+ const fullPath = useMemo ( ( ) => {
110
+ try {
111
+ return regexpPathToPath ( route . path , data )
112
+ } catch ( err : unknown ) {
113
+ console . info ( ( err as Error ) . message )
114
+ return route . path
115
+ }
116
+ } , [ route . path , data ] )
117
+
122
118
return (
123
119
< FormProvider form = { form } >
124
120
< PortalProvider >
@@ -131,13 +127,16 @@ function FormImpl({ route, routePrefix, name }: RsshubFormParams) {
131
127
routePrefix = { routePrefix }
132
128
errors = { nextErrors }
133
129
/>
130
+ < Text className = "text-secondary-label mx-4 mt-2 text-center text-sm" >
131
+ { `rsshub://${ routePrefix } ${ fullPath } ` }
132
+ </ Text >
134
133
{ keys . length === 0 && (
135
- < View className = "bg-secondary-system-grouped-background mx-2 mt-2 gap-4 rounded-lg p-3" >
134
+ < View className = "bg-secondary-system-grouped-background mx-2 mt-4 gap-4 rounded-lg p-3" >
136
135
< Text className = "text-center text-base" > This feed has no parameters.</ Text >
137
136
</ View >
138
137
) }
139
138
{ keys . length > 0 && (
140
- < View className = "bg-secondary-system-grouped-background mx-2 mt-2 gap-4 rounded-lg px-3 py-6 " >
139
+ < View className = "bg-secondary-system-grouped-background mx-4 mt-4 gap-5 rounded-[10px] px-4 py-5 " >
141
140
{ keys . map ( ( keyItem ) => {
142
141
const parameters = normalizeRSSHubParameters ( route . parameters [ keyItem . name ] ! )
143
142
@@ -198,10 +197,17 @@ function FormImpl({ route, routePrefix, name }: RsshubFormParams) {
198
197
} ) }
199
198
</ View >
200
199
) }
200
+ { ! ! topFeeds ?. length && (
201
+ < View className = "bg-secondary-system-grouped-background mx-4 mt-4 rounded-[10px] py-1" >
202
+ { topFeeds . map ( ( feed ) => (
203
+ < FeedSummary key = { feed . id } item = { { feed } } simple className = "px-4 py-2" />
204
+ ) ) }
205
+ </ View >
206
+ ) }
201
207
< Maintainers maintainers = { route . maintainers } />
202
208
203
209
{ ! ! route . description && (
204
- < View className = "mt-4 flex-1 p-4 " >
210
+ < View className = "mt-6 flex-1 px-8 " >
205
211
< MarkdownNative value = { route . description . replaceAll ( ":::" , "" ) } />
206
212
</ View >
207
213
) }
@@ -218,7 +224,7 @@ const Maintainers = ({ maintainers }: { maintainers?: string[] }) => {
218
224
}
219
225
220
226
return (
221
- < View className = "text-tertiary-label mx-4 mt-2 flex flex-row flex-wrap gap-x-1 text-sm" >
227
+ < View className = "text-tertiary-label mx-8 mt-4 flex flex-row flex-wrap gap-x-1 text-sm" >
222
228
< Text className = "text-secondary-label text-xs" >
223
229
This feed is provided by RSSHub, with credit to{ " " }
224
230
</ Text >
0 commit comments