From 1612b6606239b20616a8e6aaadbbf2eca30ffe3c Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Wed, 2 Oct 2019 12:18:02 +0100 Subject: [PATCH 1/3] Pass building_like down to data components --- app/src/frontend/building/data-container.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 192baad3..c190119e 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -221,6 +221,7 @@ const withCopyEdit = (WrappedComponent) => { } Date: Wed, 2 Oct 2019 12:18:22 +0100 Subject: [PATCH 2/3] Name building_like consistently in Like container --- app/src/frontend/building/data-containers/like.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-containers/like.tsx b/app/src/frontend/building/data-containers/like.tsx index 62975715..952bb033 100644 --- a/app/src/frontend/building/data-containers/like.tsx +++ b/app/src/frontend/building/data-containers/like.tsx @@ -12,7 +12,7 @@ const LikeView = (props) => ( value={props.building.likes_total} mode={props.mode} onLike={props.onLike} - user_building_like={props.building_like} + building_like={props.building_like} /> ) From 9ba928b5e120d8bdd5eca934d1ca35ebb8175db3 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Wed, 2 Oct 2019 12:19:42 +0100 Subject: [PATCH 3/3] Run onLike when checking/unchecking like building --- app/src/frontend/building/data-components/like-data-entry.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-components/like-data-entry.tsx b/app/src/frontend/building/data-components/like-data-entry.tsx index cafc6868..201f6e83 100644 --- a/app/src/frontend/building/data-components/like-data-entry.tsx +++ b/app/src/frontend/building/data-components/like-data-entry.tsx @@ -32,7 +32,7 @@ const LikeDataEntry: React.FunctionComponent = (props) => { // TODO: remove id="like" name="like" checked={!!props.building_like} disabled={props.mode === 'view'} - onChange={props.handleLike} + onChange={props.onLike} />