Skip to content

Commit

Permalink
Merge pull request #85 from Team-Remini/feat/#84
Browse files Browse the repository at this point in the history
feat/#84/임시저장 버튼 제거
  • Loading branch information
yueunfive authored Dec 19, 2023
2 parents 4baa443 + c5bed45 commit 6b8c99c
Show file tree
Hide file tree
Showing 48 changed files with 0 additions and 284 deletions.
3 changes: 0 additions & 3 deletions src/components/StepByStep/AAR/AAR1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ export default function AAR1({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/AAR/AAR2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ export default function AAR2({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/AAR/AAR3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ export default function AAR3({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/AAR/AAR4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ export default function AAR4({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/Continue/Continue1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ export default function Continue1({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/Continue/Continue2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ export default function Continue2({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/Continue/Continue3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ export default function Continue3({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/FiveF/FiveF1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ export default function FiveF1({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/FiveF/FiveF2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ export default function FiveF2({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/FiveF/FiveF3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ export default function FiveF3({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/FiveF/FiveF4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ export default function FiveF4({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/FiveF/FiveF5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ export default function FiveF5({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/FourL/FourL1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ export default function FourL1({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/FourL/FourL2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ export default function FourL2({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/FourL/FourL3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ export default function FourL3({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/FourL/FourL4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ export default function FourL4({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
46 changes: 0 additions & 46 deletions src/components/StepByStep/KPT/KPT1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import React from "react";
import StepByStepWrap from "../StepByStepWrap";
import img1 from "../../../img/ProgressBar/KPT1.png";
import WritingPageBtnWrap from "../../WritingPageBtn";
import axios from "axios";
import { useNavigate } from "react-router-dom";

//Step by Step KPT 회고 페이지 1
interface KPT1Props {
Expand All @@ -23,7 +21,6 @@ export default function KPT1({
isContentFilled, // isContentFilled 속성 추가
setContent, // setContent 속성 추가
}: KPT1Props) {
const navigate = useNavigate();
const indexToFill = 0;

// 다음
Expand All @@ -38,42 +35,6 @@ export default function KPT1({
}
};

// 임시 저장
const tempStore = () => {
if (inputContent.trim().length > 0) {
if (inputContent.trim().length > 0) {
const updatedContent = [...content];
updatedContent[indexToFill] = inputContent;

const accessToken = localStorage.getItem("accessToken");

const data = {
instantSave: true,
sectionTexts: updatedContent,
step: indexToFill + 1,
title: localStorage.getItem("title"),
type: localStorage.getItem("type"),
};

// Axios를 사용한 POST 요청 보내기
axios
.post("https://www.remini.store/api/remini", data, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})
.then((response) => {
console.log("임시 저장 완료", response.data);
alert("임시 저장에 성공했습니다!");
navigate("/MyPage"); // MyPage로 이동
})
.catch((error) => {
console.error("임시 저장 실패:", error);
});
}
}
};

return (
<>
<StepByStepWrap>
Expand Down Expand Up @@ -108,13 +69,6 @@ export default function KPT1({
</div>
</div>
<WritingPageBtnWrap>
<button
className="temporary_btn"
disabled={!isContentFilled}
onClick={tempStore}
>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
46 changes: 0 additions & 46 deletions src/components/StepByStep/KPT/KPT2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import React from "react";
import StepByStepWrap from "../StepByStepWrap";
import img2 from "../../../img/ProgressBar/KPT2.png";
import WritingPageBtnWrap from "../../WritingPageBtn";
import axios from "axios";
import { useNavigate } from "react-router-dom";

//Step by Step KPT 회고 페이지 2
interface KPT2Props {
Expand All @@ -23,7 +21,6 @@ export default function KPT2({
isContentFilled, // isContentFilled 속성 추가
setContent, // setContent 속성 추가
}: KPT2Props) {
const navigate = useNavigate();
const indexToFill = 1;

// 다음
Expand All @@ -38,42 +35,6 @@ export default function KPT2({
}
};

// 임시 저장
const tempStore = () => {
if (inputContent.trim().length > 0) {
if (inputContent.trim().length > 0) {
const updatedContent = [...content];
updatedContent[indexToFill] = inputContent;

const accessToken = localStorage.getItem("accessToken");

const data = {
instantSave: true,
sectionTexts: updatedContent,
step: indexToFill + 1,
title: localStorage.getItem("title"),
type: localStorage.getItem("type"),
};

// Axios를 사용한 POST 요청 보내기
axios
.post("https://www.remini.store/api/remini", data, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})
.then((response) => {
console.log("임시 저장 완료", response.data);
alert("임시 저장에 성공했습니다!");
navigate("/MyPage"); // MyPage로 이동
})
.catch((error) => {
console.error("임시 저장 실패:", error);
});
}
}
};

return (
<>
<StepByStepWrap>
Expand Down Expand Up @@ -108,13 +69,6 @@ export default function KPT2({
</div>
</div>
<WritingPageBtnWrap>
<button
className="temporary_btn"
disabled={!isContentFilled}
onClick={tempStore}
>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
44 changes: 0 additions & 44 deletions src/components/StepByStep/KPT/KPT3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import StepByStepWrap from "../StepByStepWrap";
import img3 from "../../../img/ProgressBar/KPT3.png";
import WritingPageBtnWrap from "../../WritingPageBtn";
import { useNavigate } from "react-router-dom";
import axios from "axios";

//Step by Step KPT 회고 페이지 3
interface KPT3Props {
Expand Down Expand Up @@ -36,42 +35,6 @@ export default function KPT3({
}
};

// 임시 저장
const tempStore = () => {
if (inputContent.trim().length > 0) {
if (inputContent.trim().length > 0) {
const updatedContent = [...content];
updatedContent[indexToFill] = inputContent;

const accessToken = localStorage.getItem("accessToken");

const data = {
instantSave: true,
sectionTexts: updatedContent,
step: indexToFill + 1,
title: localStorage.getItem("title"),
type: localStorage.getItem("type"),
};

// Axios를 사용한 POST 요청 보내기
axios
.post("https://www.remini.store/api/remini", data, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})
.then((response) => {
console.log("임시 저장 완료", response.data);
alert("임시 저장에 성공했습니다!");
navigate("/MyPage"); // MyPage로 이동
})
.catch((error) => {
console.error("임시 저장 실패:", error);
});
}
}
};

return (
<>
<StepByStepWrap>
Expand Down Expand Up @@ -107,13 +70,6 @@ export default function KPT3({
</div>
</div>
<WritingPageBtnWrap>
<button
className="temporary_btn"
disabled={!isContentFilled}
onClick={tempStore}
>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/ORID/ORID1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ export default function ORID1({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
3 changes: 0 additions & 3 deletions src/components/StepByStep/ORID/ORID2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ export default function ORID2({
</div>
</div>
<WritingPageBtnWrap>
<button className="temporary_btn" disabled={!isContentFilled}>
임시 저장
</button>
<button
className="completed_btn"
style={{
Expand Down
Loading

0 comments on commit 6b8c99c

Please sign in to comment.