-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathindex.tsx
25 lines (23 loc) · 809 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
import * as React from 'react';
import { Linking, SafeAreaView, useWindowDimensions } from 'react-native';
import { Reader, ReaderProvider } from '@epubjs-react-native/core';
import { useFileSystem } from '@epubjs-react-native/expo-file-system';
export function OpenExternalLink() {
const { width, height } = useWindowDimensions();
return (
<SafeAreaView style={{ flex: 1 }}>
<ReaderProvider>
<Reader
src="https://github.com/IDPF/epub3-samples/releases/download/20230704/accessible_epub_3.epub"
width={width}
height={height}
fileSystem={useFileSystem}
initialLocation="pr01s04.xhtml"
onPressExternalLink={(url) => {
Linking.openURL(url);
}}
/>
</ReaderProvider>
</SafeAreaView>
);
}