Skip to content

Commit

Permalink
10
Browse files Browse the repository at this point in the history
  • Loading branch information
cowboysj committed Aug 19, 2023
1 parent b5a3d86 commit 58449af
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 21 deletions.
1 change: 1 addition & 0 deletions src/MakeSticker/STICKER.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const STICKER = () => {
useEffect(() => {
if (captureEnabled) {
handleCaptureImg();
dispatch(setCaptureEnabled(false));
}
}, [captureEnabled]);

Expand Down
6 changes: 3 additions & 3 deletions src/MakeSticker/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const Select = ({ handleCaptureImg }) => {
setSetting(true);
} else setModalIsOpen(true);
}
dispatch(setCaptureEnabled(isEnabled));
dispatch(setCaptureEnabled(true));
if (changesticker) {
setSetting(true);
} else {
Expand All @@ -102,7 +102,7 @@ const Select = ({ handleCaptureImg }) => {
};

//방문자가 완료 누를 때
const captureVisitor = (isEnabled) => {
const captureVisitor = () => {
if (
//방문자가 아무것도 선택 안 했으면 캡쳐 하지 말고 기본 이미지 저장
stickerState.face === 0 &&
Expand All @@ -115,7 +115,7 @@ const Select = ({ handleCaptureImg }) => {
) {
dispatch(setImageUrl("https://i.ibb.co/3yhK7VW/1-2.png"));
} else {
dispatch(setCaptureEnabled(isEnabled));
dispatch(setCaptureEnabled(true));
}

/* navigate("/stickername", { state: { test: test2 } }); */
Expand Down
25 changes: 11 additions & 14 deletions src/Nickname/StickerName.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ export function StickerName() {
const [inputTop, setInputTop] = useState("-2%");
const [nicknameValue, setNicknameValue] = useState("");

/* const { state } = useLocation();
const { state } = useLocation();
console.log("State", state.test);
const VID = state.test;
*/

//방문자 스티커

const visitorId = useSelector((state) => state.visitorId);
Expand Down Expand Up @@ -248,29 +248,26 @@ export function StickerName() {
//닉네임 입력하고 다음 아이콘 누르면 서버에 전송됨
const handleNicknameSubmit = () => {
console.log(visitorId);
fetch(
`http://app.faceticker.site/${ID}/sticker/visitor/name?id=${visitorId}`,
{
method: "PATCH",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ name: nicknameValue }),
}
)
fetch(`http://app.faceticker.site/${ID}/sticker/visitor/name?id=${VID}`, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ name: nicknameValue }),
})
.then((response) => response.json())
.then((data) => {
console.log("성공", data);
})
.catch((error) => {
console.error("실패", error);
});
navigate("/stickerletter" /* , { state: { visitor: VID } } */);
navigate("/stickerletter", { state: { visitor: VID } });
};

//서버에서 닉네임 값 받아오기
useEffect(() => {
fetch(`https://app.faceticker.site/sticker/visitor/name?id=${visitorId}`)
fetch(`https://app.faceticker.site/sticker/visitor/name?id=${VID}`)
.then((response) => response.json())
.then((data) => {
if (data) {
Expand Down
2 changes: 1 addition & 1 deletion src/Stickers/TestBottom.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const Bottoms = styled.div`
height: 90%;
background-image: url("${getRandomImageLink()}");
overflow: scroll;
/* overflow: scroll; */
`;

const Bottom = styled.div`
Expand Down
4 changes: 2 additions & 2 deletions src/Stickers/VisitPut.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ const Footer = styled.div`
flex-direction: row;
`;
const Icon = styled.img`
max-height: 48%;
max-width: 80%;
max-height: 65%;
display: flex;
`;

Expand Down Expand Up @@ -230,7 +231,6 @@ export function VisitPut(props) {
<img src={middle} />
</MiddleImg>
<Footer>
<Icon onClick={reset} src={changeIcon} />
<Icon onClick={handleButtonClick} src={putcomplete} />
</Footer>
</ButtonWrap>
Expand Down
2 changes: 1 addition & 1 deletion src/hostStatus/StatusMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const ImgWrap = styled.div`
display: flex;
`;
const Letter = styled.img`
width: 80%;
max-height: 100%;
`;

const InputWrap = styled.div`
Expand Down

0 comments on commit 58449af

Please sign in to comment.