mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-30 08:26:59 +02:00
22 lines
663 B
TypeScript
22 lines
663 B
TypeScript
import * as React from 'react';
|
|
import { StyleSheet } from 'react-native';
|
|
import { themeStyle } from './global-style';
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
|
const rootStyles_: Record<number, any> = {};
|
|
|
|
class BaseScreenComponent<Props, State> extends React.Component<Props, State> {
|
|
|
|
protected rootStyle(themeId: number) {
|
|
const theme = themeStyle(themeId);
|
|
if (rootStyles_[themeId]) return rootStyles_[themeId];
|
|
rootStyles_[themeId] = StyleSheet.create({
|
|
root: theme.rootStyle,
|
|
});
|
|
return rootStyles_[themeId];
|
|
}
|
|
}
|
|
|
|
export { BaseScreenComponent };
|
|
export default BaseScreenComponent;
|