feat: list api in subscription modal
This commit is contained in:
parent
0454747762
commit
46e246aa17
|
|
@ -12,14 +12,29 @@ export const usePresentFeedFormModal = () => {
|
|||
const me = useWhoami()
|
||||
const t = useI18n()
|
||||
return useCallback(
|
||||
(feedId: string) => {
|
||||
(
|
||||
params:
|
||||
| {
|
||||
feedId: string
|
||||
}
|
||||
| {
|
||||
listId: string
|
||||
},
|
||||
) => {
|
||||
if (me) {
|
||||
present({
|
||||
title: t("sidebar.feed_actions.edit_feed"),
|
||||
content: ({ dismiss }) => <FeedForm asWidget id={feedId} onSuccess={dismiss} />,
|
||||
content: ({ dismiss }) => (
|
||||
<FeedForm
|
||||
asWidget
|
||||
id={"feedId" in params ? params.feedId : params.listId}
|
||||
isList={!!("listId" in params)}
|
||||
onSuccess={dismiss}
|
||||
/>
|
||||
),
|
||||
})
|
||||
} else {
|
||||
window.location.href = `${DEEPLINK_SCHEME}add?id=${feedId}`
|
||||
window.location.href = `${DEEPLINK_SCHEME}add?id=${"feedId" in params ? params.feedId : params.listId}`
|
||||
}
|
||||
},
|
||||
[me, present, t],
|
||||
|
|
|
|||
|
|
@ -117,7 +117,9 @@ export function Component() {
|
|||
)}
|
||||
<Button
|
||||
onClick={() => {
|
||||
presentFeedFormModal(id!)
|
||||
presentFeedFormModal({
|
||||
feedId: id!,
|
||||
})
|
||||
}}
|
||||
>
|
||||
<FollowIcon className="mr-1 size-3" />
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ export function Component() {
|
|||
<span className="center mb-8 flex gap-4">
|
||||
<Button
|
||||
onClick={() => {
|
||||
presentFeedFormModal(id!)
|
||||
presentFeedFormModal({
|
||||
listId: id!,
|
||||
})
|
||||
}}
|
||||
>
|
||||
<FollowIcon className="mr-1 size-3" />
|
||||
|
|
|
|||
|
|
@ -106,7 +106,9 @@ export function Component() {
|
|||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
|
||||
presentFeedFormModal(subscription.feedId)
|
||||
presentFeedFormModal({
|
||||
feedId: subscription.feedId,
|
||||
})
|
||||
}}
|
||||
>
|
||||
{isMe ? (
|
||||
|
|
|
|||
Loading…
Reference in New Issue