Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (hour >= 19 || hour < 7) {
DARKMODE = true;
}
let userLang = DATA[LOCAL.userLanguage];
if (userLang !== '') lang.setLanguage(userLang);
console.log('state has been set');
let tint = TintColour();
if (!tint[50]) tint = BLUE;
// Setup global dark theme
global.DARK = {
colors: {
...DarkTheme.colors,
surface: 'black',
text: GREY[50],
primary: tint[500],
accent: tint[300],
}
};
// Setup global light theme
global.LIGHT = {
colors: {
...DefaultTheme.colors,
surface: 'white',
text: GREY[900],
primary: tint[500],
accent: tint[300],
}
updateTheme() {
const { tintColour } = this.state;
// Switch mode
UpdateDarkMode();
this.setState({darkMode: DARKMODE});
this.props.theme.dark = DARKMODE;
if (DARKMODE) {
global.DARK = {
colors: {
...DarkTheme.colors,
surface: 'black',
text: GREY[50],
primary: tintColour[500],
accent: tintColour[300],
}
};
this.props.theme.colors = DARK.colors;
} else {
// Setup global light theme
global.LIGHT = {
colors: {
...DefaultTheme.colors,
surface: 'white',
text: GREY[900],
primary: tintColour[500],
accent: tintColour[300],
updateTheme() {
const { tintColour } = this.state;
// Switch mode
UpdateDarkMode();
this.setState({darkMode: DARKMODE});
this.props.theme.dark = DARKMODE;
if (DARKMODE) {
global.DARK = {
colors: {
...DarkTheme.colors,
surface: 'black',
text: GREY[50],
primary: tintColour[500],
accent: tintColour[300],
}
};
this.props.theme.colors = DARK.colors;
} else {
// Setup global light theme
global.LIGHT = {
colors: {
...DefaultTheme.colors,
surface: 'white',
text: GREY[900],
primary: tintColour[500],
accent: tintColour[300],
import { DarkTheme } from 'react-native-paper';
type ThemeColors = {
colors: {
icon: string,
divider: string,
ripple: string,
},
};
export type ThemeType = Theme & ThemeColors;
const theme = {
...DarkTheme,
colors: {
...DarkTheme.colors,
background: '#373C3F',
divider: '#95898E',
icon: '#FFFFFF',
primary: '#18D1A8',
ripple: 'rgba(255, 255, 255, .20)',
secondaryText: '#D9D7DA',
},
};
export default theme;
const accent = '#687d85'
const roundness = 0
const fonts = {
regular: 'Montserrat',
medium: 'Montserrat Medium',
light: 'Montserrat Light',
thin: 'Montserrat Thin'
}
const darkTheme = {
...DarkTheme,
roundness,
fonts,
colors: {
...DarkTheme.colors,
primary,
accent,
background: '#121212',
surface: '#373737',
appBar: '#1f1f1f'
}
}
const lightTheme = {
...DefaultTheme,
roundness,
fonts,
colors: {
...DefaultTheme.colors,
primary,
accent,
appBar: primary
parentContainerMargin,
containerStyle,
imageStyle,
isHighlight,
isMute,
hideBookmarkButton,
isShowLikeCount,
} = this.props;
const imageWidthOffset = isHighlight ? HIGHLIGHT_BORDER_WIDTH * 2 + 1 : 1;
return (
{isMute ? (
import AppTabs from './navigators/tabs';
import Loading from './screens/loading/container';
import { store, persistor } from './store';
import { setAppToggleTheme } from './actions';
const PreferencesContext: any = createReactContext();
const AppContainer = createAppContainer(AppTabs);
const darkTheme = {
...DarkTheme,
roundness: 2,
colors: {
...DarkTheme.colors,
background: '#2e3436',
primary: '#555753',
accent: '#e9b96e',
accent_alt: '#547f2f',
text: '#d3d7cf',
comment: '#272c2d',
}
};
const whiteTheme = {
...DefaultTheme,
roundness: 2,
colors: {
...DefaultTheme.colors,
background: '#ffffff',