forked from RivasCVA/react-native-code-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExample.tsx
31 lines (28 loc) · 1002 Bytes
/
Example.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import React from 'react';
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
import { useKeyboard } from '@react-native-community/hooks';
import CodeEditor, { CodeEditorSyntaxStyles } from './src';
const Example = (): JSX.Element => {
const insets = useSafeAreaInsets();
const keyboard = useKeyboard();
return (
<SafeAreaView>
<CodeEditor
style={{
...{
fontSize: 20,
inputLineHeight: 26,
highlighterLineHeight: 26,
},
...(keyboard.keyboardShown
? { marginBottom: keyboard.keyboardHeight - insets.bottom }
: {}),
}}
language="javascript"
syntaxStyle={CodeEditorSyntaxStyles.atomOneDark}
showLineNumbers
/>
</SafeAreaView>
);
};
export default Example;