2019-07-29 15:43:53 +02:00
|
|
|
const React = require('react');
|
2017-11-03 00:09:34 +00:00
|
|
|
const { StyleSheet } = require('react-native');
|
2020-11-05 16:58:23 +00:00
|
|
|
const { themeStyle } = require('./global-style.js');
|
2017-07-14 18:49:14 +00:00
|
|
|
|
2020-03-13 23:46:14 +00:00
|
|
|
const rootStyles_ = {};
|
2017-08-01 17:59:01 +00:00
|
|
|
|
2017-07-14 18:49:14 +00:00
|
|
|
class BaseScreenComponent extends React.Component {
|
2017-07-31 22:03:12 +02:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-07-29 15:43:53 +02:00
|
|
|
module.exports = { BaseScreenComponent };
|