Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] 불필요한 console.log 코드 제거 및 Error 방식 통일 및 README 파일 일부 수정 #106

Merged
merged 2 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ URL: https://sp4-team16-rolling.netlify.app
- 단위(px->rem) refactoring 진행
- Size, Color, Font, Option 등 상수화 작업 및 적용
- 일부 수치조정 과정에서 발생하는 디자인 오류 수정 및 개선
- 코드 스타일링: 불필요한 코드 제거 및 error 반환 방식 통일
- 팀 repository 생성 및 issues, label 등 초기 세팅 설정
- issues 항목 설정
- label 카테고리 생성
Expand Down
6 changes: 4 additions & 2 deletions src/components/EditMessage/EditMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ const FormContainer = styled.div`

function EditMessage() {
const [buttonDisabled, setButtonDisabled] = useState(true);
console.log(buttonDisabled);

return (
<div>
<Header />
<FormContainer>
<EditForm isBtnDisabled={(isContent) => setButtonDisabled(isContent)} />
<EditForm
isBtnDisabled={(isContent) => setButtonDisabled(isContent)}
disabled={buttonDisabled}
/>
</FormContainer>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/WritingMessage/WritingForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ function WritingForm({ isBtnDisabled }) {
content: contents,
font: fonts,
};
console.log(data);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이제는 지워도 되는 상황이었네요! 제가 까먹고 못 지웠는데 해결해주셔서 감사합니다 =)

const response = await submitMessagePost(recipientID, data);
return response.recipientId;
}}
Expand Down
2 changes: 1 addition & 1 deletion src/components/WritingMessage/WritingMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ const FormContainer = styled.div`

function WritingMessage() {
const [buttonDisabled, setButtonDisabled] = useState(true);
console.log(buttonDisabled);

return (
<div>
<Header />
<FormContainer>
<WritingForm
isBtnDisabled={(isContent) => setButtonDisabled(isContent)}
disabled={buttonDisabled}
/>
</FormContainer>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/list/RecipientCard.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';

import styled, { css } from 'styled-components';
import WrittenByIcons from '../post/subheader/WrittenByIcons';
import { getAllMessages } from '../../api/GetApi';
Expand All @@ -22,7 +23,7 @@ function RecipientCard({ recipient }) {
const result = await getAllMessages(recipient.id);
setMessages(result.results);
} catch (error) {
console.error('메시지를 불러오는데 실패했습니다:', error);
throw new Error('메시지를 불러오는데 실패했습니다:', error);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/post/subheader/EmojiDropDown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function EmojiDropDown() {
}));
setBadges(data);
} catch (error) {
console.error('Failed to fetch data', error);
throw new Error('Failed to fetch data', error);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function List() {
setPopularRecipients(sortedByPopularity);
setRecentRecipients(sortedByRecent);
} catch (error) {
console.error('롤링페이퍼를 불러오지 못했습니다.', error);
throw new Error('롤링페이퍼를 불러오지 못했습니다.', error);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/PostId.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function PostId() {
const result = await getRecipientData(id);
setData(result);
} catch (error) {
// console.error(error);
throw new Error('데이터를 불러오지 못했습니다.', error);
}
};

Expand Down