-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathindex.tsx
34 lines (31 loc) · 918 Bytes
/
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
import * as React from 'react';
import { Dimensions, SafeAreaView } from 'react-native';
import { Reader, ReaderProvider, useReader } from '@epubjs-react-native/core';
import { useFileSystem } from '@epubjs-react-native/expo-file-system';
import { Footer } from './Footer';
export function Book() {
const { goToLocation } = useReader();
return (
<SafeAreaView style={{ flex: 1 }}>
<Reader
src="https://s3.amazonaws.com/moby-dick/OPS/package.opf"
fileSystem={useFileSystem}
height={Dimensions.get('screen').height * 0.8}
waitForLocationsReady
onWebViewMessage={(message) => {
if (message.type === 'onCfiFromPercentage') {
goToLocation(message.cfi);
}
}}
/>
<Footer />
</SafeAreaView>
);
}
export default function WithSlider() {
return (
<ReaderProvider>
<Book />
</ReaderProvider>
);
}