Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
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
export default function() {
Navigation.setDefaultOptions(baseStyle())
setDarkTheme(themeIsDark())
}
const getBackground = ()=>{
if (bg[themeIsDark()])
return bg[themeIsDark()]
bg[themeIsDark()] = TouchableNativeFeedback.canUseNativeForeground() ?
TouchableNativeFeedback.Ripple(themeIsDark() ? '#ffffff30' : '#00000030',false) :
TouchableNativeFeedback.SelectableBackground()
return bg[themeIsDark()]
}
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;