@@ -3,47 +3,55 @@ import styled from '@emotion/styled'
33import { motion } from 'framer-motion'
44import ContentLoader from 'react-content-loader'
55import { getTransitionDuration } from '../../../utils'
6+ import { useTheme } from '@emotion/react'
67
7- const TitleLoader = ( ) => (
8- < ContentLoader
9- speed = { 1 }
10- backgroundColor = "#eee"
11- foregroundColor = "#e6e6e6"
12- viewBox = "0 0 400 100"
13- >
14- < rect width = "250" height = "6" rx = "1.5" />
15- </ ContentLoader >
16- )
8+ const TitleLoader = ( ) => {
9+ const theme = useTheme ( )
1710
18- const DiffLoader = ( ) => (
19- < ContentLoader
20- speed = { 1 }
21- backgroundColor = "#eee"
22- foregroundColor = "#e6e6e6"
23- viewBox = "0 0 400 100"
24- >
25- < rect x = "0" y = "10" width = "47%" height = "6" rx = "1.5" />
26- < rect x = "200" y = "10" width = "41%" height = "6" rx = "1.5" />
27- < rect x = "0" y = "18" width = "43%" height = "6" rx = "1.5" />
28- < rect x = "200" y = "34" width = "40%" height = "6" rx = "1.5" />
29- < rect x = "200" y = "42" width = "45%" height = "6" rx = "1.5" />
30- < rect x = "0" y = "42" width = "40%" height = "6" rx = "1.5" />
31- < rect x = "0" y = "50" width = "44%" height = "6" rx = "1.5" />
32- </ ContentLoader >
33- )
11+ return (
12+ < ContentLoader
13+ speed = { 1 }
14+ backgroundColor = { theme . rowOdd }
15+ foregroundColor = { theme . rowEven }
16+ viewBox = "0 0 400 100"
17+ >
18+ < rect width = "250" height = "6" rx = "1.5" />
19+ </ ContentLoader >
20+ )
21+ }
22+
23+ const DiffLoader = ( ) => {
24+ const theme = useTheme ( )
25+
26+ return (
27+ < ContentLoader
28+ speed = { 1 }
29+ backgroundColor = { theme . rowOdd }
30+ foregroundColor = { theme . rowEven }
31+ viewBox = "0 0 400 100"
32+ >
33+ < rect x = "0" y = "10" width = "47%" height = "6" rx = "1.5" />
34+ < rect x = "200" y = "10" width = "41%" height = "6" rx = "1.5" />
35+ < rect x = "0" y = "18" width = "43%" height = "6" rx = "1.5" />
36+ < rect x = "200" y = "34" width = "40%" height = "6" rx = "1.5" />
37+ < rect x = "200" y = "42" width = "45%" height = "6" rx = "1.5" />
38+ < rect x = "0" y = "42" width = "40%" height = "6" rx = "1.5" />
39+ < rect x = "0" y = "50" width = "44%" height = "6" rx = "1.5" />
40+ </ ContentLoader >
41+ )
42+ }
3443
3544const Container = styled ( motion . div ) `
3645 margin-top: 16px;
3746 border: 1px solid ${ ( { theme } ) => theme . border } ;
3847 border-radius: 3px;
3948`
4049
41- const Header = styled . div ( {
42- color : '#24292e' ,
43- backgroundColor : '#fafbfc' ,
44- padding : '10px' ,
45- height : '40px' ,
46- } )
50+ const Header = styled . div `
51+ background-color: ${ ( { theme } ) => theme . background } ;
52+ padding: 10px;
53+ height: 40px;
54+ `
4755
4856const DiffLoading = ( ) => (
4957 < Container
0 commit comments