diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-14 10:41:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 10:41:55 -0800 |
commit | 0a26e78dcbbf48dad5daae73b210e236d706b22c (patch) | |
tree | c06c737ed49e8294bf5cbec1a75c36b591cb6669 /src/state/models/ui/shell.ts | |
parent | c687172de96bd6aa85d3aa025c2e0f024640f345 (diff) | |
download | voidsky-0a26e78dcbbf48dad5daae73b210e236d706b22c.tar.zst |
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>
Diffstat (limited to 'src/state/models/ui/shell.ts')
-rw-r--r-- | src/state/models/ui/shell.ts | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/src/state/models/ui/shell.ts b/src/state/models/ui/shell.ts index 9ce9b6635..310d4f0f9 100644 --- a/src/state/models/ui/shell.ts +++ b/src/state/models/ui/shell.ts @@ -1,4 +1,4 @@ -import {AppBskyEmbedRecord, AppBskyActorDefs} from '@atproto/api' +import {AppBskyActorDefs} from '@atproto/api' import {RootStoreModel} from '../root-store' import {makeAutoObservable, runInAction} from 'mobx' import { @@ -37,41 +37,9 @@ export class ImagesLightbox implements LightboxModel { } } -export interface ComposerOptsPostRef { - uri: string - cid: string - text: string - author: { - handle: string - displayName?: string - avatar?: string - } -} -export interface ComposerOptsQuote { - uri: string - cid: string - text: string - indexedAt: string - author: { - did: string - handle: string - displayName?: string - avatar?: string - } - embeds?: AppBskyEmbedRecord.ViewRecord['embeds'] -} -export interface ComposerOpts { - replyTo?: ComposerOptsPostRef - onPost?: () => void - quote?: ComposerOptsQuote - mention?: string // handle of user to mention -} - export class ShellUiModel { isLightboxActive = false activeLightbox: ProfileImageLightbox | ImagesLightbox | null = null - isComposerActive = false - composerOpts: ComposerOpts | undefined tickEveryMinute = Date.now() constructor(public rootStore: RootStoreModel) { @@ -92,10 +60,6 @@ export class ShellUiModel { this.closeLightbox() return true } - if (this.isComposerActive) { - this.closeComposer() - return true - } return false } @@ -106,9 +70,6 @@ export class ShellUiModel { if (this.isLightboxActive) { this.closeLightbox() } - if (this.isComposerActive) { - this.closeComposer() - } } openLightbox(lightbox: ProfileImageLightbox | ImagesLightbox) { @@ -122,17 +83,6 @@ export class ShellUiModel { this.activeLightbox = null } - openComposer(opts: ComposerOpts) { - this.rootStore.emitNavigation() - this.isComposerActive = true - this.composerOpts = opts - } - - closeComposer() { - this.isComposerActive = false - this.composerOpts = undefined - } - setupClock() { setInterval(() => { runInAction(() => { |