Skip to content

Commit f28fb70

Browse files
committed
fix: 공고 상세보기 수정
1 parent fc78a31 commit f28fb70

File tree

5 files changed

+55
-30
lines changed

5 files changed

+55
-30
lines changed

src/components/projectFormComponents/projectInformationText/ProjectInformation.styled.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,19 @@ export const SectionInput = styled.div`
1313

1414
export const InfoRow = styled.div`
1515
display: flex;
16-
align-items: flex-start;
17-
margin-bottom: 20px;
16+
align-items: center;
17+
margin-bottom: 1rem;
1818
1919
img {
20-
width: 40px;
21-
height: 40px;
20+
width: 30px;
21+
height: 30px;
2222
border: 1px solid ${({ theme }) => theme.color.border};
2323
border-radius: ${({ theme }) => theme.borderRadius.primary};
2424
margin-bottom: 5px;
2525
margin-right: 10px;
2626
}
2727
2828
@media (max-width: 1024px) {
29-
align-items: flex-start;
3029
margin-bottom: 15px;
3130
}
3231
`;
@@ -113,7 +112,7 @@ export const BeginnerIcon = styled.img`
113112
border-radius: 50%;
114113
border: 1px solid ${({ theme }) => theme.color.border};
115114
background-color: #fff;
116-
padding: 5px;
115+
padding: 3px;
117116
object-fit: contain;
118117
margin-bottom: 15px;
119118
@@ -127,8 +126,7 @@ export const BeginnerIcon = styled.img`
127126
export const BeginnerText = styled.p`
128127
font-size: 1rem;
129128
font-weight: bold;
130-
color: #000;
129+
color: #3e5879;
131130
flex: 0.8;
132131
text-align: left;
133-
margin-top: 20px;
134132
`;

src/components/projectFormComponents/projectInformationText/ProjectInformation.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ const ProjectInformation = ({ data }: ProjectInformationProps) => {
1818
<S.SectionInput>
1919
<S.InfoRow>
2020
{data.isBeginner && <S.BeginnerIcon src={beginner} alt='초보자 환영' />}
21-
{data.isBeginner && <S.BeginnerText>초보 환영</S.BeginnerText>}
21+
{data.isBeginner && (
22+
<S.BeginnerText>새싹 멤버(초보)도 환영해요!</S.BeginnerText>
23+
)}
2224
</S.InfoRow>
2325

2426
{PROJECT_DATA_GET.map((input, index) => (
@@ -46,7 +48,7 @@ const ProjectInformation = ({ data }: ProjectInformationProps) => {
4648
<S.InfoLabel>사용 언어</S.InfoLabel>
4749
<S.SkillTagContainer>
4850
{data.ProjectSkillTag.map((skillTag) => (
49-
<S.SkillTagImage>
51+
<S.SkillTagImage key={skillTag.SkillTag.id}>
5052
<img
5153
key={skillTag.SkillTag.id}
5254
src={skillTag.SkillTag.img}

src/pages/projectDetail/ProjectDetail.styled.ts

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ export const Header = styled.div`
1818
`;
1919

2020
export const Title = styled.h1`
21-
font-size: 36px;
21+
font-size: 2rem;
2222
font-weight: bold;
23-
margin-bottom: 10px;
23+
margin-bottom: 0.8rem;
24+
margin-top: 1rem;
2425
2526
@media (max-width: 870px) {
2627
font-size: 28px;
@@ -34,7 +35,8 @@ export const ProfileContainer = styled.div`
3435
`;
3536

3637
export const ProfileImageContainer = styled.div`
37-
margin-right: 15px;
38+
padding-right: 15px;
39+
cursor: pointer;
3840
`;
3941

4042
export const UserInfo = styled.div`
@@ -49,28 +51,29 @@ export const UserInfo = styled.div`
4951
`;
5052

5153
export const UserName = styled.div`
52-
font-size: 21px;
54+
font-size: ${({ theme }) => theme.heading['small'].fontSize};
5355
font-weight: bold;
56+
cursor: pointer;
5457
5558
@media (max-width: 870px) {
5659
font-size: 18px;
5760
}
5861
`;
5962

6063
export const PostDate = styled.div`
61-
font-size: ${({ theme }) => theme.heading.semiSmall};
64+
font-size: 0.9rem;
6265
color: ${({ theme }) => theme.color.deepGrey};
6366
6467
@media (max-width: 870px) {
65-
font-size: 0.9rem;
68+
font-size: 0.8rem;
6669
}
6770
`;
6871

6972
export const ViewCount = styled.div`
7073
display: flex;
7174
gap: 5px;
7275
text-align: center;
73-
font-size: ${({ theme }) => theme.heading.semiSmall};
76+
font-size: 0.9rem;
7477
color: ${({ theme }) => theme.color.deepGrey};
7578
7679
svg {
@@ -91,7 +94,7 @@ export const ViewCount = styled.div`
9194
`;
9295

9396
export const Content = styled.div`
94-
margin-top: 20px;
97+
margin-top: 3.5rem;
9598
margin-bottom: 60px;
9699
`;
97100

@@ -118,7 +121,7 @@ export const Value = styled.span`
118121
`;
119122

120123
export const ProjectDescription = styled.div`
121-
margin-top: 30px;
124+
margin-top: 4rem;
122125
`;
123126

124127
export const SectionTitle = styled.h3`
@@ -134,9 +137,17 @@ export const Description = styled.div`
134137
`;
135138

136139
export const ApplyButtonContainer = styled.div`
137-
text-align: center;
140+
display: flex;
141+
justify-content: center;
142+
align-items: center;
138143
margin-top: 50px;
139144
margin-bottom: 50px;
145+
146+
button {
147+
font-size: 1.1rem;
148+
font-weight: 500;
149+
padding: 0.8rem 1.8rem;
150+
}
140151
`;
141152

142153
export const ActionButton = styled(Button)`

src/pages/projectDetail/ProjectDetail.tsx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,49 @@ import Avatar from '../../components/common/avatar/Avatar';
99
import { EyeIcon } from '@heroicons/react/24/outline';
1010
import useAuthStore from '../../store/authStore';
1111
import { ROUTES } from '../../constants/routes';
12+
import { useModal } from '../../hooks/useModal';
13+
import Modal from '../../components/common/modal/Modal';
1214

1315
const ProjectDetail = () => {
1416
const { projectId } = useParams();
1517
const id = Number(projectId);
1618
const navigate = useNavigate();
1719
const { data, isLoading, isFetching } = useGetProjectData(id);
20+
const { isOpen, message, handleModalOpen, handleModalClose } = useModal();
1821
const { userData } = useAuthStore((state) => state);
1922

23+
if (isLoading) return <div>Loading...</div>;
24+
if (isFetching) return <div>isFetching...</div>;
2025
if (!data) {
2126
return <div>데이터가 없습니다.</div>;
2227
}
2328

24-
if (isLoading) return <div>Loading...</div>;
25-
if (isFetching) return <div>isFetching...</div>;
26-
2729
const handleApplyClick = () => {
2830
if (userData?.id === data.User.id) {
29-
alert('본인의 프로젝트는 지원할 수 없습니다.');
31+
handleModalOpen('본인의 프로젝트는 지원할 수 없습니다.');
3032
return;
3133
} else {
3234
navigate(`${ROUTES.apply}/${id}`);
3335
}
3436
};
3537

38+
const handleMovetoUserPage = () => {
39+
const userId = data.User.id;
40+
navigate(`/user/${userId}`);
41+
};
42+
3643
return (
3744
<S.Container>
3845
<S.Header>
3946
<S.Title>{data.title}</S.Title>
4047
<S.ProfileContainer>
41-
<S.ProfileImageContainer>
42-
<Avatar size='3.3rem' image={data.User.profileImg} />
48+
<S.ProfileImageContainer onClick={handleMovetoUserPage}>
49+
<Avatar size='2.5rem' image={data.User.profileImg} />
4350
</S.ProfileImageContainer>
4451
<S.UserInfo>
45-
<S.UserName>{data.User.nickname}</S.UserName>
52+
<S.UserName onClick={handleMovetoUserPage}>
53+
{data.User.nickname}
54+
</S.UserName>
4655
<S.PostDate>{formatDate(data.recruitmentEndDate)}</S.PostDate>
4756
<S.ViewCount>
4857
<EyeIcon />
@@ -71,6 +80,9 @@ const ProjectDetail = () => {
7180
</S.ApplyButtonContainer>
7281

7382
<hr></hr>
83+
<Modal isOpen={isOpen} onClose={handleModalClose}>
84+
{message}
85+
</Modal>
7486
</S.Container>
7587
);
7688
};

src/routes/AppRoutes.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,11 @@ const AppRoutes = () => {
116116
{
117117
path: `${ROUTES.projectDetail}/:projectId`,
118118
element: (
119-
<Layout>
120-
<ProjectDetail />
121-
</Layout>
119+
<Suspense fallback={<LoadingSpinner />}>
120+
<Layout>
121+
<ProjectDetail />
122+
</Layout>
123+
</Suspense>
122124
),
123125
},
124126
{

0 commit comments

Comments
 (0)