-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1f41cd
commit fe137d5
Showing
4 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import Head from 'next/head'; | ||
import Link from 'next/link'; | ||
import {withRouter} from "next/router"; | ||
import Layout from '../../components/Layout'; | ||
import React,{ useState,useEffect } from 'react'; | ||
import { singleBlog } from '../../actions/blog'; | ||
import LabelIcon from '@material-ui/icons/Label'; | ||
import CategoryIcon from '@material-ui/icons/Category'; | ||
import {API,DOMAIN,APP_NAME} from '../../config'; | ||
import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; | ||
|
||
|
||
const SingleBlog = ({blog,router})=>{ | ||
return ( | ||
<> | ||
<Layout> | ||
<main> | ||
<article> | ||
<div className="container-fluid"> | ||
<section> | ||
{JSON.stringify(blog)} | ||
</section> | ||
</div> | ||
</article> | ||
</main> | ||
</Layout> | ||
</> | ||
) | ||
} | ||
|
||
SingleBlog.getInitialProps=({query})=>{ | ||
return singleBlog(query.slug).then(data=>{ | ||
if (data.error){ | ||
console.log(data.error) | ||
} else { | ||
return {blog:data} | ||
} | ||
}) | ||
} | ||
|
||
export default withRouter(SingleBlog); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters