-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More profile refactor updates (#1886)
* Update the profile avatar lightbox * Update profile editor * Add dynamic likes tab * Add dynamic feeds and lists tabs * Implement lists listing on profiles
- Loading branch information
Showing
14 changed files
with
432 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {useQuery} from '@tanstack/react-query' | ||
import {useSession} from '../session' | ||
|
||
export const RQKEY = (did: string) => ['profile-extra-info', did] | ||
|
||
/** | ||
* Fetches some additional information for the profile screen which | ||
* is not available in the API's ProfileView | ||
*/ | ||
export function useProfileExtraInfoQuery(did: string) { | ||
const {agent} = useSession() | ||
return useQuery({ | ||
queryKey: RQKEY(did), | ||
async queryFn() { | ||
const [listsRes, feedsRes] = await Promise.all([ | ||
agent.app.bsky.graph.getLists({ | ||
actor: did, | ||
limit: 1, | ||
}), | ||
agent.app.bsky.feed.getActorFeeds({ | ||
actor: did, | ||
limit: 1, | ||
}), | ||
]) | ||
return { | ||
hasLists: listsRes.data.lists.length > 0, | ||
hasFeeds: feedsRes.data.feeds.length > 0, | ||
} | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.