1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/packages/app-mobile/components/base-screen.ts

24 lines
620 B
TypeScript
Raw Normal View History

import * as React from 'react';
import { StyleSheet } from 'react-native';
2020-11-05 18:58:23 +02:00
const { themeStyle } = require('./global-style.js');
2017-07-14 20:49:14 +02:00
const rootStyles_: Record<number, any> = {};
2017-08-01 19:59:01 +02:00
class BaseScreenComponent<Props, State> extends React.Component<Props, State> {
2017-07-31 22:03:12 +02:00
protected rootStyle(themeId: number) {
2017-08-01 19:59:01 +02:00
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 20:49:14 +02:00
}
export { BaseScreenComponent };
export default BaseScreenComponent;