@@ -16,6 +16,7 @@ import {webcamImages} from '../../../images/webcam-images'
1616import { trackedOpenUrl } from '../components/open-url'
1717import LinearGradient from 'react-native-linear-gradient'
1818
19+ const transparentPixel = require ( '../../../images/transparent.png' )
1920const GITHUB_URL = 'https://stodevx.github.io/AAO-React-Native/webcams.json'
2021
2122type WebcamType = {
@@ -124,12 +125,18 @@ class StreamThumbnail extends React.PureComponent {
124125 thumbnail,
125126 accentColor,
126127 textColor,
128+ thumbnailUrl,
127129 } = this . props . webcam
128130
129131 const [ r , g , b ] = accentColor
130132 const baseColor = `rgba(${ r } , ${ g } , ${ b } , 1)`
131133 const startColor = `rgba(${ r } , ${ g } , ${ b } , 0.1)`
132134
135+ const img = thumbnailUrl
136+ ? { uri : thumbnailUrl }
137+ : webcamImages . hasOwnProperty ( thumbnail )
138+ ? webcamImages [ thumbnail ]
139+ : transparentPixel
133140
134141 return (
135142 < View style = { styles . cell } >
@@ -139,7 +146,7 @@ class StreamThumbnail extends React.PureComponent {
139146 activeOpacity = { 0.7 }
140147 onPress = { this . handlePress }
141148 >
142- < Image source = { webcamImages [ thumbnail ] } style = { [ styles . image ] } >
149+ < Image source = { img } style = { styles . image } >
143150 < View style = { styles . titleWrapper } >
144151 < LinearGradient
145152 colors = { [ startColor , baseColor ] }
0 commit comments