Skip to content

Commit

Permalink
code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mogmarsh committed Dec 4, 2023
1 parent 450a8bc commit 76c15da
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 32 deletions.
3 changes: 1 addition & 2 deletions blocks/post-content/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
"title": "Newsletter Post Content",
"category": "design",
"icon": "admin-post",
"description": "Displays a post content",
"description": "Displays the contents of a post.",
"textdomain": "wp-newsletter-builder",
"editorScript": "file:index.ts",
"editorStyle": "file:index.css",
"style": [
"file:style-index.css"
],
Expand Down
4 changes: 1 addition & 3 deletions blocks/post-content/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { __ } from '@wordpress/i18n';
import { RichText, useBlockProps } from '@wordpress/block-editor';
import { WP_REST_API_Post } from 'wp-types';

import './index.scss';

interface EditProps {
attributes: {
overrideContent?: string;
Expand Down Expand Up @@ -33,7 +31,7 @@ export default function Edit({
},
setAttributes,
}: EditProps) {
// @ts-ignore
// @ts-ignore - WP_REST_API_Post is not in CamelCase.
const record: WP_REST_API_Post = usePostById(postId) ?? null;

let postContent = record ? record.content.rendered : __('<p>This block will display the content.</p>', 'wp-newsletter-builder');
Expand Down
9 changes: 0 additions & 9 deletions blocks/post-content/index.scss

This file was deleted.

2 changes: 0 additions & 2 deletions blocks/post-content/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ registerBlockType(
/* @ts-expect-error Provided types are inaccurate to the actual plugin API. */
metadata,
{
apiVersion: 2,
edit,
title: metadata.title,
},
);
1 change: 0 additions & 1 deletion blocks/post-read-more/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"description": "Displays a post read more button",
"textdomain": "wp-newsletter-builder",
"editorScript": "file:index.ts",
"editorStyle": "file:index.css",
"style": [
"file:style-index.css"
],
Expand Down
4 changes: 0 additions & 4 deletions blocks/post-read-more/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import { __ } from '@wordpress/i18n';
import { RichText, useBlockProps } from '@wordpress/block-editor';

import './index.scss';

interface EditProps {
attributes: {
readMoreText?: string;
Expand All @@ -28,8 +26,6 @@ export default function Edit({
},
setAttributes,
}: EditProps) {
// @ts-ignore

const buttonText = readMoreText || __('Read More', 'wp-newsletter-builder');

return (
Expand Down
9 changes: 0 additions & 9 deletions blocks/post-read-more/index.scss

This file was deleted.

2 changes: 0 additions & 2 deletions blocks/post-read-more/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ registerBlockType(
/* @ts-expect-error Provided types are inaccurate to the actual plugin API. */
metadata,
{
apiVersion: 2,
edit,
title: metadata.title,
},
);

0 comments on commit 76c15da

Please sign in to comment.