-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Factor our feed source model #1887
Conversation
export function useLikeMutation() { | ||
const {agent} = useSession() | ||
|
||
return useMutation({ | ||
mutationFn: async ({uri, cid}: {uri: string; cid: string}) => { | ||
const res = await agent.like(uri, cid) | ||
return {uri: res.uri} | ||
}, | ||
}) | ||
} | ||
|
||
export function useUnlikeMutation() { | ||
const {agent} = useSession() | ||
|
||
return useMutation({ | ||
mutationFn: async ({uri}: {uri: string}) => { | ||
await agent.deleteLike(uri) | ||
}, | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured some generic helpers might be good?
const res = await agent.app.bsky.feed.getSuggestedFeeds({ | ||
limit: 10, | ||
cursor: pageParam, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only return 10 right now regardless, but in the future we may actually paginate
@@ -23,7 +22,7 @@ import { | |||
} from '#/state/queries/preferences' | |||
import {useFeedSourceInfoQuery} from '#/state/queries/feed' | |||
|
|||
export const NewFeedSourceCard = observer(function FeedSourceCardImpl({ | |||
export const FeedSourceCard = observer(function FeedSourceCardImpl({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had built a new version alongside the old. Replaced last old version with new and renamed.
<FeedSourceCard | ||
feedUri={embed.record.uri} | ||
style={[pal.view, pal.border, styles.customFeedOuter]} | ||
showLikes | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Portable, only needs a URI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lookin great
No description provided.