import { Options } from '@ulangi/react-native-navigation' ; import { ScreenName } from '@ulangi/ulangi-common/enums' ; import { ObservableAtomScreen } from '@ulangi/ulangi-observable' ; import * as _ from 'lodash' ; import { observable } from 'mobx' ; import { observer } from 'mobx-react' ; import * as React from 'react' ; import { Container } from '../../Container' ; import { AtomScreenFactory } from '../../factories/atom/AtomScreenFactory' ; import { atomStyles } from '../../styles/AtomStyles' ; import { AtomScreen } from './AtomScreen' ; export interface AtomScreenPassedProps { readonly selectedCategoryNames : undefined | string [ ] ; } @ observer export class AtomScreenContainer extends Container < AtomScreenPassedProps > { public static options ( ) { return atomStyles . getScreenStyle ( ) ; } private atomScreenFactory = new AtomScreenFactory ( this . props , this . eventBus , this . observer ) ; protected observableScreen = new ObservableAtomScreen ( typeof this . props . passedProps . selectedCategoryNames !== 'undefined' ? observable . array ( this . props . passedProps . selectedCategoryNames . slice ( ) ) : undefined , this . props . componentId , ScreenName . ATOM_SCREEN ) ; private screenDelegate = this . atomScreenFactory . createScreenDelegate ( this . observableScreen ) ; protected onThemeChanged ( ) { _ . noop ( ) ; } public render ( ) { return ( < AtomScreen themeStore = { this . props . rootStore . themeStore } observableScreen = { this . observableScreen } screenDelegate = { this . screenDelegate } / > ) ; } }