From d13e23e15d99b47c28e61e8c8dc534851c2f5aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Thu, 22 Feb 2018 02:08:18 +0000 Subject: [PATCH] fix(my-joy-beta): make logo click trigger change --- .../src/components/create-instance/image.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/my-joy-beta/src/components/create-instance/image.js b/packages/my-joy-beta/src/components/create-instance/image.js index bae1316c..5c511c01 100644 --- a/packages/my-joy-beta/src/components/create-instance/image.js +++ b/packages/my-joy-beta/src/components/create-instance/image.js @@ -48,18 +48,23 @@ export const Preview = ({ name, version, isVm }) => ( const Image = ({ onClick, active, ...image }) => { const { imageName = '', versions = [] } = image; - const ids = [`image-card-${imageName}`, `image-img-${imageName}`]; + const id = `image-card-${imageName}`; - const handleClick = ev => - includes(ids, ev.target.id) ? onClick(image) : null; + const handleCardClick = ev => { + return ev.target.id === id ? onClick(image) : null; + }; + + const handleLogoClick = ev => { + return onClick(image); + }; const Logo = Assets[pascalCase(imageName)] || Assets.Placeholder; return ( - - + +

{titleCase(imageName)}