Skip to content
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

Merged
merged 10 commits into from
Nov 13, 2023
Merged

Factor our feed source model #1887

merged 10 commits into from
Nov 13, 2023

Conversation

estrattonbailey
Copy link
Member

No description provided.

Comment on lines +5 to +24
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)
},
})
}
Copy link
Member Author

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?

Comment on lines +20 to +23
const res = await agent.app.bsky.feed.getSuggestedFeeds({
limit: 10,
cursor: pageParam,
})
Copy link
Member Author

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({
Copy link
Member Author

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.

Comment on lines +76 to +80
<FeedSourceCard
feedUri={embed.record.uri}
style={[pal.view, pal.border, styles.customFeedOuter]}
showLikes
/>
Copy link
Member Author

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

Copy link
Collaborator

@pfrazee pfrazee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lookin great

@pfrazee pfrazee merged commit 06eb8b9 into main Nov 13, 2023
3 of 4 checks passed
@pfrazee pfrazee deleted the eric/feed-source-model branch November 13, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants