Skip to content

Commit

Permalink
[Fix]프로필 버그 수정
Browse files Browse the repository at this point in the history
회원정보에서 가입일시를 연월일,00:00양식으로 수정
현금에서 cashId가 있거나 에러가 없으면 리셋 기능만 활성화, cashId가 없거나 에러가 있으면 생성 기능만 활성화
회원탈퇴 정장작동
탭과 탭 콘텐츠의 배치 수정
Issues #70
  • Loading branch information
김병현 authored and 김병현 committed Sep 18, 2023
1 parent 6107704 commit ee444b4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
20 changes: 15 additions & 5 deletions client/src/components/Profile/memberInfoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ const MemberInfoModal: React.FC<MemberInfoModalProps> = ({ onClose }) => {
const emailText = "이메일: ";
const createdAtText = "회원 가입 일시: ";

const formatDate = (dateString: string) => {
const date = new Date(dateString);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 월은 0부터 시작하므로 1을 더해줍니다.
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');

return `${year}-${month}-${day} ${hours}:${minutes}`;
}

return (
<ModalBackground>
<ModalContainer>
Expand All @@ -21,7 +32,7 @@ const MemberInfoModal: React.FC<MemberInfoModalProps> = ({ onClose }) => {
<div>
<Content>{nameText}{memberInfo.name}</Content>
<Content>{emailText}{memberInfo.email}</Content>
<Content>{createdAtText}{memberInfo.createdAt}</Content>
<Content>{createdAtText}{formatDate(memberInfo.createdAt)}</Content>
</div>
) : (
<Content>Data not available</Content>
Expand All @@ -31,12 +42,12 @@ const MemberInfoModal: React.FC<MemberInfoModalProps> = ({ onClose }) => {
);
};

export default MemberInfoModal;


interface MemberInfoModalProps {
onClose: () => void;
}



// Styled Components Definitions:

const ModalBackground = styled.div`
Expand Down Expand Up @@ -89,4 +100,3 @@ const Content = styled.p`
text-align: center; // 텍스트 중앙 정렬
`;

export default MemberInfoModal;
14 changes: 7 additions & 7 deletions client/src/components/Profile/memberWithdrawalModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ const ModalContainer = styled.div`
background-color: white;
padding: 20px;
width: 400px;
min-height: 250px; // 높이를 최소 높이로 변경
height:230px;
border-radius: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
`;


const CloseButton = styled.button`
position: absolute;
top: 10px;
Expand All @@ -91,7 +91,7 @@ const CloseButton = styled.button`

const Title = styled.h2`
font-size: 1.6rem;
margin-bottom: 20px;
margin-bottom: 10px;
font-weight: 400;
`;

Expand All @@ -105,14 +105,14 @@ const Label = styled.label`

const PasswordInput = styled.input`
width: 100%;
padding: 10px;
padding: 5px;
border: 1px solid lightgray;
border-radius: 5px;
margin-bottom: 20px;
margin-bottom: 10px;
`;

const MessageWrapper = styled.div`
height: 20px; // 에러 메시지를 위한 공간 확보
height: 10px; // 에러 메시지 공간을 좀 더 확보합니다.
width: 100%;
display: flex;
justify-content: center;
Expand All @@ -134,6 +134,6 @@ const WithdrawalButton = styled.button`

const ErrorMessage = styled.p`
color: red;
margin: 0;
font-size: 0.8rem;
margin-bottom:5px;
`;
19 changes: 9 additions & 10 deletions client/src/components/Profile/profileModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ const ProfileModal: React.FC<ProfileModalProps> = ({ onClose }) => {
{selectedTab === 2 && <CashModal onClose={onClose} />}
{selectedTab === 3 && <MemberWithdrawalModal onErrorVisibility={handleErrorVisibility} onClose={onClose} />}
</TabContent>

</ModalContainer>
</ModalBackground>
);
);
};

export default ProfileModal;
Expand Down Expand Up @@ -59,24 +60,21 @@ const ModalBackground = styled.div`
const ModalContainer = styled.div`
z-index: 1001;
position: relative;
padding: 20px;
padding: 0px;
width: 400px;
height: 300px;
border-radius: 10px;
max-height : 800px;
display: flex;
flex-direction: column;
flex-direction: column;
align-items: center;
background-color: transparent; // 배경색을 투명하게 설정
border: none; // 테두리를 없앱니다.
background-color: none; // 배경색을 하얀색으로 변경
`;

const Tabs = styled.div`
display: flex;
justify-content: space-between;
width: 100%;
margin-bottom: 0px;
position: relative; // 위치를 조절하기 위한 속성
top: -33px; // 위로 30px 올립니다
z-index: 1002; // 이 값을 추가하여 Tabs를 최상위로 올립니다.
`;

Expand All @@ -100,6 +98,7 @@ const TabContent = styled.div<{ isErrorVisible: boolean }>`
align-items: center;
justify-content: flex-start;
overflow-y: auto;
position: relative;
min-height: ${({ isErrorVisible }) => isErrorVisible ? '400px' : '250px'}; // 에러 발생 시 높이 조절
position: top;
min-height: 200px;
`;

0 comments on commit ee444b4

Please sign in to comment.