From d05642ea96865f7209dbb97135dfefe36d2b3744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Palkovi=C4=8D?= Date: Wed, 17 Jun 2020 17:01:01 +0200 Subject: [PATCH] feature: Add correct size to rendered image The image of a component will be rendered now with the correct size --- src/components/ZeplinPanel.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/ZeplinPanel.tsx b/src/components/ZeplinPanel.tsx index fa37ea1..9d997d5 100644 --- a/src/components/ZeplinPanel.tsx +++ b/src/components/ZeplinPanel.tsx @@ -18,6 +18,8 @@ interface ZeplinPanelProps { interface ZeplinData { name: string; image: { + width: number; + height: number; original_url: string; }; updated: number; @@ -118,7 +120,7 @@ const ZeplinPanel: React.FC = ({ zeplinLink }) => { const { name, - image: { original_url }, + image: { original_url, width, height }, updated, } = zeplinData; @@ -160,6 +162,8 @@ const ZeplinPanel: React.FC = ({ zeplinLink }) => { style={{ transform: `scale(${zoomLevel})` }} src={original_url} alt={name} + width={width} + height={height} /> @@ -209,5 +213,4 @@ const Message = styled.p` const Select = styled.select` margin-right: 15px; -`; - +`; \ No newline at end of file