Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 7058ef7

Browse files
committed
Add jsdocs to archives, remove logs
1 parent 53ec459 commit 7058ef7

File tree

7 files changed

+112
-68
lines changed

7 files changed

+112
-68
lines changed

pages/blog/[[...slug]].js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ import getArchivePosts from '@/api/frontend/wp/archive/getArchivePosts'
99
// Define route post type.
1010
const postType = 'post'
1111

12+
/**
13+
* Render the BlogPost component.
14+
*
15+
* @author WebDevStudios
16+
* @param {object} props The component attributes as props.
17+
* @param {object} props.post Post data from WordPress.
18+
* @param {boolean} props.archive Whether displaying single post (false) or archive (true).
19+
* @param {Array} props.posts Array of post data from WordPress.
20+
* @param {object} props.pagination Archive pagination data from WordPress.
21+
* @return {Element} The BlogPost component.
22+
*/
1223
export default function BlogPost({post, archive, posts, pagination}) {
1324
/**
1425
* Load more posts for archive.
1526
*/
1627
async function loadPosts() {
17-
const response = await getArchivePosts(postType, pagination?.endCursor)
18-
1928
// TODO: use response to display next "page" of posts.
20-
console.log(response)
29+
await getArchivePosts(postType, pagination?.endCursor)
2130
}
2231

2332
// Check for post archive.
@@ -112,7 +121,7 @@ export default function BlogPost({post, archive, posts, pagination}) {
112121
* Get post static paths.
113122
*
114123
* @author WebDevStudios
115-
* @return {Object} Object consisting of array of paths and fallback setting.
124+
* @return {object} Object consisting of array of paths and fallback setting.
116125
*/
117126
export async function getStaticPaths() {
118127
return await getPostTypeStaticPaths(postType)
@@ -121,11 +130,9 @@ export async function getStaticPaths() {
121130
/**
122131
* Get post static props.
123132
*
124-
* @param {Object} context Context for current post.
125-
* @param {Object} context.params Route parameters for current post.
126-
* @param {boolean} context.preview Whether requesting preview of post.
127-
* @param {Object} context.previewData Post preview data.
128-
* @return {Object} Post props.
133+
* @param {object} context Context for current post.
134+
* @param {object} context.params Route parameters for current post.
135+
* @return {object} Post props.
129136
*/
130137
export async function getStaticProps({params}) {
131138
return getPostTypeStaticProps(params, postType)

pages/careers/[[...slug]].js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ import getArchivePosts from '@/api/frontend/wp/archive/getArchivePosts'
99
// Define route post type.
1010
const postType = 'career'
1111

12+
/**
13+
* Render the BlogPost component.
14+
*
15+
* @author WebDevStudios
16+
* @param {object} props The component attributes as props.
17+
* @param {object} props.post Post data from WordPress.
18+
* @param {boolean} props.archive Whether displaying single post (false) or archive (true).
19+
* @param {Array} props.posts Array of post data from WordPress.
20+
* @param {object} props.pagination Archive pagination data from WordPress.
21+
* @return {Element} The BlogPost component.
22+
*/
1223
export default function Career({post, archive, posts, pagination}) {
1324
/**
1425
* Load more posts for archive.
1526
*/
1627
async function loadPosts() {
17-
const response = await getArchivePosts(postType, pagination?.endCursor)
18-
1928
// TODO: use response to display next "page" of posts.
20-
console.log(response)
29+
await getArchivePosts(postType, pagination?.endCursor)
2130
}
2231

2332
// Check for post archive.
@@ -112,7 +121,7 @@ export default function Career({post, archive, posts, pagination}) {
112121
* Get post static paths.
113122
*
114123
* @author WebDevStudios
115-
* @return {Object} Object consisting of array of paths and fallback setting.
124+
* @return {object} Object consisting of array of paths and fallback setting.
116125
*/
117126
export async function getStaticPaths() {
118127
return await getPostTypeStaticPaths(postType)
@@ -121,11 +130,9 @@ export async function getStaticPaths() {
121130
/**
122131
* Get post static props.
123132
*
124-
* @param {Object} context Context for current post.
125-
* @param {Object} context.params Route parameters for current post.
126-
* @param {boolean} context.preview Whether requesting preview of post.
127-
* @param {Object} context.previewData Post preview data.
128-
* @return {Object} Post props.
133+
* @param {object} context Context for current post.
134+
* @param {object} context.params Route parameters for current post.
135+
* @return {object} Post props.
129136
*/
130137
export async function getStaticProps({params}) {
131138
return getPostTypeStaticProps(params, postType)

pages/events/[[...slug]].js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ import getArchivePosts from '@/api/frontend/wp/archive/getArchivePosts'
99
// Define route post type.
1010
const postType = 'event'
1111

12+
/**
13+
* Render the BlogPost component.
14+
*
15+
* @author WebDevStudios
16+
* @param {object} props The component attributes as props.
17+
* @param {object} props.post Post data from WordPress.
18+
* @param {boolean} props.archive Whether displaying single post (false) or archive (true).
19+
* @param {Array} props.posts Array of post data from WordPress.
20+
* @param {object} props.pagination Archive pagination data from WordPress.
21+
* @return {Element} The BlogPost component.
22+
*/
1223
export default function Event({post, archive, posts, pagination}) {
1324
/**
1425
* Load more posts for archive.
1526
*/
1627
async function loadPosts() {
17-
const response = await getArchivePosts(postType, pagination?.endCursor)
18-
1928
// TODO: use response to display next "page" of posts.
20-
console.log(response)
29+
await getArchivePosts(postType, pagination?.endCursor)
2130
}
2231

2332
// Check for post archive.
@@ -112,7 +121,7 @@ export default function Event({post, archive, posts, pagination}) {
112121
* Get post static paths.
113122
*
114123
* @author WebDevStudios
115-
* @return {Object} Object consisting of array of paths and fallback setting.
124+
* @return {object} Object consisting of array of paths and fallback setting.
116125
*/
117126
export async function getStaticPaths() {
118127
return await getPostTypeStaticPaths(postType)
@@ -121,12 +130,9 @@ export async function getStaticPaths() {
121130
/**
122131
* Get post static props.
123132
*
124-
* @author WebDevStudios
125-
* @param {Object} context Context for current post.
126-
* @param {Object} context.params Route parameters for current post.
127-
* @param {boolean} context.preview Whether requesting preview of post.
128-
* @param {Object} context.previewData Post preview data.
129-
* @return {Object} Post props.
133+
* @param {object} context Context for current post.
134+
* @param {object} context.params Route parameters for current post.
135+
* @return {object} Post props.
130136
*/
131137
export async function getStaticProps({params}) {
132138
return getPostTypeStaticProps(params, postType)

pages/portfolio/[[...slug]].js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ import getArchivePosts from '@/api/frontend/wp/archive/getArchivePosts'
99
// Define route post type.
1010
const postType = 'portfolio'
1111

12+
/**
13+
* Render the BlogPost component.
14+
*
15+
* @author WebDevStudios
16+
* @param {object} props The component attributes as props.
17+
* @param {object} props.post Post data from WordPress.
18+
* @param {boolean} props.archive Whether displaying single post (false) or archive (true).
19+
* @param {Array} props.posts Array of post data from WordPress.
20+
* @param {object} props.pagination Archive pagination data from WordPress.
21+
* @return {Element} The BlogPost component.
22+
*/
1223
export default function Portfolio({post, archive, posts, pagination}) {
1324
/**
1425
* Load more posts for archive.
1526
*/
1627
async function loadPosts() {
17-
const response = await getArchivePosts(postType, pagination?.endCursor)
18-
1928
// TODO: use response to display next "page" of posts.
20-
console.log(response)
29+
await getArchivePosts(postType, pagination?.endCursor)
2130
}
2231

2332
// Check for post archive.
@@ -112,7 +121,7 @@ export default function Portfolio({post, archive, posts, pagination}) {
112121
* Get post static paths.
113122
*
114123
* @author WebDevStudios
115-
* @return {Object} Object consisting of array of paths and fallback setting.
124+
* @return {object} Object consisting of array of paths and fallback setting.
116125
*/
117126
export async function getStaticPaths() {
118127
return await getPostTypeStaticPaths(postType)
@@ -121,12 +130,9 @@ export async function getStaticPaths() {
121130
/**
122131
* Get post static props.
123132
*
124-
* @author WebDevStudios
125-
* @param {Object} context Context for current post.
126-
* @param {Object} context.params Route parameters for current post.
127-
* @param {boolean} context.preview Whether requesting preview of post.
128-
* @param {Object} context.previewData Post preview data.
129-
* @return {Object} Post props.
133+
* @param {object} context Context for current post.
134+
* @param {object} context.params Route parameters for current post.
135+
* @return {object} Post props.
130136
*/
131137
export async function getStaticProps({params}) {
132138
return getPostTypeStaticProps(params, postType)

pages/service/[[...slug]].js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ import getArchivePosts from '@/api/frontend/wp/archive/getArchivePosts'
99
// Define route post type.
1010
const postType = 'service'
1111

12+
/**
13+
* Render the BlogPost component.
14+
*
15+
* @author WebDevStudios
16+
* @param {object} props The component attributes as props.
17+
* @param {object} props.post Post data from WordPress.
18+
* @param {boolean} props.archive Whether displaying single post (false) or archive (true).
19+
* @param {Array} props.posts Array of post data from WordPress.
20+
* @param {object} props.pagination Archive pagination data from WordPress.
21+
* @return {Element} The BlogPost component.
22+
*/
1223
export default function Service({post, archive, posts, pagination}) {
1324
/**
1425
* Load more posts for archive.
1526
*/
1627
async function loadPosts() {
17-
const response = await getArchivePosts(postType, pagination?.endCursor)
18-
1928
// TODO: use response to display next "page" of posts.
20-
console.log(response)
29+
await getArchivePosts(postType, pagination?.endCursor)
2130
}
2231

2332
// Check for post archive.
@@ -112,7 +121,7 @@ export default function Service({post, archive, posts, pagination}) {
112121
* Get post static paths.
113122
*
114123
* @author WebDevStudios
115-
* @return {Object} Object consisting of array of paths and fallback setting.
124+
* @return {object} Object consisting of array of paths and fallback setting.
116125
*/
117126
export async function getStaticPaths() {
118127
return await getPostTypeStaticPaths(postType)
@@ -121,12 +130,9 @@ export async function getStaticPaths() {
121130
/**
122131
* Get post static props.
123132
*
124-
* @author WebDevStudios
125-
* @param {Object} context Context for current post.
126-
* @param {Object} context.params Route parameters for current post.
127-
* @param {boolean} context.preview Whether requesting preview of post.
128-
* @param {Object} context.previewData Post preview data.
129-
* @return {Object} Post props.
133+
* @param {object} context Context for current post.
134+
* @param {object} context.params Route parameters for current post.
135+
* @return {object} Post props.
130136
*/
131137
export async function getStaticProps({params}) {
132138
return getPostTypeStaticProps(params, postType)

pages/team/[[...slug]].js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ import getArchivePosts from '@/api/frontend/wp/archive/getArchivePosts'
99
// Define route post type.
1010
const postType = 'team'
1111

12+
/**
13+
* Render the BlogPost component.
14+
*
15+
* @author WebDevStudios
16+
* @param {object} props The component attributes as props.
17+
* @param {object} props.post Post data from WordPress.
18+
* @param {boolean} props.archive Whether displaying single post (false) or archive (true).
19+
* @param {Array} props.posts Array of post data from WordPress.
20+
* @param {object} props.pagination Archive pagination data from WordPress.
21+
* @return {Element} The BlogPost component.
22+
*/
1223
export default function Team({post, archive, posts, pagination}) {
1324
/**
1425
* Load more posts for archive.
1526
*/
1627
async function loadPosts() {
17-
const response = await getArchivePosts(postType, pagination?.endCursor)
18-
1928
// TODO: use response to display next "page" of posts.
20-
console.log(response)
29+
await getArchivePosts(postType, pagination?.endCursor)
2130
}
2231

2332
// Check for post archive.
@@ -112,7 +121,7 @@ export default function Team({post, archive, posts, pagination}) {
112121
* Get post static paths.
113122
*
114123
* @author WebDevStudios
115-
* @return {Object} Object consisting of array of paths and fallback setting.
124+
* @return {object} Object consisting of array of paths and fallback setting.
116125
*/
117126
export async function getStaticPaths() {
118127
return await getPostTypeStaticPaths(postType)
@@ -121,12 +130,9 @@ export async function getStaticPaths() {
121130
/**
122131
* Get post static props.
123132
*
124-
* @author WebDevStudios
125-
* @param {Object} context Context for current post.
126-
* @param {Object} context.params Route parameters for current post.
127-
* @param {boolean} context.preview Whether requesting preview of post.
128-
* @param {Object} context.previewData Post preview data.
129-
* @return {Object} Post props.
133+
* @param {object} context Context for current post.
134+
* @param {object} context.params Route parameters for current post.
135+
* @return {object} Post props.
130136
*/
131137
export async function getStaticProps({params}) {
132138
return getPostTypeStaticProps(params, postType)

pages/testimonial/[[...slug]].js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ import getArchivePosts from '@/api/frontend/wp/archive/getArchivePosts'
99
// Define route post type.
1010
const postType = 'testimonial'
1111

12+
/**
13+
* Render the BlogPost component.
14+
*
15+
* @author WebDevStudios
16+
* @param {object} props The component attributes as props.
17+
* @param {object} props.post Post data from WordPress.
18+
* @param {boolean} props.archive Whether displaying single post (false) or archive (true).
19+
* @param {Array} props.posts Array of post data from WordPress.
20+
* @param {object} props.pagination Archive pagination data from WordPress.
21+
* @return {Element} The BlogPost component.
22+
*/
1223
export default function Testimonial({post, archive, posts, pagination}) {
1324
/**
1425
* Load more posts for archive.
1526
*/
1627
async function loadPosts() {
17-
const response = await getArchivePosts(postType, pagination?.endCursor)
18-
1928
// TODO: use response to display next "page" of posts.
20-
console.log(response)
29+
await getArchivePosts(postType, pagination?.endCursor)
2130
}
2231

2332
// Check for post archive.
@@ -112,7 +121,7 @@ export default function Testimonial({post, archive, posts, pagination}) {
112121
* Get post static paths.
113122
*
114123
* @author WebDevStudios
115-
* @return {Object} Object consisting of array of paths and fallback setting.
124+
* @return {object} Object consisting of array of paths and fallback setting.
116125
*/
117126
export async function getStaticPaths() {
118127
return await getPostTypeStaticPaths(postType)
@@ -121,12 +130,9 @@ export async function getStaticPaths() {
121130
/**
122131
* Get post static props.
123132
*
124-
* @author WebDevStudios
125-
* @param {Object} context Context for current post.
126-
* @param {Object} context.params Route parameters for current post.
127-
* @param {boolean} context.preview Whether requesting preview of post.
128-
* @param {Object} context.previewData Post preview data.
129-
* @return {Object} Post props.
133+
* @param {object} context Context for current post.
134+
* @param {object} context.params Route parameters for current post.
135+
* @return {object} Post props.
130136
*/
131137
export async function getStaticProps({params}) {
132138
return getPostTypeStaticProps(params, postType)

0 commit comments

Comments
 (0)