Skip to content

Commit f1968e0

Browse files
committed
Fix darkmode DiffComment colors
1 parent 165c86a commit f1968e0

File tree

2 files changed

+33
-30
lines changed

2 files changed

+33
-30
lines changed

src/components/common/Diff/DiffComment.js

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,40 @@ import { motion } from 'framer-motion'
44
import { removeAppPathPrefix, getVersionsContentInDiff } from '../../../utils'
55
import Markdown from '../Markdown'
66

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+
})`
3228
overflow: hidden;
3329
3430
& > div {
3531
display: flex;
3632
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+
}};
3841
cursor: pointer;
3942
}
4043
`
@@ -43,8 +46,8 @@ const ContentContainer = styled.div`
4346
flex: 1;
4447
position: relative;
4548
padding: 16px;
46-
color: #000;
47-
background-color: #fffbe6;
49+
color: ${({ theme }) => theme.text};
50+
background-color: ${({ theme }) => theme.yellowBackground};}
4851
user-select: none;
4952
`
5053

@@ -67,7 +70,7 @@ const ShowButton = styled(({ isCommentOpen, ...props }) => (
6770
}}
6871
/>
6972
))`
70-
background-color: #ffe58f;
73+
background-color: ${({ theme }) => theme.yellowBorder};
7174
margin-left: 20px;
7275
width: 10px;
7376
cursor: pointer;

src/components/common/UsefulLinks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { PACKAGE_NAMES } from '../../constants'
66

77
const Separator = styled.hr`
88
margin: 15px 0;
9-
background-color: #e1e4e8;
9+
background-color: ${({ theme }) => theme.border};
1010
height: 0.25em;
1111
border: 0;
1212
`

0 commit comments

Comments
 (0)