Composer update (react-query refactor) (#1899)

* Move composer state to a context

* Rework composer to use RQ

---------

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
Paul Frazee 2023-11-14 10:41:55 -08:00 committed by GitHub
parent c687172de9
commit 0a26e78dcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 269 additions and 239 deletions

View file

@ -44,6 +44,7 @@ import {Trans, msg} from '@lingui/macro'
import {useProfileQuery} from '#/state/queries/profile'
import {useSession} from '#/state/session'
import {useUnreadNotifications} from '#/state/queries/notifications/unread'
import {useComposerControls} from '#/state/shell/composer'
const ProfileCard = observer(function ProfileCardImpl() {
const {currentAccount} = useSession()
@ -195,6 +196,7 @@ const NavItem = observer(function NavItemImpl({
function ComposeBtn() {
const store = useStores()
const {getState} = useNavigation()
const {openComposer} = useComposerControls()
const {_} = useLingui()
const {isTablet} = useWebMediaQueries()
@ -224,7 +226,7 @@ function ComposeBtn() {
}
const onPressCompose = async () =>
store.shell.openComposer({mention: await getProfileHandle()})
openComposer({mention: await getProfileHandle()})
if (isTablet) {
return null