1
1
import React from 'react'
2
- import styled , { withTheme } from 'styled-components'
2
+ import styled , { useTheme } from 'styled-components'
3
3
import ContentLoader from 'react-content-loader'
4
4
5
5
// Config-page: http://danilowoz.com/create-react-content-loader/
@@ -8,23 +8,27 @@ const LoadingWrapper = styled.div`
8
8
overflow: hidden;
9
9
`
10
10
11
- const CommentLoading = ( { theme} ) => (
12
- < LoadingWrapper >
13
- < ContentLoader
14
- height = { 60 }
15
- width = { 400 }
16
- speed = { 2 }
17
- primaryColor = { theme . loading . basic }
18
- secondaryColor = { theme . loading . animate }
19
- >
20
- < rect x = "35" y = "6" rx = "4" ry = "4" width = "117" height = "5.25" />
21
- < rect x = "37" y = "20" rx = "3" ry = "3" width = "85" height = "5.25" />
22
- < rect x = "37" y = "37.68" rx = "3" ry = "3" width = "318.5" height = "4.6" />
23
- < rect x = "37" y = "51" rx = "3" ry = "3" width = "319.2" height = "5.11" />
24
- < rect x = "71" y = "104" rx = "3" ry = "3" width = "201" height = "6.4" />
25
- < circle cx = "14.0" cy = "14.0" r = "14.0" />
26
- </ ContentLoader >
27
- </ LoadingWrapper >
28
- )
11
+ const CommentLoading = ( ) => {
12
+ const theme = useTheme ( )
29
13
30
- export default withTheme ( CommentLoading )
14
+ return (
15
+ < LoadingWrapper >
16
+ < ContentLoader
17
+ height = { 60 }
18
+ width = { 400 }
19
+ speed = { 2 }
20
+ primaryColor = { theme . loading . basic }
21
+ secondaryColor = { theme . loading . animate }
22
+ >
23
+ < rect x = "35" y = "6" rx = "4" ry = "4" width = "117" height = "5.25" />
24
+ < rect x = "37" y = "20" rx = "3" ry = "3" width = "85" height = "5.25" />
25
+ < rect x = "37" y = "37.68" rx = "3" ry = "3" width = "318.5" height = "4.6" />
26
+ < rect x = "37" y = "51" rx = "3" ry = "3" width = "319.2" height = "5.11" />
27
+ < rect x = "71" y = "104" rx = "3" ry = "3" width = "201" height = "6.4" />
28
+ < circle cx = "14.0" cy = "14.0" r = "14.0" />
29
+ </ ContentLoader >
30
+ </ LoadingWrapper >
31
+ )
32
+ }
33
+
34
+ export default CommentLoading