File tree Expand file tree Collapse file tree 7 files changed +173
-23
lines changed Expand file tree Collapse file tree 7 files changed +173
-23
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ export default async function TrackComponent({ params }: { params: { pdfId: stri
15
15
redirect ( "/tracks/oAjvkeRNZThPMxZf4aX5" ) ;
16
16
}
17
17
const [ problemDetails , trackDetails ] = await Promise . all ( [ getProblem ( problemId || null ) , getTrack ( trackId ) ] ) ;
18
-
19
18
if ( ! problemId ) {
20
19
return < RedirectToLastSolved trackId = { trackId } /> ;
21
20
}
@@ -28,20 +27,20 @@ export default async function TrackComponent({ params }: { params: { pdfId: stri
28
27
}
29
28
if ( trackDetails && problemDetails ) {
30
29
return (
31
- < div >
32
- { trackDetails ?. problems . map ( ( problem , i ) => (
33
- < LessonView
34
- isPdfRequested = { true }
35
- track = { trackDetails }
36
- problem = { {
37
- ...problemDetails ,
38
- notionRecordMap : notionRecordMaps [ i ] ,
39
- } }
40
- key = { i }
41
- />
42
- ) ) }
43
- < Print />
44
- </ div >
30
+ < div >
31
+ { trackDetails ?. problems . map ( ( problem , i ) => (
32
+ < LessonView
33
+ isPdfRequested = { true }
34
+ track = { trackDetails }
35
+ problem = { {
36
+ ...problemDetails ,
37
+ notionRecordMap : notionRecordMaps [ i ] ,
38
+ } }
39
+ key = { i }
40
+ />
41
+ ) ) }
42
+ < Print />
43
+ </ div >
45
44
) ;
46
45
}
47
46
}
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ export default async function TrackComponent({ params }: { params: { trackIds: s
53
53
< ScrollToTopWrapper >
54
54
< LessonView
55
55
showAppBar
56
+ showPagination
56
57
track = { trackDetails }
57
58
problem = { {
58
59
...problemDetails ,
Original file line number Diff line number Diff line change @@ -9,14 +9,16 @@ export const Blog = ({
9
9
problem,
10
10
track,
11
11
showAppBar,
12
+ showPagination,
12
13
isPdfRequested,
13
- problemIndex
14
+ problemIndex,
14
15
} : {
15
16
problem : Problem & { notionRecordMap : any } ;
16
17
track : Track & { problems : Problem [ ] } ;
17
18
showAppBar : Boolean ;
19
+ showPagination : Boolean ;
18
20
isPdfRequested ?: Boolean ;
19
- problemIndex : number
21
+ problemIndex : number ;
20
22
} ) => {
21
23
const mounted = useMountStatus ( ) ;
22
24
@@ -27,12 +29,14 @@ export const Blog = ({
27
29
}
28
30
29
31
return (
30
- < div >
31
- { showAppBar && < BlogAppbar problem = { problem } track = { track } problemIndex = { problemIndex } /> }
32
+ < div className = "break-after-page" >
33
+ { showAppBar && < BlogAppbar problem = { problem } track = { track } problemIndex = { problemIndex } /> }
32
34
< NotionRenderer recordMap = { problem . notionRecordMap } />
33
- < div className = "justify-center pt-2" >
34
- < Pagination allProblems = { track . problems } track = { track } problemIndex = { problemIndex } />
35
- </ div >
35
+ { showPagination && (
36
+ < div className = "justify-center pt-2" >
37
+ < Pagination allProblems = { track . problems } track = { track } problemIndex = { problemIndex } />
38
+ </ div >
39
+ ) }
36
40
</ div >
37
41
) ;
38
42
} ;
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export const LessonView = async ({
36
36
problem,
37
37
track,
38
38
showAppBar,
39
+ showPagination,
39
40
isPdfRequested,
40
41
} : {
41
42
problem : Problem & { notionRecordMap : any } & {
@@ -48,6 +49,7 @@ export const LessonView = async ({
48
49
} ;
49
50
track : Track & { problems : Problem [ ] } ;
50
51
showAppBar ?: Boolean ;
52
+ showPagination ?:Boolean ;
51
53
isPdfRequested ?: Boolean ;
52
54
} ) => {
53
55
const session = await getServerSession ( authOptions ) ;
@@ -81,6 +83,7 @@ export const LessonView = async ({
81
83
problem = { problem }
82
84
track = { track }
83
85
showAppBar = { ! ! showAppBar }
86
+ showPagination = { ! ! showPagination }
84
87
isPdfRequested = { isPdfRequested }
85
88
problemIndex = { problemIndex }
86
89
/>
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import Link from "next/link";
7
7
8
8
export function PageToggle ( { allProblems, track } : { allProblems : Problem [ ] ; track : Track & { problems : Problem [ ] } } ) {
9
9
const { trackIds } : { trackIds : string [ ] } = useParams ( ) ;
10
- const currentTrack = trackIds . join ( "/" ) ;
10
+ const currentTrack = trackIds ? .join ( "/" ) ;
11
11
12
12
return (
13
13
< DropdownMenu >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " dailycode" ,
3
3
"private" : true ,
4
+ "prisma" : {
5
+ "seed" : " ts-node packages\\ db\\ prisma\\ seed.ts"
6
+ },
4
7
"scripts" : {
5
8
"build" : " turbo build" ,
6
9
"dev" : " turbo dev" ,
You can’t perform that action at this time.
0 commit comments