Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
4fd146e
fix : 공고 상세 페이지에서 다른 페이지로 이동 후 다시 돌아오면 발생하는 날짜 포맷 에러 수정
layout-SY May 17, 2025
afc5840
style : 댓글 컴포넌트 드롭다운을 헤더의 프로필 드롭다운과 통일
layout-SY May 17, 2025
23245fc
refactor : 일반 모달에 연결 되어 있던 신고하기 모달 훅 따로 빼기
layout-SY May 17, 2025
1f758f0
feat : 로그인한 유저만 댓글에 대한 신고 이상의 기능 사용하게 수정
layout-SY May 17, 2025
c934c66
feat : 로그인 되어 있지만 댓글과 관련 없는 유저인 경우 신고하기만 가능하게 설정
layout-SY May 17, 2025
bd5aaed
refactor : 코드 컨벤션에 맞게 모델 타입 import는 import 뒤에 type 붙이기 적용
layout-SY May 17, 2025
51fe734
Merge branch 'develop' of https://github.com/devpalsPlus/frontend int…
layout-SY May 17, 2025
46d6520
fix : 닉네임 영역 외에 버튼을 눌러도 route가 이동되는 버그 해결
layout-SY May 18, 2025
6736b1b
style : 댓글&대댓글 컴포넌트의 스타일 통일
layout-SY May 18, 2025
35798c2
fix : 답글 확인 버튼이 아닌 영역을 클릭 해도 동작하던 버그 해결
layout-SY May 18, 2025
558dd49
style : 댓글 컴포넌트 자잘한 스타일 수정
layout-SY May 18, 2025
6a315fd
refactor : 실시간 알림 사용자 데이터 없을 때만 연결 종료
layout-SY May 18, 2025
74e3d0f
feat : 헤더에 있는 전체 알림 조회에 "더보기" 추가 & Toast와 전체 알림 조회 스타일 수정
layout-SY May 20, 2025
5977b63
style : 전체 알림 조회 스타일 수정
layout-SY May 20, 2025
192b10a
feat : 평가된 데이터 "마이/유저 페이지" 평가도에 적용
layout-SY May 22, 2025
b4c262a
style : 댓글 드롭다운의 중간 아이템 스타일이 첫 번째 아이템의 스타일이 적용되는 버그 수정
layout-SY May 22, 2025
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
2 changes: 1 addition & 1 deletion src/api/applicant.api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiApplicantInfo, ApiApplicants } from '../models/applicant';
import type { ApiApplicantInfo, ApiApplicants } from '../models/applicant';
import { httpClient } from './http.api';

export const getApplicantList = async (projectId: number) => {
Expand Down
2 changes: 1 addition & 1 deletion src/api/auth.api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiVerifyNickname, VerifyEmail } from '../models/auth';
import type { ApiVerifyNickname, VerifyEmail } from '../models/auth';
import { httpClient } from './http.api';
import { loginFormValues } from '../pages/login/Login';
import { registerFormValues } from '../pages/user/register/Register';
Expand Down
2 changes: 1 addition & 1 deletion src/api/comment.api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CommentType } from '../models/comment';
import type { CommentType } from '../models/comment';
import { httpClient } from './http.api';

export const postComment = async (id: number, content: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/api/evaluation.api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { apiEvaluatedUser } from '../models/evaluation';
import type { apiEvaluatedUser } from '../models/evaluation';
import { httpClient } from './http.api';

export const postEvaluation = async (userEvaluation: apiEvaluatedUser) => {
Expand Down
6 changes: 3 additions & 3 deletions src/api/joinProject.api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormData } from '../models/createProject';
import { joinProject } from '../models/joinProject';
import { ProjectDetailPlusExtended } from '../models/projectDetail';
import type { FormData } from '../models/createProject';
import type { joinProject } from '../models/joinProject';
import type { ProjectDetailPlusExtended } from '../models/projectDetail';
import { httpClient } from './http.api';

export const getProjectData = async (
Expand Down
5 changes: 4 additions & 1 deletion src/api/myProjectList.api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { ManagedProject, ApiManagedProjects } from '../models/manageMyProject';
import type {
ManagedProject,
ApiManagedProjects,
} from '../models/manageMyProject';
import { httpClient } from './http.api';

export const getMyProjectLists = async () => {
Expand Down
11 changes: 9 additions & 2 deletions src/api/mypage.api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { ApiUserInfo, ApiUserInfoImg, EditMyInfo } from '../models/userInfo';
import { ApiAppliedProject, ApiJoinedProject } from '../models/userProject';
import type {
ApiUserInfo,
ApiUserInfoImg,
EditMyInfo,
} from '../models/userInfo';
import type {
ApiAppliedProject,
ApiJoinedProject,
} from '../models/userProject';
import { httpClient } from './http.api';

export const getMyInfo = async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/api/projectLists.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {
ApiProjectLists,
ApiProjectStatistic,
} from '../models/mainProjectLists';
import { SearchFilters } from '../models/SearchFilters';
import type { SearchFilters } from '../models/SearchFilters';
import { httpClient } from './http.api';

export const getProjectLists = async (params: SearchFilters) => {
Expand Down
2 changes: 1 addition & 1 deletion src/api/reply.api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReplyType } from '../models/comment';
import type { ReplyType } from '../models/comment';
import { httpClient } from './http.api';

export const getReply = async (
Expand Down
2 changes: 1 addition & 1 deletion src/api/report.api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiPostContent } from '../models/report';
import type { ApiPostContent } from '../models/report';
import { httpClient } from './http.api';

export const postReport = async (formData: ApiPostContent) => {
Expand Down
3 changes: 3 additions & 0 deletions src/assets/ArrowRight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 21 additions & 7 deletions src/components/common/Toast/Toast.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,39 @@ export const Container = styled.div`
`;

export const Item = styled.div<{ $exiting: boolean }>`
background-color: ${({ theme }) => theme.buttonScheme.grey.color};
background-color: #ffffff;
border: 6px solid ${({ theme }) => theme.color.border};
padding: 12px 20px;
border-radius: ${({ theme }) => theme.borderRadius.small};
border-radius: ${({ theme }) => theme.borderRadius.primary};
animation: ${fadeInUp} 0.3s ease-out,
${({ $exiting }) => $exiting && fadeOut} 0.3s ease-in forwards;
`;

export const LiveMessage = styled.p`
color: ${({ theme }) => theme.color.white};
color: ${({ theme }) => theme.color.primary};
font-size: 0.95rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
`;

export const LiveDate = styled.p`
color: ${({ theme }) => theme.color.white};
color: ${({ theme }) => theme.color.primary};
font-size: 0.95rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-right: 5px;
opacity: 80%;
`;

export const TypeArea = styled.div`
display: flex;
margin-left: 1px;
`;

export const Type = styled.p``;

export const TypeFilter = styled.p`
color: ${({ theme }) => theme.color.primary};
font-size: 0.95rem;
opacity: 80%;
margin-right: 6px;
`;
15 changes: 13 additions & 2 deletions src/components/common/Toast/ToastItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import * as S from './Toast.styled';
import { AlarmLive } from '../../../models/alarm';
import type { AlarmLive } from '../../../models/alarm';
import { Link } from 'react-router-dom';
import { routeSelector } from '../../../util/routeSelector';
import { timeAgo } from '../../../util/timeAgo';
Expand Down Expand Up @@ -29,7 +29,18 @@ const ToastItem = ({ content, duration, onRemove }: ToastItemProps) => {
<Link to={route}>
<S.Item $exiting={exiting} onAnimationEnd={handleAnimationEnd}>
<S.LiveMessage>{content.message}</S.LiveMessage>
<S.LiveDate>{timeAgo(content.createAt)}</S.LiveDate>
<S.TypeArea>
<S.LiveDate>{timeAgo(content.createAt)} | </S.LiveDate>
<S.TypeFilter>
{content.alarmFilterId === 1
? '문의 답변'
: content.alarmFilterId === 2
? '지원자 확인'
: content.alarmFilterId === 3
? '댓글 답변'
: '기타'}
</S.TypeFilter>
</S.TypeArea>
</S.Item>
</Link>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Toast/ToastProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PropsWithChildren, useCallback, useEffect, useState } from 'react';
import { ToastContext, ToastMessage } from '../../../context/ToastContext';
import ToastContainer from './ToastContainer';
import { AlarmLive } from '../../../models/alarm';
import type { AlarmLive } from '../../../models/alarm';

export const ToastProvider = ({ children }: PropsWithChildren) => {
const [toasts, setToasts] = useState<ToastMessage[]>([]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/avatar/AvatarList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as S from './AvatarList.styled';
import Avatar from './Avatar';
import { formatImgPath } from '../../../util/formatImgPath';
import { SkillTag } from '../../../models/tags';
import type { SkillTag } from '../../../models/tags';
export interface AvatarListProps {
avatars: SkillTag[] | null;
size?: string;
Expand Down
14 changes: 11 additions & 3 deletions src/components/common/dropDown/DropDown.styled.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components';
import styled, { css } from 'styled-components';

export const DropDownContainer = styled.div`
position: relative;
Expand All @@ -11,12 +11,20 @@ export const DropDownButtonWrapper = styled.div`
outline: none;
`;

export const Panel = styled.div`
export const Panel = styled.div<{ $comment: boolean }>`
position: absolute;
top: 50px;
top: 40px;
right: 0;
background-color: ${({ theme }) => theme.color.white};
border-radius: ${({ theme }) => theme.borderRadius.primary};
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
z-index: 100;

${({ $comment }) =>
$comment &&
css`
position: absolute;
top: 0px;
right: 30px;
`}
`;
4 changes: 3 additions & 1 deletion src/components/common/dropDown/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ interface DropDownProps {
children: React.ReactNode;
toggleButton: React.ReactNode;
isOpen?: boolean;
comment: boolean;
}

const DropDown = ({
children,
toggleButton,
isOpen = false,
comment,
...props
}: DropDownProps) => {
const [open, setOpen] = useState(isOpen);
Expand All @@ -31,7 +33,7 @@ const DropDown = ({
>
{toggleButton}
</S.DropDownButtonWrapper>
{open && <S.Panel>{children}</S.Panel>}
{open && <S.Panel $comment={comment}>{children}</S.Panel>}
</S.DropDownContainer>
</DropDownContext.Provider>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/common/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function Header() {
<UserCircleIcon color='#6D6D6D' width='48' height='48' />
)
}
comment={false}
>
<>
{isLoggedIn && (
Expand Down
19 changes: 19 additions & 0 deletions src/components/common/header/Notification/Notification.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,26 @@ export const ScrollArea = styled.div`
}
`;

export const NotificationHeader = styled.div`
display: flex;
justify-content: right;
align-items: center;
height: fix-content;
margin-right: 15px;
`;
Comment on lines +25 to +31
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

알림 헤더 스타일 오타 수정 필요

NotificationHeader 컴포넌트에 오타가 있습니다. height: fix-content는 올바른 CSS 속성이 아닙니다.

다음과 같이 수정해주세요:

export const NotificationHeader = styled.div`
  display: flex;
  justify-content: right;
  align-items: center;
-  height: fix-content;
+  height: fit-content;
  margin-right: 15px;
`;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const NotificationHeader = styled.div`
display: flex;
justify-content: right;
align-items: center;
height: fix-content;
margin-right: 15px;
`;
export const NotificationHeader = styled.div`
display: flex;
justify-content: right;
align-items: center;
height: fit-content;
margin-right: 15px;
`;
🤖 Prompt for AI Agents
In src/components/common/header/Notification/Notification.styled.ts between
lines 25 and 31, the CSS property 'height: fix-content' is incorrect. Replace
'fix-content' with the correct CSS value 'fit-content' to fix the typo and
ensure proper styling of the NotificationHeader component.


export const MoreArea = styled.button``;

export const More = styled.span``;

export const Arrow = styled.img`
margin-bottom: 3px;
`;

export const NonContentsMessage = styled.p`
display: flex;
justify-content: center;
align-items: center;
margin-left: 6px;
`;

Expand Down
15 changes: 15 additions & 0 deletions src/components/common/header/Notification/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ import * as S from './Notification.styled';
import NotificationItem from './NotificationItem/NotificationItem';
import LoadingSpinner from '../../loadingSpinner/LoadingSpinner';
import useAlarmList from '../../../../hooks/user/useAlarmList';
import arrow_right from '../../../../assets/ArrowRight.svg';
import { useNavigate } from 'react-router-dom';
import { ROUTES } from '../../../../constants/user/routes';

const Notification = () => {
const navigate = useNavigate();
const { alarmListData: AlarmData, isLoading, isFetching } = useAlarmList();

if (!AlarmData) {
Expand All @@ -21,6 +25,17 @@ const Notification = () => {

return (
<S.Container>
<S.NotificationHeader>
<S.MoreArea
onClick={() =>
navigate(`${ROUTES.mypage}/${ROUTES.myPageNotifications}`)
}
>
<S.More>더보기</S.More>
<S.Arrow src={arrow_right} />
</S.MoreArea>
</S.NotificationHeader>
<S.Line />
<S.ScrollArea>
{AlarmData.map((item, index) => (
<React.Fragment key={index || item.id}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,47 @@
import styled from 'styled-components';
import styled, { css } from 'styled-components';

export const Container = styled.div`
padding: 8px 0;
font-size: 14px;
`;

export const TypeArea = styled.div`
display: flex;
margin-left: 6px;
`;

export const Type = styled.p``;

export const TypeFilter = styled.p`
font-size: 12px;
opacity: 50%;
margin-right: 6px;
`;

export const ItemContent = styled.p`
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-left: 6px;
`;

export const Time = styled.span`
margin-left: 6px;
color: #999;
font-size: 12px;
margin-left: 6px;
margin-right: 5px;
`;

export const Dot = styled.span<{ $isRead: boolean }>`
width: 5px;
height: 5px;
background-color: #ff3b30;
border-radius: 50%;
margin-top: 6px;

${({ $isRead }) =>
$isRead &&
css`
background-color: #00db42;
`}
`;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link } from 'react-router-dom';
import { Alarm } from '../../../../../models/alarm';
import type { Alarm } from '../../../../../models/alarm';
import * as S from './NotificationItem.styled';
import { routeSelector } from '../../../../../util/routeSelector';
import { useContext } from 'react';
Expand All @@ -17,7 +17,19 @@ const NotificationItem = ({ item }: NotificationItemProps) => {
<Link to={route} onClick={close}>
<S.Container>
<S.ItemContent>{item.content}</S.ItemContent>
<S.Time>{timeAgo(item.createdAt)}</S.Time>
<S.TypeArea>
<S.Time>{timeAgo(item.createdAt)}</S.Time>
<S.TypeFilter>
{item.alarmFilterId === 1
? '문의 답변'
: item.alarmFilterId === 2
? '지원자 확인'
: item.alarmFilterId === 3
? '댓글 답변'
: '기타'}
</S.TypeFilter>
<S.Dot $isRead={item.enabled} />
</S.TypeArea>
</S.Container>
</Link>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/user/comment/CommentLayout.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const Count = styled.span`
export const CommentContainer = styled.div``;

export const CommentInput = styled.div`
display: flex;
margin-bottom: 40px;
`;

Expand Down
Loading
Loading