Skip to content

Commit caa8cf9

Browse files
committed
refactor: move styles to bottom of component
1 parent 55b425f commit caa8cf9

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

examples/example-src-files/CodeSnippet.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,6 @@ import Animated, {
1616
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
1717
import { ghcolors, tomorrow } from 'react-syntax-highlighter/dist/esm/styles/prism';
1818

19-
const styles = StyleSheet.create({
20-
container: {
21-
marginVertical: 10,
22-
borderRadius: 5,
23-
overflow: 'hidden',
24-
},
25-
header: {
26-
padding: 10,
27-
},
28-
headerText: {
29-
fontWeight: 'bold',
30-
},
31-
codeContainer: {
32-
position: 'absolute',
33-
top: 0,
34-
left: 0,
35-
right: 0,
36-
},
37-
});
38-
3919
interface CodeSnippetProps {
4020
code: string;
4121
}
@@ -82,3 +62,23 @@ export default function CodeSnippet({ code }: CodeSnippetProps): JSX.Element {
8262
</View>
8363
);
8464
}
65+
66+
const styles = StyleSheet.create({
67+
container: {
68+
marginVertical: 10,
69+
borderRadius: 5,
70+
overflow: 'hidden',
71+
},
72+
header: {
73+
padding: 10,
74+
},
75+
headerText: {
76+
fontWeight: 'bold',
77+
},
78+
codeContainer: {
79+
position: 'absolute',
80+
top: 0,
81+
left: 0,
82+
right: 0,
83+
},
84+
});

0 commit comments

Comments
 (0)