forked from Ivasoft/mattermost-mobile
* Theme selection screen (initial commit) PR Review changes Add custom theme option for users who are already using a custom theme Fix for limited allowed themes Selected item case fix Memoized available themes request, other optimizations updated snapshots * Custom theme option changes - title. spacing, save option on state for life-cycle of screen
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {StyleSheet} from 'react-native';
|
|
|
|
import * as ThemeUtils from 'mattermost-redux/utils/theme_utils';
|
|
|
|
export function makeStyleSheetFromTheme(getStyleFromTheme) {
|
|
return ThemeUtils.makeStyleFromTheme((theme) => {
|
|
return StyleSheet.create(getStyleFromTheme(theme));
|
|
});
|
|
}
|
|
|
|
export const changeOpacity = ThemeUtils.changeOpacity;
|
|
|
|
export const blendColors = ThemeUtils.blendColors;
|
|
|
|
export function concatStyles(...styles) {
|
|
return [].concat(styles);
|
|
}
|
|
|
|
export function setNavigatorStyles(navigator, theme) {
|
|
navigator.setStyle({
|
|
navBarTextColor: theme.sidebarHeaderTextColor,
|
|
navBarBackgroundColor: theme.sidebarHeaderBg,
|
|
navBarButtonColor: theme.sidebarHeaderTextColor,
|
|
screenBackgroundColor: theme.centerChannelBg,
|
|
});
|
|
}
|
|
|
|
export function isThemeSwitchingEnabled(state) {
|
|
const {config} = state.entities.general;
|
|
return config.EnableThemeSelection === 'true';
|
|
}
|