From 8614314b0002ec9874f81896adb77d9991aad264 Mon Sep 17 00:00:00 2001 From: "dennis.ludwig" Date: Tue, 28 Sep 2021 10:49:53 +0200 Subject: [PATCH] feat: upgrade minor and bug versions of dependencies --- .husky/pre-commit | 2 +- lint-staged.config.js | 4 +- src/components/Item/Item.test.tsx | 2 +- src/components/Item/Item.tsx | 36 ++++++++-------- src/components/ItemList/ItemList.tsx | 63 +++++++++++++--------------- 5 files changed, 52 insertions(+), 55 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index f332859..4cac0e3 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -yarn lint-staged && yarn build:scripts +yarn ts:check && yarn lint-staged && yarn build:scripts diff --git a/lint-staged.config.js b/lint-staged.config.js index 8e0a414..ebdd4c4 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,6 +1,6 @@ module.exports = { - "*.{json, md, yml, scss}": ["prettier --write"], - "*.{js, ts, tsx}": [ + "*.{json,md,yml,scss}": ["prettier --write"], + "*.{js,ts,tsx}": [ "eslint", "prettier --write", "react-scripts test --watchAll=false --findRelatedTests", diff --git a/src/components/Item/Item.test.tsx b/src/components/Item/Item.test.tsx index 4086e34..46cd31a 100644 --- a/src/components/Item/Item.test.tsx +++ b/src/components/Item/Item.test.tsx @@ -8,6 +8,6 @@ describe("Item", () => { it("Should render the item", () => { render(, { wrapper: MemoryRouter }); - expect(screen.queryByText(testItem.title)).not.toBeInTheDocument(); + expect(screen.queryByText(testItem.title)).toBeInTheDocument(); }); }); diff --git a/src/components/Item/Item.tsx b/src/components/Item/Item.tsx index 0669a32..5f5aa90 100644 --- a/src/components/Item/Item.tsx +++ b/src/components/Item/Item.tsx @@ -20,24 +20,24 @@ const Item: React.FC = ({ style = {}, greyedOut = false, }) => ( - // - //
- // {item.title} - // - //
- // {item.info &&
{item.info}
} - // + +
+ {item.title} + +
+ {item.info &&
{item.info}
} + ); export default Item; diff --git a/src/components/ItemList/ItemList.tsx b/src/components/ItemList/ItemList.tsx index 2e8e8e4..5f19431 100644 --- a/src/components/ItemList/ItemList.tsx +++ b/src/components/ItemList/ItemList.tsx @@ -1,10 +1,6 @@ import React from "react"; import Item from "../Item/Item"; -import { - featuredOnly, - nonFeaturedOnly, - Item as mItem, -} from "../../model"; +import { featuredOnly, nonFeaturedOnly, Item as mItem } from "../../model"; import "./item-list.scss"; type ItemListProps = { @@ -25,35 +21,36 @@ const ItemList: React.FC = ({ }) => { const featuredItems = featuredOnly(items); const nonFeaturedItems = nonFeaturedOnly(items); - + return ( -
-
- {children} +
+
+ {children} +
+
+ {featuredItems.map((item, i) => ( + + ))} + {nonFeaturedItems.map((item, i) => ( + + ))} +
-
- {featuredItems.map((item, i) => ( - // - ))} - {nonFeaturedItems.map((item, i) => ( - - ))} -
-
-);} + ); +}; export default ItemList;