@@ -4,37 +4,40 @@ import { motion } from 'framer-motion'
4
4
import { removeAppPathPrefix , getVersionsContentInDiff } from '../../../utils'
5
5
import Markdown from '../Markdown'
6
6
7
- const lineColors = {
8
- add : '#d6fedb' ,
9
- delete : '#fdeff0' ,
10
- neutral : '#ffffff' ,
11
- }
12
-
13
- const Container = styled ( ( { isCommentOpen, children, ...props } ) => (
14
- < motion . div
15
- { ...props }
16
- variants = { {
17
- open : {
18
- height : 'auto' ,
19
- } ,
20
- hidden : { height : 10 } ,
21
- } }
22
- initial = { isCommentOpen ? 'open' : 'hidden' }
23
- animate = { isCommentOpen ? 'open' : 'hidden' }
24
- transition = { {
25
- duration : 0.5 ,
26
- } }
27
- inherit = { false }
28
- >
29
- < div children = { children } />
30
- </ motion . div >
31
- ) ) `
7
+ const Container = styled ( ( { isCommentOpen, children, ...props } ) => {
8
+ return (
9
+ < motion . div
10
+ { ...props }
11
+ variants = { {
12
+ open : {
13
+ height : 'auto' ,
14
+ } ,
15
+ hidden : { height : 10 } ,
16
+ } }
17
+ initial = { isCommentOpen ? 'open' : 'hidden' }
18
+ animate = { isCommentOpen ? 'open' : 'hidden' }
19
+ transition = { {
20
+ duration : 0.5 ,
21
+ } }
22
+ inherit = { false }
23
+ >
24
+ < div children = { children } />
25
+ </ motion . div >
26
+ )
27
+ } ) `
32
28
overflow: hidden;
33
29
34
30
& > div {
35
31
display: flex;
36
32
flex-direction: row;
37
- background-color: ${ ( { lineChangeType } ) => lineColors [ lineChangeType ] } ;
33
+ background-color: ${ ( { lineChangeType, theme } ) => {
34
+ const colorMap = {
35
+ add : theme . diff . codeInsertBackground ,
36
+ delete : theme . diff . codeDeleteBackground ,
37
+ }
38
+
39
+ return colorMap [ lineChangeType ] || theme . background
40
+ } } ;
38
41
cursor: pointer;
39
42
}
40
43
`
@@ -43,8 +46,8 @@ const ContentContainer = styled.div`
43
46
flex: 1;
44
47
position: relative;
45
48
padding: 16px;
46
- color: #000 ;
47
- background-color: #fffbe6;
49
+ color: ${ ( { theme } ) => theme . text } ;
50
+ background-color: ${ ( { theme } ) => theme . yellowBackground } ;}
48
51
user-select: none;
49
52
`
50
53
@@ -67,7 +70,7 @@ const ShowButton = styled(({ isCommentOpen, ...props }) => (
67
70
} }
68
71
/>
69
72
) ) `
70
- background-color: #ffe58f ;
73
+ background-color: ${ ( { theme } ) => theme . yellowBorder } ;
71
74
margin-left: 20px;
72
75
width: 10px;
73
76
cursor: pointer;
0 commit comments