2017-07-14 18:49:14 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { StyleSheet } from 'react-native';
|
2017-08-01 17:59:01 +00:00
|
|
|
import { globalStyle, themeStyle } from 'lib/components/global-style.js';
|
2017-07-14 18:49:14 +00:00
|
|
|
|
2017-07-31 22:03:12 +02:00
|
|
|
const styleObject_ = {
|
2017-07-14 18:49:14 +00:00
|
|
|
screen: {
|
|
|
|
flex: 1,
|
2017-07-21 22:40:02 +01:00
|
|
|
backgroundColor: globalStyle.backgroundColor,
|
2017-07-14 18:49:14 +00:00
|
|
|
},
|
2017-07-31 22:03:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
const styles_ = StyleSheet.create(styleObject_);
|
2017-07-14 18:49:14 +00:00
|
|
|
|
2017-08-01 17:59:01 +00:00
|
|
|
let rootStyles_ = {};
|
|
|
|
|
2017-07-14 18:49:14 +00:00
|
|
|
class BaseScreenComponent extends React.Component {
|
|
|
|
|
|
|
|
styles() {
|
|
|
|
return styles_;
|
|
|
|
}
|
|
|
|
|
2017-07-31 22:03:12 +02:00
|
|
|
styleObject() {
|
|
|
|
return styleObject_;
|
|
|
|
}
|
|
|
|
|
2017-08-01 17:59:01 +00:00
|
|
|
rootStyle(themeId) {
|
|
|
|
const theme = themeStyle(themeId);
|
|
|
|
if (rootStyles_[themeId]) return rootStyles_[themeId];
|
|
|
|
rootStyles_[themeId] = StyleSheet.create({
|
|
|
|
root: {
|
|
|
|
flex: 1,
|
|
|
|
backgroundColor: theme.backgroundColor,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
return rootStyles_[themeId];
|
|
|
|
}
|
|
|
|
|
2017-07-14 18:49:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export { BaseScreenComponent };
|