-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathindex.tsx
60 lines (54 loc) · 1.34 KB
/
index.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* eslint-disable @typescript-eslint/no-use-before-define */
import React from 'react';
import { SafeAreaView, useWindowDimensions, StyleSheet } from 'react-native';
import {
ReaderProvider,
Reader,
Themes,
useReader,
} from '@epubjs-react-native/core';
import { useFileSystem } from '@epubjs-react-native/expo-file-system';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { Header } from './Header';
function Component() {
const { height } = useWindowDimensions();
const insets = useSafeAreaInsets();
const { theme } = useReader();
return (
<SafeAreaView
style={{
...styles.container,
paddingTop: insets.top,
paddingBottom: insets.bottom,
paddingLeft: insets.left,
paddingRight: insets.right,
backgroundColor: theme.body.background,
}}
>
<Header />
<Reader
src="https://s3.amazonaws.com/moby-dick/OPS/package.opf"
height={height * 0.8}
fileSystem={useFileSystem}
defaultTheme={Themes.DARK}
/>
</SafeAreaView>
);
}
export function CustomThemes() {
return (
<ReaderProvider>
<Component />
</ReaderProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'flex-start',
},
contentContainer: {
flex: 1,
alignItems: 'center',
},
});