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 openURL = (props, {browser, link, fromBottom=false, barColor=themed.main(), iconColor=themed.tintColor()})=>{
const protoRegex = /^(https|http|ftp)?/
switch(browser || store.getState().local.browser) {
case 'system':
Linking.openURL(link)
break
case 'ios.chrome':
Linking.openURL(link.replace(protoRegex, 'googlechrome'))
break
case 'ios.firefox':
Linking.openURL('firefox://open-url?url='+link)
break
case 'ios.firefox-focus':
export default ()=>({
statusBar: {
style: (themeIsDark() ? 'light' : 'dark'),
...(
(Platform.OS=='android' && Platform.Version >= 23) ?
{backgroundColor: themed.main()} : {}
)
},
topBar: {
background: {
color: themed.main(),
translucent: false,
blur: false
},
leftButtonColor: themed.tintColor(),
rightButtonColor: themed.tintColor(),
barStyle: themeIsDark() ? 'black' : 'default',
borderColor: themed.invertedLight(),
//borderHeight: 1,
noBorder: true,
elevation: 0,
title: {
color: themed.inverted(),
fontSize: fontSize.topBar(),
},
backButton: {
color: themed.tintColor(),
icon: require('assets/images/backButton.png'),
showTitle: false
}
},
...Platform.select({
ios: {
screenBackgroundColor: themed.main(),
}
}),
layout: {
...Platform.select({
ios: {
backgroundColor: themed.main()
},
android: {
componentBackgroundColor: themed.main() //performance improvement
}
})
},
overlay: {
interceptTouchOutside: false
},
bottomTabs: {
translucent: true, //iOS important, otherwise is drawen above content!!
animate: false,
barStyle: themeIsDark() ? 'black' : 'default',
backgroundColor: themed.main(),
titleDisplayMode: 'alwaysShow',
elevation: 22,
export const DefaultIconImage = styled(IconImage).attrs(props=>({
tintColor: props.theme.itemSelected ? (props.theme.dark ? themed.main(props) : 'white') : colors.asphalt
}))``
background: ${({color, theme})=>color || (theme.dark ? themed.main() : themed.tintColor())};
${({show})=>{
export default (options, {link, type, collectionId})=>{
openURL(options, {
link,
readerMode: type=='article',
barColor: themed.main(),
iconColor: themed._tintColor(collectionColor(collectionId))
})
}
})
},
subtitle: {
color: themed.invertedDark(),
fontSize: 13,
},
backButton: {
color: themed.tintColor(),
icon: require('assets/images/backButton.png'),
showTitle: false
}
},
...Platform.select({
ios: {
screenBackgroundColor: themed.main(),
}
}),
layout: {
...Platform.select({
ios: {
backgroundColor: themed.main()
},
android: {
componentBackgroundColor: themed.main() //performance improvement
}
})
},
overlay: {
interceptTouchOutside: false
},
bottomTabs: {
icon: require('assets/images/backButton.png'),
showTitle: false
}
},
...Platform.select({
ios: {
screenBackgroundColor: themed.main(),
}
}),
layout: {
...Platform.select({
ios: {
backgroundColor: themed.main()
},
android: {
componentBackgroundColor: themed.main() //performance improvement
}
})
},
overlay: {
interceptTouchOutside: false
},
bottomTabs: {
translucent: true, //iOS important, otherwise is drawen above content!!
animate: false,
barStyle: themeIsDark() ? 'black' : 'default',
backgroundColor: themed.main(),
titleDisplayMode: 'alwaysShow',
elevation: 22,
...Platform.select({
ios: {
background-color: ${props=>{
if (props.theme.sectionActive === true)
return props.theme.dark ? themed.invertedLight(props) : props.theme.tintColor || themed.tintColor(props)
return (props.theme.backgroundColor || themed.main(props))
}};
border-bottom-color: ${themed.invertedLight};