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

팀 문서 & Navbar & 로그아웃 QA #85

Merged
merged 4 commits into from
Sep 24, 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 src/components/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const Block = ({
<S.BlockContainer
marginValue={remove ? '0' : '1'}
dayCount={dDay ?? 999}
isDone={progress === '완료'}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
Expand Down
7 changes: 6 additions & 1 deletion src/components/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import * as S from '../styles/ProfileStyled';
import defaultImage from '../img/default.png';

export type Props = {
width?: string;
height?: string;
profile?: string;
};
const Profile = ({ width, height, profile }: Props) => {
const handleImageError = (event: React.SyntheticEvent<HTMLImageElement>) => {
event.currentTarget.src = defaultImage; // 대체 이미지로 변경
};

return (
<S.ProfileImgWrapper width={width} height={height}>
<img src={profile} alt="프로필 이미지" />
<img src={profile} alt="프로필 이미지" onError={handleImageError} />
</S.ProfileImgWrapper>
);
};
Expand Down
5 changes: 2 additions & 3 deletions src/pages/MyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ const MyPage = () => {

//로그아웃
const onLogoutHandler = () => {
localStorage.removeItem('accessToken');
localStorage.removeItem('refreshToken');
navigate('/login');
localStorage.clear();
navigate('/');
};

// 처음 렌더링 시 팀 탭 데이터 호출
Expand Down
4 changes: 2 additions & 2 deletions src/pages/TeamDocument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ const TeamDocument = () => {
<Flex justifyContent="space-between">
<Flex>
<S.DocumentWriterImg>
<img src={info?.data.picture} alt="프로필 사진" />
<img src={data.picture} alt="프로필 사진" />
</S.DocumentWriterImg>
<S.DocumnetWriter>{info?.data.nickName}</S.DocumnetWriter>
<S.DocumnetWriter>{data.author}</S.DocumnetWriter>
</Flex>
{/* 팀 문서 삭제 */}
<DeleteIcon onClick={submitDelTeamDocument}>
Expand Down
42 changes: 34 additions & 8 deletions src/styles/DashboardStyled.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled } from 'styled-components';
import { styled, keyframes } from 'styled-components';
import theme from '../styles/Theme/Theme';
import rightArrowImg from '../img/rightarrow.png';

Expand All @@ -12,6 +12,21 @@ interface DashboardContainerProps {
text: string;
}

// 애니메이션 정의
const shake = keyframes`
/* 0% { transform: translateX(0); }
25% { transform: translate(-1.5px, -1.5px); }
50% { transform: translateX(1.5px); }
75% { transform: translate(-1.5px, -1.5px); }
100% { transform: translateX(0); } */


0% { transform: rotate(0deg); }
25% { transform: rotate(10deg)};
75%{transform: rotate(-10deg)};
100%{transform: rotate()(0deg)};

`;
export const DashboardContainer = styled.section<DashboardContainerProps>`
/* margin-bottom: 3.3125rem; */
/* overflow: hidden; */
Expand Down Expand Up @@ -175,7 +190,11 @@ export const GraphProgress = styled.div<{ blockProgress: number }>`
`;

/* 블록 스타일*/
export const BlockContainer = styled.div<{ marginValue: string; dayCount: number }>`
export const BlockContainer = styled.div<{
marginValue: string;
dayCount: number;
isDone: boolean;
}>`
background: ${theme.color.white};
padding: 1.375rem 1.375rem 1.375rem 1.375em;
border: 1px solid #f4f4f4;
Expand Down Expand Up @@ -210,13 +229,20 @@ export const BlockContainer = styled.div<{ marginValue: string; dayCount: number
}

span {
/* 날짜 색상 : 만료일 가까워지면 다른 스타일 */

font-size: ${theme.font.size.caption};
/* color: ${theme.color.gray}; */
/* font-weight: ${theme.font.weight.light}; */
/* 날짜 색상 : 만료일 가까워지면 빨갛고 두껍게 */
color: ${({ dayCount }) => (dayCount < 8 ? 'red' : theme.color.gray)};
font-weight: ${({ dayCount }) =>
dayCount < 4 ? theme.font.weight.bold : theme.font.weight.light};
color: ${theme.color.gray};
font-weight: ${theme.font.weight.light};

color: ${({ dayCount, isDone }) => (dayCount < 8 && !isDone ? 'red' : theme.color.gray)};
/* font-weight: ${({ dayCount }) =>
dayCount < 4 ? theme.font.weight.bold : theme.font.weight.light}; */

animation-name: ${({ dayCount, isDone }) => (dayCount < 8 && !isDone ? shake : 'none')};

animation-duration: 0.5s; /* 애니메이션 지속 시간 설정 */
animation-iteration-count: infinite; /* 애니메이션 반복 설정 */
}

&:hover {
Expand Down
1 change: 1 addition & 0 deletions src/styles/ProfileStyled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { styled } from 'styled-components';
import { Props } from '../components/Profile';

export const ProfileImgWrapper = styled.div<Props>`
min-width: ${props => props.width};
width: ${props => props.width};
height: ${props => props.height};
border-radius: 50%;
Expand Down