Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 38 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 100% |
Changes | 0 |
1 | import React from 'react'; |
||
2 | import {ILanguageSetup} from '../Language/ChangeLanguageSetup'; |
||
3 | import Container from './Container'; |
||
4 | import ApplicationModel from './Model/ApplicationModel'; |
||
5 | import ApplicationView from './View/ApplicationView'; |
||
6 | |||
7 | interface IProperties { |
||
8 | } |
||
9 | |||
10 | interface IState { |
||
11 | loadedLanguage: string |
||
12 | } |
||
13 | |||
14 | 1 | export default class Application extends React.Component<IProperties, IState> { |
|
15 | constructor(props: IProperties) { |
||
16 | 1 | super(props); |
|
17 | |||
18 | this.state = { |
||
19 | loadedLanguage: '' |
||
20 | }; |
||
21 | |||
22 | Container.language.setupAdapter.addListener(this.onLanguageLoaded.bind(this)); |
||
23 | } |
||
24 | |||
25 | componentDidMount(): void { |
||
26 | Container.language.changeLanguageSetup.interact({languageCode: 'de-de'}, {}).then(); |
||
27 | } |
||
28 | |||
29 | onLanguageLoaded(oldValue: ILanguageSetup, newValue: ILanguageSetup) { |
||
30 | this.setState({loadedLanguage: newValue.languageCode}) |
||
31 | } |
||
32 | |||
33 | render(): React.ReactNode { |
||
34 | const model: ApplicationModel = Container.applicationPresenter.present('Application'); |
||
35 | |||
36 | return <ApplicationView model={model} /> |
||
37 | } |
||
38 | } |