Skip to content

Commit

Permalink
Merge pull request #23 from petergeorgas/feature/preserve_image_aspec…
Browse files Browse the repository at this point in the history
…t_ratio

Preserve aspect ratio
  • Loading branch information
petergeorgas authored Oct 29, 2021
2 parents 0b6dda7 + 3b0bf4f commit 6c72158
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
12 changes: 11 additions & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,21 @@
border-radius: 12px;
}

.image-div {
display: flex;
width: 350px;
height: 220px;
justify-content: center;
align-items: center;
}

#uploaded-img {
max-width: 350px;
max-height: 220px;
border-radius: 12px;
border-radius: 12px;
border: 2px solid #97bef4;
box-sizing: border-box;
border-radius: 12px;
margin-bottom: 0;
}

Expand Down
10 changes: 2 additions & 8 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,10 @@ function App() {
</div>
</div>
) : (
<div>
<div className="image-div">
<div {...getRootProps()}>
<input {...getInputProps()} />
<img
id="uploaded-img"
src={file}
width={350}
height={220}
alt="Uploaded image"
/>
<img id="uploaded-img" src={file} alt="Uploaded image" />
</div>
</div>
)}
Expand Down
5 changes: 2 additions & 3 deletions src/components/Success.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ function Success(props) {
<div className="flex-container-inner">
<img src={cloud_done} className="success-icon" alt="success icon" />
<h2 className="box-header">Upload successful.</h2>
<div>
<div className="image-div ">
<img
id="uploaded-img"
src={imgUrl}
width={350}
height={220}
alt="uploaded image from cloud"
style={{ marginBottom: "20px" }}
/>
</div>
<div className="link-box">
Expand Down

0 comments on commit 6c72158

Please sign in to comment.