Skip to content

Commit

Permalink
Resolve some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
holly-cummins committed Jan 8, 2025
1 parent 7773158 commit 6a3ba3f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 34 deletions.
5 changes: 1 addition & 4 deletions src/components/List/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { icon } from "../../utils/type";
import { useTheme } from "../../layouts/theme";

const List = props => {
const { edges, showIcon, useShortDate } = props;
const { edges, showIcon = true, useShortDate } = props;
const theme = useTheme();

return (
Expand Down Expand Up @@ -91,8 +91,5 @@ List.propTypes = {
showIcon: PropTypes.bool
};

List.defaultProps = {
showIcon: true
};

export default List;
11 changes: 1 addition & 10 deletions src/components/Post/Post.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@ import React from "react";
import PropTypes from "prop-types";
import "prismjs/themes/prism-okaidia.css";

import asyncComponent from "../AsyncComponent";
import Headline from "../Article/Headline";
import Bodytext from "../Article/Bodytext";
import Meta from "./Meta";
import Author from "./Author";
import NextPrev from "./NextPrev";

const Share = asyncComponent(() =>
import("./Share")
.then(module => {
return module.default;
})
.catch(() => {
})
);
import Share from "./Share";

const Post = props => {
const {
Expand Down
6 changes: 0 additions & 6 deletions src/components/Post/Share.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,13 @@ const PostShare = props => {
<TwitterShareButton
url={url}
title={title}
additionalProps={{
"aria-label": "Twitter share"
}}
>
<TwitterIcon round size={iconSize} />
</TwitterShareButton>
<LinkedinShareButton
url={url}
title={title}
description={excerpt}
additionalProps={{
"aria-label": "LinkedIn share"
}}
>
<LinkedinIcon round size={iconSize} />
</LinkedinShareButton>
Expand Down
12 changes: 0 additions & 12 deletions src/pages/contact.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ import ContactPage from "./contact";

import config from "../utils/configger";

const layoutData = {
bgDesktop: {
resize: { src: "desktop" }
},
bgTablet: {
resize: { src: "tablet" }
},
bgMobile: {
resize: { src: "mobile" }
}
};

describe("ContactPage", () => {
beforeEach(async () => {
render(<ContactPage />);
Expand Down
4 changes: 2 additions & 2 deletions src/templates/PostTemplate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("PostTemplate", () => {

// Why is this each? See https://stackoverflow.com/questions/67669213/react-testing-library-using-beforeall-to-render-cannot-find-item-on-2nd-test
beforeEach(() => {
const tree = render(<PostTemplate data={data} pageContext={{}} />);
render(<PostTemplate data={data} pageContext={{}} />);
});

it("renders the post body", () => {
Expand Down Expand Up @@ -78,7 +78,7 @@ describe("PostTemplate", () => {

// Why is this each? See https://stackoverflow.com/questions/67669213/react-testing-library-using-beforeall-to-render-cannot-find-item-on-2nd-test
beforeEach(() => {
const tree = render(<PostTemplate data={data} pageContext={{}} />);
render(<PostTemplate data={data} pageContext={{}} />);
});

it("renders the title", () => {
Expand Down

0 comments on commit 6a3ba3f

Please sign in to comment.