Add scene creator
This commit is contained in:
parent
93b64cf474
commit
e7536289cb
18 changed files with 281 additions and 23 deletions
|
@ -9,14 +9,14 @@ import {createContext, useContext} from 'react'
|
|||
import {isObj, hasProp} from '../lib/type-guards'
|
||||
import {SessionModel} from './session'
|
||||
import {NavigationModel} from './navigation'
|
||||
import {ShellModel} from './shell'
|
||||
import {ShellUiModel} from './shell-ui'
|
||||
import {MeModel} from './me'
|
||||
import {OnboardModel} from './onboard'
|
||||
|
||||
export class RootStoreModel {
|
||||
session = new SessionModel(this)
|
||||
nav = new NavigationModel()
|
||||
shell = new ShellModel()
|
||||
shell = new ShellUiModel()
|
||||
me = new MeModel(this)
|
||||
onboard = new OnboardModel()
|
||||
|
||||
|
|
|
@ -35,14 +35,27 @@ export class EditProfileModel {
|
|||
}
|
||||
}
|
||||
|
||||
export class CreateSceneModel {
|
||||
name = 'create-scene'
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this)
|
||||
}
|
||||
}
|
||||
|
||||
export interface ComposerOpts {
|
||||
replyTo?: Post.PostRef
|
||||
onPost?: () => void
|
||||
}
|
||||
|
||||
export class ShellModel {
|
||||
export class ShellUiModel {
|
||||
isModalActive = false
|
||||
activeModal: LinkActionsModel | SharePostModel | EditProfileModel | undefined
|
||||
activeModal:
|
||||
| LinkActionsModel
|
||||
| SharePostModel
|
||||
| EditProfileModel
|
||||
| CreateSceneModel
|
||||
| undefined
|
||||
isComposerActive = false
|
||||
composerOpts: ComposerOpts | undefined
|
||||
|
||||
|
@ -50,7 +63,13 @@ export class ShellModel {
|
|||
makeAutoObservable(this)
|
||||
}
|
||||
|
||||
openModal(modal: LinkActionsModel | SharePostModel | EditProfileModel) {
|
||||
openModal(
|
||||
modal:
|
||||
| LinkActionsModel
|
||||
| SharePostModel
|
||||
| EditProfileModel
|
||||
| CreateSceneModel,
|
||||
) {
|
||||
this.isModalActive = true
|
||||
this.activeModal = modal
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue