You just hit a route that doesn't exist... the sadness.
7 |
37 | {cleanTokens(tokens).map((line, i) => {
38 | let lineClass = {};
39 |
40 | let isDiff = false;
41 |
42 | if (line[0] && line[0].content.length && line[0].content[0] === '+') {
43 | lineClass = { backgroundColor: 'rgba(76, 175, 80, 0.2)' };
44 | isDiff = true;
45 | } else if (line[0] && line[0].content.length && line[0].content[0] === '-') {
46 | lineClass = { backgroundColor: 'rgba(244, 67, 54, 0.2)' };
47 | isDiff = true;
48 | } else if (line[0] && line[0].content === '' && line[1] && line[1].content === '+') {
49 | lineClass = { backgroundColor: 'rgba(76, 175, 80, 0.2)' };
50 | isDiff = true;
51 | } else if (line[0] && line[0].content === '' && line[1] && line[1].content === '-') {
52 | lineClass = { backgroundColor: 'rgba(244, 67, 54, 0.2)' };
53 | isDiff = true;
54 | }
55 | const lineProps = getLineProps({ line, key: i });
56 |
57 | lineProps.style = lineClass;
58 | const diffStyle = {
59 | userSelect: 'none',
60 | MozUserSelect: '-moz-none',
61 | WebkitUserSelect: 'none',
62 | };
63 |
64 | let splitToken;
65 |
66 | return (
67 |
68 | {line.map((token, key) => {
69 | if (isDiff) {
70 | if (
71 | (key === 0 || key === 1) &
72 | (token.content.charAt(0) === '+' || token.content.charAt(0) === '-')
73 | ) {
74 | if (token.content.length > 1) {
75 | splitToken = {
76 | types: ['template-string', 'string'],
77 | content: token.content.slice(1),
78 | };
79 | const firstChar = {
80 | types: ['operator'],
81 | content: token.content.charAt(0),
82 | };
83 |
84 | return (
85 |
86 |
90 |
91 |
92 | );
93 | } else {
94 | return ;
95 | }
96 | }
97 | }
98 | return ;
99 | })}
100 |
101 | );
102 | })}
103 |
104 | )}
105 |