How to use the co/style/colors.themeIsDark function in co

To help you get started, we’ve selected a few co examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github raindropio / mobile / src / co / style / list.js View on Github external
export const SectionList = styled.SectionList.attrs(props=>({
	directionalLockEnabled: true,
	stickySectionHeadersEnabled: true,
	keyboardDismissMode: 'on-drag',
	keyboardShouldPersistTaps: 'always',
	removeClippedSubviews: Platform.OS == 'ios' ? true : false,
	indicatorStyle: themeIsDark(props) ? 'white' : 'default'
	//ItemSeparatorComponent
}))`
	flex: 1;
github raindropio / mobile / src / co / screen / index.js View on Github external
const extended = []

		//Screen style
		if (original.style)
			(Array.isArray(original.style) ? original.style : [original.style]).forEach(style=>{
				switch(style) {
					case 'form': extended.push(require('./styles/form').default(original))
				}
			})
		
		//Is modal
		if (isModal)
			extended.push(require('./styles/modal').default(original))

		//Apply tintColor if screen is not dark
		if (original.tintColor && !themeIsDark()){
			extended.push({
				topBar: {
					backButton: {color: original.tintColor},
					leftButtonColor: original.tintColor,
					rightButtonColor: original.tintColor,
				}
			})
		}

		if (extended.length)
			return _.merge(original, ...extended)

		//Remove styles for old phones
		if (original.statusBar && original.statusBar.backgroundColor)
			if (Platform.OS=='android' && Platform.Version < 23)
				delete original.statusBar.backgroundColor
github raindropio / mobile / src / modules / navigation / init.js View on Github external
export default function() {
    Navigation.setDefaultOptions(baseStyle())
    setDarkTheme(themeIsDark())
}
github raindropio / mobile / src / co / common / touchItem / index.android.js View on Github external
const getBackground = ()=>{
	if (bg[themeIsDark()])
		return bg[themeIsDark()]

	bg[themeIsDark()] = TouchableNativeFeedback.canUseNativeForeground() ? 
		TouchableNativeFeedback.Ripple(themeIsDark() ? '#ffffff30' : '#00000030',false) :
		TouchableNativeFeedback.SelectableBackground()
	return bg[themeIsDark()]
}
github raindropio / mobile / src / co / style / form.js View on Github external
export const BaseInput = styled.TextInput.attrs(props=>({
	enablesReturnKeyAutomatically: true,
	blurOnSubmit: true,
	underlineColorAndroid: 'transparent',
	disableFullscreenUI: true,
	placeholderTextColor: themed.invertedMedium(props),
	keyboardAppearance: themeIsDark(props)?'dark':'default',
	numberOfLines: 1
}))`
	font-size: ${fontSize.normal}px;