@@ -13,14 +13,14 @@ import {callPhone} from '../../components/call-phone'
1313import { Row } from '../../components/layout'
1414import type { TopLevelViewPropsType } from '../../types'
1515import { StreamPlayer } from './player'
16- import type { PlayState , HtmlAudioError } from './types'
16+ import type { PlayState , HtmlAudioError , PlayerTheme } from './types'
1717import { ActionButton , ShowCalendarButton , CallButton } from './buttons'
1818import { openUrl } from '../../components/open-url'
1919import { Viewport } from '../../components/viewport'
20+ import { withTheme } from '@callstack/react-theme-provider'
2021
2122type Props = TopLevelViewPropsType & {
2223 image : number ,
23- imageBorder : boolean ,
2424 playerUrl : string ,
2525 stationNumber : string ,
2626 title : string ,
@@ -31,6 +31,7 @@ type Props = TopLevelViewPropsType & {
3131 embeddedPlayerUrl : string ,
3232 streamSourceUrl : string ,
3333 } ,
34+ theme : PlayerTheme ,
3435}
3536
3637type State = {
@@ -39,7 +40,7 @@ type State = {
3940 uplinkError : ?string ,
4041}
4142
42- export class RadioControllerView extends React . PureComponent < Props , State > {
43+ class RadioControllerView extends React . Component < Props , State > {
4344 state = {
4445 playState : 'paused' ,
4546 streamError : null ,
@@ -118,7 +119,7 @@ export class RadioControllerView extends React.PureComponent<Props, State> {
118119 }
119120
120121 render ( ) {
121- const { source , title , stationName , image , imageBorder } = this . props
122+ const { source , title , stationName , image , theme } = this . props
122123 const { uplinkError, streamError, playState} = this . state
123124
124125 const error = uplinkError ? (
@@ -129,12 +130,13 @@ export class RadioControllerView extends React.PureComponent<Props, State> {
129130 </ Text >
130131 ) : null
131132
133+ let textColor = { color : theme . textColor }
132134 const titleBlock = (
133135 < View style = { styles . titleWrapper } >
134- < Text selectable = { true } style = { styles . heading } >
136+ < Text selectable = { true } style = { [ styles . heading , textColor ] } >
135137 { title }
136138 </ Text >
137- < Text selectable = { true } style = { styles . subHeading } >
139+ < Text selectable = { true } style = { [ styles . subHeading , textColor ] } >
138140 { stationName }
139141 </ Text >
140142
@@ -178,7 +180,9 @@ export class RadioControllerView extends React.PureComponent<Props, State> {
178180 const logoSize = { width : logoWidth , height : logoWidth }
179181
180182 const root = [ styles . root , sideways && landscape . root ]
181- const logo = [ imageBorder && styles . logoBorder , logoSize ]
183+ const logoBorderColor = { borderColor : theme . imageBorderColor }
184+ const logoBg = { backgroundColor : theme . imageBackgroundColor }
185+ const logo = [ styles . logoBorder , logoSize , logoBorderColor , logoBg ]
182186 const logoWrapper = [
183187 styles . logoWrapper ,
184188 sideways && landscape . logoWrapper ,
@@ -203,6 +207,10 @@ export class RadioControllerView extends React.PureComponent<Props, State> {
203207 }
204208}
205209
210+ const ThemedRadioControllerView = withTheme ( RadioControllerView )
211+
212+ export { ThemedRadioControllerView as RadioControllerView }
213+
206214const styles = StyleSheet . create ( {
207215 root : {
208216 flexDirection : 'column' ,
@@ -223,22 +231,22 @@ const styles = StyleSheet.create({
223231 } ,
224232 logoBorder : {
225233 borderRadius : 6 ,
226- borderColor : c . kstoSecondaryDark ,
234+ borderColor : c . black ,
227235 borderWidth : 3 ,
228236 } ,
229237 titleWrapper : {
230238 alignItems : 'center' ,
231239 marginBottom : 20 ,
232240 } ,
233241 heading : {
234- color : c . kstoPrimaryDark ,
242+ color : c . black ,
235243 fontWeight : '600' ,
236244 fontSize : 28 ,
237245 textAlign : 'center' ,
238246 } ,
239247 subHeading : {
240248 marginTop : 5 ,
241- color : c . kstoPrimaryDark ,
249+ color : c . black ,
242250 fontWeight : '300' ,
243251 fontSize : 28 ,
244252 textAlign : 'center' ,
0 commit comments