Skip to content

Commit 7019106

Browse files
committed
fix: temporarily remove react-native-syntax-highlighter due to build error
1 parent a3eb997 commit 7019106

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

examples/example-src-files/CodeSnippet.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import React, { useState } from 'react';
2+
import React, { JSX, useState } from 'react';
33
import {
44
LayoutChangeEvent,
55
Pressable,
@@ -13,8 +13,10 @@ import Animated, {
1313
useSharedValue,
1414
withTiming,
1515
} from 'react-native-reanimated';
16-
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
17-
import { ghcolors, tomorrow } from 'react-syntax-highlighter/dist/esm/styles/prism';
16+
// temporarily disabled react-native-syntax-highlighter as it is being buggy :(
17+
// todo: resolve issues with react-syntax-highlighter
18+
// import { ghcolors, tomorrow } from 'react-syntax-highlighter/styles/prism';
19+
// import SyntaxHighlighter from 'react-native-syntax-highlighter';
1820

1921
interface CodeSnippetProps {
2022
code: string;
@@ -24,7 +26,7 @@ export default function CodeSnippet({ code }: CodeSnippetProps): JSX.Element {
2426
const colorScheme = useColorScheme();
2527
const backgroundColor = colorScheme === 'dark' ? '#333' : '#f5f5f5';
2628
const color = colorScheme === 'dark' ? '#fff' : '#222';
27-
const syntaxStyle = colorScheme === 'dark' ? tomorrow : ghcolors;
29+
// const syntaxStyle = colorScheme === 'dark' ? tomorrow : ghcolors;
2830

2931
const [isExpanded, setIsExpanded] = useState(false);
3032
const height = useSharedValue(0);
@@ -54,9 +56,11 @@ export default function CodeSnippet({ code }: CodeSnippetProps): JSX.Element {
5456
</Pressable>
5557
<Animated.View style={animatedStyle}>
5658
<View onLayout={onLayout} style={styles.codeContainer}>
57-
<SyntaxHighlighter language='jsx' style={syntaxStyle}>
59+
<Text style={[{color}]}>
60+
{/* <SyntaxHighlighter language='jsx' style={syntaxStyle}> */}
5861
{code}
59-
</SyntaxHighlighter>
62+
</Text>
63+
{/* </SyntaxHighlighter> */}
6064
</View>
6165
</Animated.View>
6266
</View>
@@ -80,5 +84,6 @@ const styles = StyleSheet.create({
8084
top: 0,
8185
left: 0,
8286
right: 0,
87+
padding: 16
8388
},
8489
});

examples/package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)