├── components
├── SinglePostContainer.js
├── NoMorePosts.js
├── SearchWidget.js
├── CommentsWidgetContainer.js
├── Footer.js
├── Sidebar.js
├── Head.js
├── CategoriesWidget.js
├── SinglePost.js
├── Home.js
├── Post.js
├── PostPage.js
├── ScrollDown.js
├── SinglePostHeader.js
├── LoadMorePosts.js
├── CategoriesWidgetContainer.js
├── PostsWidget.js
├── SearchPage.js
├── Results.js
├── SingleComment.js
├── Main.js
├── Search.js
├── Hero.js
├── Spinner.js
├── CommentsWidget.js
├── Posts.js
├── SinglePostComments.js
├── SinglePostFooter.js
└── CommentForm.js
├── .gitignore
├── static
├── header.jpg
├── twentyNext.css
└── twentyseventeen.css
├── config.js
├── .tmuxinator.yml
├── redux
├── InitialState.js
├── helpers.js
├── index.js
├── readme.md
├── actions.js
└── reducers.js
├── .tern-project
├── wp.js
├── readme.md
├── package.json
└── pages
├── index.js
├── search.js
└── post.js
/components/SinglePostContainer.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | .next/
3 | yarn-error.log
4 |
--------------------------------------------------------------------------------
/static/header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixel2HTML/wp-nextjs/HEAD/static/header.jpg
--------------------------------------------------------------------------------
/config.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | export default {
4 | endpoint: 'https://examples.pixel2html.com/nextjs/wp-json'
5 | }
6 |
--------------------------------------------------------------------------------
/.tmuxinator.yml:
--------------------------------------------------------------------------------
1 | # ~/.tmuxinator/nextjs.yml
2 |
3 | name: nextjs
4 | root: ~/git/nextjs
5 | windows:
6 | - editor: vim
7 | - server: yarn run dev
8 |
--------------------------------------------------------------------------------
/redux/InitialState.js:
--------------------------------------------------------------------------------
1 | let initialState = {
2 | site: {},
3 | posts: [],
4 | activePost: {},
5 | searchResults: [],
6 | categories: [],
7 | comments: []
8 | }
9 |
10 | export default initialState
11 |
12 |
--------------------------------------------------------------------------------
/.tern-project:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": {
3 | "es_modules": {},
4 | "node": {}
5 | },
6 | "libs": [
7 | "ecma5",
8 | "ecma6",
9 | "browser",
10 | "react"
11 | ],
12 | "ecmaVersion": 6
13 | }
14 |
--------------------------------------------------------------------------------
/wp.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | import WPAPI from 'wpapi'
4 | import config from './config'
5 |
6 | const wp = new WPAPI({
7 | endpoint: config.endpoint
8 | })
9 |
10 | const Site = WPAPI.site(config.endpoint)
11 |
12 | export { Site }
13 |
14 | export default wp
15 |
--------------------------------------------------------------------------------
/components/NoMorePosts.js:
--------------------------------------------------------------------------------
1 | import { Component } from 'react'
2 |
3 | export default class NoMorePosts extends Component {
4 | render () {
5 | return (
6 |
9 | )
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/components/SearchWidget.js:
--------------------------------------------------------------------------------
1 | import { Component } from 'react'
2 | import Search from './Search'
3 |
4 | export default class SearchWidget extends Component {
5 | render () {
6 | return (
7 |
Sorry, but nothing matched your search terms. Please try again with some different keywords.
32 |
30 | {this.props.description}
37 |
65 | {this.renderComments(comments)} 66 |
67 |