@@ -24,53 +24,39 @@ const sharedStyles = `
24
24
min-height: 100%;
25
25
` ;
26
26
27
- const BackgroundVideo : React . SFC < BackgroundProps > = ( { video, image } ) => (
28
- < div >
29
- < video
30
- src = { video }
31
- loop = { true }
32
- muted = { true }
33
- autoPlay = { true }
34
- />
35
- < style jsx >
36
- { `
37
- video {
38
- ${ sharedStyles }
39
- z-index: ${ zIndex . background } ;
40
- }
41
- ` }
42
- </ style >
43
- </ div >
44
- ) ;
27
+ const StyledVideo = styled ( 'video' ) `
28
+ ${ sharedStyles }
29
+ z-index: ${ zIndex . background } ;
30
+ `
45
31
46
- const BackgroundImage : React . SFC < BackgroundProps > = ( { image, position } ) => (
47
- < div >
48
- < style jsx >
49
- { `
50
- ${ sharedStyles }
51
- z-index: ${ zIndex . background } ;
52
- background: url('${ image } ') center center no-repeat;
53
- background-size: cover;
54
- ${ position
55
- ? `background-position: ${ position } ;`
56
- : ''
57
- }
58
- ` }
59
- </ style >
60
- </ div >
32
+ const BackgroundVideo : React . FC < BackgroundProps > = ( { video } ) => (
33
+ < StyledVideo
34
+ src = { video }
35
+ loop = { true }
36
+ muted = { true }
37
+ autoPlay = { true }
38
+ />
61
39
) ;
62
40
63
- const BackgroundColor : React . SFC < BackgroundProps > = ( { color } ) => (
64
- < div >
65
- < style jsx = { true } >
66
- { `
67
- ${ sharedStyles }
68
- z-index: ${ zIndex . background + 1 } ;
69
- background-color: ${ color } ;
70
- ` }
71
- </ style >
72
- </ div >
73
- ) ;
41
+ const BackgroundImage = styled ( 'div' ) < BackgroundProps >
42
+ `
43
+ ${ sharedStyles }
44
+ z-index: ${ zIndex . background } ;
45
+ background: url('${ ( { image} ) => image } ') center center no-repeat;
46
+ background-size: cover;
47
+ ${ ( { position} ) => position
48
+ ? `background-position: ${ position } ;`
49
+ : ''
50
+ }
51
+ ` ;
52
+
53
+ const BackgroundColor = styled ( 'div' ) < BackgroundProps >
54
+ `
55
+ ${ sharedStyles }
56
+ z-index: ${ zIndex . background + 1 } ;
57
+ background-color: ${ props => props . color } ;
58
+ `
59
+ ;
74
60
75
61
export const parseBackgroundAsString = ( input : string ) => ( {
76
62
color : / m p \d $ / . test ( input ) ? colors . dim : undefined ,
@@ -88,7 +74,7 @@ const BackgroundContainer = styled.div`
88
74
overflow: hidden;
89
75
` ;
90
76
91
- const Background : React . SFC < BackgroundProps > = ( {
77
+ const Background : React . FC < BackgroundProps > = ( {
92
78
color,
93
79
video,
94
80
image,
0 commit comments