[lib] introduce useJoinCommunity
Summary:
Move diff. This diff introduces useJoinCommunity. useJoinCommunity factors out the shared logic between joining a community through accepting an invite link and joining a community through the auto join community handler. Subsequent diffs will handle making useJoinCommunity more agnostic so that the hook can be used at both callsites
Depends on D12702
Test Plan: flow + confirmed that there were no regressions with the joining a community through accepitng an invite link user flow
Reviewers: ashoat, inka
Reviewed By: ashoat
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D12706