From 465dad96cddf99aab9d5213064aee2e70db0342c Mon Sep 17 00:00:00 2001 From: M1ck0 Date: Thu, 11 Jun 2020 18:56:31 +0200 Subject: [PATCH 1/3] Fixed Avatar.js component where it would fail when fetching an image --- examples/cms-strapi/components/avatar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/cms-strapi/components/avatar.js b/examples/cms-strapi/components/avatar.js index 81b46a602c9e8..1e7ac84110789 100644 --- a/examples/cms-strapi/components/avatar.js +++ b/examples/cms-strapi/components/avatar.js @@ -3,8 +3,8 @@ export default function Avatar({ name, picture }) {
{name} From be5ec8229dffa881043f0552154ddaedbc9ae578 Mon Sep 17 00:00:00 2001 From: M1ck0 Date: Thu, 11 Jun 2020 23:58:59 +0200 Subject: [PATCH 2/3] Added checks for both picture and picture[0] --- examples/cms-strapi/components/avatar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/cms-strapi/components/avatar.js b/examples/cms-strapi/components/avatar.js index 1e7ac84110789..6a7957a8eb319 100644 --- a/examples/cms-strapi/components/avatar.js +++ b/examples/cms-strapi/components/avatar.js @@ -3,8 +3,10 @@ export default function Avatar({ name, picture }) {
{name} From c30dc7f4136b4b6ca652286622cb7ee383b529ba Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 11 Jun 2020 20:29:52 -0500 Subject: [PATCH 3/3] A bit better now --- examples/cms-strapi/components/avatar.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/cms-strapi/components/avatar.js b/examples/cms-strapi/components/avatar.js index 6a7957a8eb319..ce498fa5e0c95 100644 --- a/examples/cms-strapi/components/avatar.js +++ b/examples/cms-strapi/components/avatar.js @@ -1,12 +1,12 @@ export default function Avatar({ name, picture }) { + const url = picture.url ?? picture[0].url + return (
{name}