Skip to content

Commit

Permalink
Merge pull request #8 from valentinpalkovic/feature/display-rendered-…
Browse files Browse the repository at this point in the history
…image-in-correct-size

feature: Add correct size to rendered image
  • Loading branch information
mertkahyaoglu authored Jun 17, 2020
2 parents d0a2b04 + d05642e commit 5c2725d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/ZeplinPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ interface ZeplinPanelProps {
interface ZeplinData {
name: string;
image: {
width: number;
height: number;
original_url: string;
};
updated: number;
Expand Down Expand Up @@ -118,7 +120,7 @@ const ZeplinPanel: React.FC<ZeplinPanelProps> = ({ zeplinLink }) => {

const {
name,
image: { original_url },
image: { original_url, width, height },
updated,
} = zeplinData;

Expand Down Expand Up @@ -160,6 +162,8 @@ const ZeplinPanel: React.FC<ZeplinPanelProps> = ({ zeplinLink }) => {
style={{ transform: `scale(${zoomLevel})` }}
src={original_url}
alt={name}
width={width}
height={height}
/>
</a>
</ImageContainer>
Expand Down Expand Up @@ -209,5 +213,4 @@ const Message = styled.p`

const Select = styled.select`
margin-right: 15px;
`;

`;

0 comments on commit 5c2725d

Please sign in to comment.