File tree Expand file tree Collapse file tree 8 files changed +39
-8
lines changed Expand file tree Collapse file tree 8 files changed +39
-8
lines changed Original file line number Diff line number Diff line change 20
20
"next" : " ^12.3.0" ,
21
21
"next-seo" : " ^5.15.0" ,
22
22
"next-stripe" : " ^1.0.0-beta.9" ,
23
+ "nprogress" : " ^0.2.0" ,
23
24
"prop-types" : " ^15.8.1" ,
24
25
"react" : " ^18.2.0" ,
25
26
"react-dom" : " ^18.2.0" ,
Original file line number Diff line number Diff line change 1
- import '../src/styles/index.scss'
1
+ import '../src/styles/index.scss' ;
2
+
3
+ import Router from 'next/router' ;
4
+ import NProgress from 'nprogress' ;
5
+
6
+ NProgress . configure ( { showSpinner : false } ) ;
7
+ Router . events . on ( 'routeChangeStart' , ( ) => NProgress . start ( ) ) ;
8
+ Router . events . on ( 'routeChangeComplete' , ( ) => NProgress . done ( ) ) ;
9
+ Router . events . on ( 'routeChangeError' , ( ) => NProgress . done ( ) ) ;
2
10
3
11
function MyApp ( { Component, pageProps } ) {
4
12
return < Component { ...pageProps } />
Original file line number Diff line number Diff line change @@ -19,12 +19,11 @@ import { getPosts } from '../../src/utils/blog';
19
19
* @param {Object } postsData Post Data.
20
20
*/
21
21
const Blog = ( { headerFooter, postsData } ) => {
22
- console . log ( 'postsData' , postsData ) ;
23
22
return (
24
- < Layout headerFooter = { headerFooter || { } } seo = { null } >
23
+ < Layout headerFooter = { headerFooter || { } } seo = { null } >
25
24
< h1 > Blog</ h1 >
26
- < Posts posts = { postsData ?. posts_data ?? [ ] } />
27
- < Pagination pagesCount = { postsData ?. page_count } postName = "blog" />
25
+ < Posts posts = { postsData ?. posts_data ?? [ ] } />
26
+ < Pagination pagesCount = { postsData ?. page_count } postName = "blog" />
28
27
</ Layout >
29
28
) ;
30
29
} ;
@@ -38,7 +37,7 @@ export async function getStaticProps() {
38
37
return {
39
38
props : {
40
39
headerFooter : headerFooterData ?. data ?? { } ,
41
- postsData : postsData || { }
40
+ postsData : postsData || { } ,
42
41
} ,
43
42
44
43
/**
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ import Pagination from '../../../src/components/pagination';
18
18
const Page = ( { headerFooter, postsData } ) => {
19
19
const router = useRouter ( ) ;
20
20
21
- console . log ( 'postsData' , postsData ) ;
22
-
23
21
// Redirecting to /blog if we are on page 1
24
22
const pageNo = router ?. query ?. pageNo ?? 1 ;
25
23
Original file line number Diff line number Diff line change
1
+ // NProgress style.
2
+ @import ' nprogress/nprogress.css' ;
3
+
4
+ #nprogress .bar {
5
+ background-color : #fff ;
6
+ }
Original file line number Diff line number Diff line change 10
10
11
11
// Image Gallery Styles.
12
12
@import " ~react-image-gallery/styles/scss/image-gallery.scss" ;
13
+
14
+ // NProgress Styles.
15
+ @import " 04-libraries/nprogress" ;
Original file line number Diff line number Diff line change 1629
1629
" resolved" " https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz"
1630
1630
" version" " 0.1.2"
1631
1631
1632
+ " nprogress@^0.2.0 " :
1633
+ " integrity" " sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA=="
1634
+ " resolved" " https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz"
1635
+ " version" " 0.2.0"
1636
+
1632
1637
" nth-check@^1.0.2 " :
1633
1638
" integrity" " sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg=="
1634
1639
" resolved" " https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz"
You can’t perform that action at this time.
0 commit comments