1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Support for dark/light theme

This commit is contained in:
Laurent Cozic
2017-08-01 17:59:01 +00:00
parent a270a345d3
commit cc54e32823
13 changed files with 511 additions and 323 deletions

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { StyleSheet } from 'react-native';
import { globalStyle } from 'lib/components/global-style.js';
import { globalStyle, themeStyle } from 'lib/components/global-style.js';
const styleObject_ = {
screen: {
@ -11,6 +11,8 @@ const styleObject_ = {
const styles_ = StyleSheet.create(styleObject_);
let rootStyles_ = {};
class BaseScreenComponent extends React.Component {
styles() {
@ -21,6 +23,18 @@ class BaseScreenComponent extends React.Component {
return styleObject_;
}
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];
}
}
export { BaseScreenComponent };