@@ -10,6 +10,8 @@ import { BookPage } from "./BookPage";
10
10
import { skipToken } from "@reduxjs/toolkit/query" ;
11
11
import { ShowLoadingQuery } from "../handlers/ShowLoadingQuery" ;
12
12
import { TeacherNotes } from "./TeacherNotes" ;
13
+ import { IsaacContentValueOrChildren } from "../content/IsaacContentValueOrChildren" ;
14
+ import { ContentDTO } from "../../../IsaacApiTypes" ;
13
15
14
16
interface BookProps {
15
17
match : { params : { bookId : string } } ;
@@ -63,12 +65,25 @@ export const Book = ({match: {params: {bookId}}}: BookProps) => {
63
65
/>
64
66
: < >
65
67
< TeacherNotes notes = { definedBookIndexPage . teacherNotes } />
66
- < div >
67
- < div className = "book-image-container mx-3 float-end" >
68
+ { definedBookIndexPage . value && < div >
69
+ < div className = "book-image-container book-height-lg d-none d-sm-block mx-3 float-end" >
68
70
< img src = { definedBookIndexPage . coverImage ?. src } alt = { definedBookIndexPage . title } />
69
71
</ div >
70
72
< Markup className = "d-contents" trusted-markup-encoding = { "markdown" } > { definedBookIndexPage . value } </ Markup >
71
- </ div >
73
+ </ div > }
74
+ { definedBookIndexPage . children ?. length && < >
75
+ < div className = "d-flex" >
76
+ < div className = "flex-grow-1" >
77
+ < IsaacContentValueOrChildren { ...definedBookIndexPage . children [ 0 ] as ContentDTO } />
78
+ </ div >
79
+ < div className = "book-image-container book-height-lg d-none d-sm-block mx-3 float-end" >
80
+ < img src = { definedBookIndexPage . coverImage ?. src } alt = { definedBookIndexPage . title } />
81
+ </ div >
82
+ </ div >
83
+ < IsaacContentValueOrChildren >
84
+ { definedBookIndexPage . children . slice ( 1 ) }
85
+ </ IsaacContentValueOrChildren >
86
+ </ > }
72
87
</ >
73
88
}
74
89
</ MainContent >
0 commit comments