daddou-ma
Repos
54
Followers
71
Following
332

Events

issue comment
Unable to get correct section href

based on @johnfactotum comments I got to the following code https://github.com/futurepress/epub.js/issues/759#issuecomment-1399499918 which worked well for me

Created at 1 week ago
issue comment
What's the best way to get a chapter name from a CFI in v0.3?

After checking https://github.com/futurepress/epub.js/issues/997#issuecomment-552321080 and https://github.com/futurepress/epub.js/issues/986#issuecomment-538716885 I come up with the following code which works for me in most cases

function flatten(chapters: any) {
    return [].concat.apply([], chapters.map((chapter: NavItem) => [].concat.apply([chapter], flatten(chapter.subitems))));
}

export function getCfiFromHref(book: Book, href: string) {
    const [_, id] = href.split('#')
    const section = book.spine.get(href)
    const el = (id ? section.document.getElementById(id) : section.document.body) as Element
    return section.cfiFromElement(el)
}

export function getChapter(book: Book, location: Location) {
    const locationHref = location.start.href

    let match = flatten(book.navigation.toc)
        .filter((chapter: NavItem) => {
            return book.canonical(chapter.href).includes(book.canonical(locationHref))
        }, null)
        .reduce((result: NavItem|null, chapter: NavItem) => {
            const locationAfterChapter = EpubCFI.prototype.compare(location.start.cfi, getCfiFromHref(book, chapter.href)) > 0
            return locationAfterChapter ? chapter : result
        }, null);

    return match;
};
Created at 1 week ago
pull request closed
add thumbStyle, thumbSize, trackHeight props to Readme.md

Summary:

I added thumbStyle, thumbSize, trackHeight props to the Props Table in Readme.md

Test Plan:

Just check Props Table in the readme.md file. you should find thumbStyle, thumbSize, trackHeightrows.

Created at 2 weeks ago
add thumbStyle, thumbSize, trackHeight props to Readme.md

Closed because those props are only available for web. check https://github.com/callstack/react-native-slider/issues/92#issuecomment-1380176200

Created at 2 weeks ago
trackStyle and thumbStyle

@Sharcoux Didn't notice that. I'm closing the PR. Thank you

Created at 2 weeks ago

Update README.md

Co-authored-by: Taym Haddadi haddadi.taym@gmail.com

Created at 2 weeks ago
trackStyle and thumbStyle

After taking a look at the Code, I've found that we thumbStyle, thumbSize, trackHeight properties that are not mentioned in Readme.md Doc. maybe this could help.

Here is a PR containing README.md updates #481

Created at 3 weeks ago
pull request opened
add thumbStyle, thumbSize, trackHeight props to Readme.md

Summary:

I added thumbStyle, thumbSize, trackHeight props to the Props Table in Readme.md

Test Plan:

Just check Props Table in the readme.md file. you should find thumbStyle, thumbSize, trackHeightrows.

Created at 3 weeks ago

add thumbStyle, thumbSize, trackHeight props to Readme.md

Created at 3 weeks ago
daddou-ma create branch doc/update-readme-add-missing-props
Created at 3 weeks ago
Created at 2 months ago