Skip to content

Commit

Permalink
[CHORE] 수정 실패 후 새로고침 복원, 사진 업로드 새로고침 버튼 구현 시도(일단은 어려울듯)
Browse files Browse the repository at this point in the history
  • Loading branch information
biiit4894 committed Sep 11, 2023
1 parent d40b71c commit 3499bfb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sgb_web/src/pages/components/PinkMypageEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function PinkMypageEdit({
alert("수정에 실패했습니다.");
console.log(error);
// 새로고침(필수값을 주지않았다던가 하는 등 api 통신요건을 만족시키지 못한 경우)
// location.reload();
location.reload();
});
} else {
return; // alert에서 취소를 누를 경우
Expand Down
4 changes: 4 additions & 0 deletions sgb_web/src/pages/components/PrizeImage.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
font-weight: 500;
font-size: 17px;
}

/* #refresh-icon {
width: 10px;
} */
9 changes: 9 additions & 0 deletions sgb_web/src/pages/components/PrizeImage.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { useRef, useState } from "react";
import "./PrizeImage.css";
import refresh from "./img/refresh.png";
const PrizeImage = ({ src, parentFunction }) => {
// const [originalImg, setOriginalImg] = useState(src);
const [image, setImage] = useState(src);
const onChange = (e) => {
setImage(e.target.files[0]);
Expand All @@ -13,6 +15,11 @@ const PrizeImage = ({ src, parentFunction }) => {
};
reader.readAsDataURL(e.target.files[0]);
};
// const handleCanceler = () => {
// console.log("originalImg: ", originalImg);
// setImage(originalImg);
// console.log("image: ", image);
// };
return (
<>
<div id="image-input-label">상장 이미지 수정</div>
Expand All @@ -25,6 +32,8 @@ const PrizeImage = ({ src, parentFunction }) => {
name="profile_img"
onChange={onChange}
/>
<br />
{/* <img id="refresh-icon" onClick={handleCanceler} src={refresh} /> */}
</>
);
};
Expand Down
Binary file added sgb_web/src/pages/components/img/refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3499bfb

Please sign in to comment.