how to get chapters name. i have beedn trying for 2 days but not getting lucky.
asadahmad27 opened this issue · comments
import {Reader, ReaderProvider, useReader} from '@epubjs-react-native/core';
import {useFileSystem} from '@epubjs-react-native/file-system';
import {Text, TouchableOpacity, View, useWindowDimensions} from 'react-native';
import GestureRecognizer, {swipeDirections} from 'react-native-swipe-gestures';
import AABText from '../../../components/AABText';
function Inner({link}) {
const {width, height} = useWindowDimensions();
const {addMark, removeMark, goNext, goPrevious, getMeta, getLocations} =
useReader();
const handleAddMark = (text, cfiRange) => {
addMark(text, cfiRange);
};
const onSwipe = (gestureName, gestureState) => {
const {SWIPE_UP, SWIPE_DOWN, SWIPE_LEFT, SWIPE_RIGHT} = swipeDirections;
switch (gestureName) {
case SWIPE_LEFT:
goNext();
break;
case SWIPE_RIGHT:
goPrevious();
break;
}
};
const config = {
velocityThreshold: 0.3,
directionalOffsetThreshold: 80,
};
return (
<>
<GestureRecognizer
onSwipe={(direction, state) => onSwipe(direction, state)}
config={config}
// style={{borderWidth: 1}}
>
<Reader
src={link}
width={width - 50}
height={height - 280}
fileSystem={useFileSystem}
/>
<View style={{justifyContent: 'center', alignItems: 'center'}}>
Page 3/12 of this section
</>
);
}
const BookContainer = ({link}) => {
return (
);
};
export default BookContainer;
hello @asadahmad27, I'm working on a way to obtain this information in a simple way, this is currently in beta version!