import { Options } from '@ulangi/react-native-navigation' ; import { ScreenName , Theme } from '@ulangi/ulangi-common/enums' ; import { ObservableScreen } from '@ulangi/ulangi-observable' ; import { observer } from 'mobx-react' ; import * as React from 'react' ; import { Container , ContainerPassedProps } from '../../Container' ; import { LevelBreakdownScreenFactory } from '../../factories/level/LevelBreakdownScreenFactory' ; import { LevelBreakdownScreen } from './LevelBreakdownScreen' ; export interface LevelBreakdownScreenPassedProps { readonly levelCounts : { readonly totalCount : number ; readonly level0Count : number ; readonly level1To3Count : number ; readonly level4To6Count : number ; readonly level7To8Count : number ; readonly level9To10Count : number ; } ; } @ observer export class LevelBreakdownScreenContainer extends Container < LevelBreakdownScreenPassedProps > { public static options ( props ) { if ( props . theme === Theme . LIGHT ) { return props . styles ? props . styles . light : { } ; } else { return props . styles ? props . styles . dark : { } ; } } protected observableLightBox = this . props . observableLightBox ; protected observableScreen = new ObservableScreen ( this . props . componentId , ScreenName . LEVEL_BREAKDOWN_SCREEN , null ) ; private screenFactory = new LevelBreakdownScreenFactory ( this . props , this . eventBus , this . observer ) ; private navigatorDelegate = this . screenFactory . createNavigatorDelegate ( ) ; private screenDelegate = this . screenFactory . createScreenDelegate ( ) ; protected onThemeChanged ( theme ) { if ( typeof this . props . styles !== 'undefined' ) { this . navigatorDelegate . mergeOptions ( theme === Theme . LIGHT ? this . props . styles . light : this . props . styles . dark ) ; } } public render ( ) { return ( < LevelBreakdownScreen observableLightBox = { this . observableLightBox } observableScreen = { this . observableScreen } themeStore = { this . props . rootStore . themeStore } levelCounts = { this . props . passedProps . levelCounts } screenDelegate = { this . screenDelegate } / > ) ; } }