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

feat: 멤버 탭 변경사항 및 mds 반영 #1705

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
090a37e
feat: 참여한 프로젝트, 모임이 없는 경우 해당 항목 전부 비노출
simeunseo Dec 12, 2024
fd72336
feat: 본인 프로필에 커피챗 오픈 버튼 추가
simeunseo Dec 12, 2024
03d3903
chore: makers-ui 버전 업
simeunseo Dec 13, 2024
34265b9
feat: 개선된 Select에 맞추어 레이아웃 변경
simeunseo Dec 13, 2024
7f18120
feat: 멤버 정렬 Select를 mds로 교체
simeunseo Dec 13, 2024
77c5763
feat: ProfileSection mds 반영
simeunseo Dec 13, 2024
1a3bec6
feat: 활동 팀 mds Tag로 변경
simeunseo Dec 13, 2024
e2d23af
feat: soptActivitySection 모바일 레이아웃 변경
simeunseo Dec 13, 2024
64c2341
feat: 본인 프로필이면서 활동 내역에 등록된 프로젝트가 없을 경우 프로젝트 등록 페이지로 이동하는 버튼 추가
simeunseo Dec 13, 2024
ed217c7
refactor: activity 필드 내부 값에 대한 가드
simeunseo Dec 16, 2024
926a5cb
feat: 멤버 순서 정렬 Select mds 수정사항 반영하여 교체
simeunseo Dec 19, 2024
56f4eab
fix: 프로필 기본정보 gap 수정
simeunseo Dec 19, 2024
c5c76d5
feat: Merge branch 'main' into feat/#1699
simeunseo Dec 19, 2024
b9dd49a
feat: BottomSheetSelect 수정
simeunseo Dec 19, 2024
58376b2
feat: 멤버탭 모바일 Select를 BottomSheetSelect로 교체
simeunseo Dec 19, 2024
59c9b00
feat: BottomSheetSelect에서 icon prop과 스타일 커스텀 추가
simeunseo Dec 19, 2024
f904e75
feat: 멤버 탭에서 모바일 정렬 Select를 BottomSheetSelect로 교체
simeunseo Dec 19, 2024
8e534e7
fix: coffeechatform의 career 항목에 대해 string[] 타입 비허용
simeunseo Dec 19, 2024
9383798
Merge branch 'main' into feat/#1699
simeunseo Dec 24, 2024
509cb88
feat: 쪽지 보내기에 커피챗 뱃지 추가
simeunseo Dec 28, 2024
291e5a0
fix: 멤버 상세 activity section에서 프로젝트가 없을 경우 내용을 세로 가운데 정렬
simeunseo Dec 28, 2024
268b036
fix: 멤버 상세 activity section 내 간격 조정
simeunseo Dec 28, 2024
9592e6b
fix: 멤버 상세 career section 커리어-스킬 사이 마진 수정
simeunseo Dec 28, 2024
37d79c0
fix: 멤버 상세 페이지 하단 마진값 수정
simeunseo Dec 28, 2024
891f352
fix: 멤버 상세 연락처 정보 마진 수정
simeunseo Dec 28, 2024
fda6a98
feat: BottomSheetSelect width 정의 방식 변경
simeunseo Jan 4, 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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"@radix-ui/react-tooltip": "^1.0.5",
"@sopt-makers/colors": "^3.0.2",
"@sopt-makers/fonts": "^1.0.0",
"@sopt-makers/icons": "^1.0.5",
"@sopt-makers/ui": "^2.7.6",
"@sopt-makers/icons": "^1.0.7",
"@sopt-makers/ui": "^2.8.1",
"@tanstack/react-query": "^5.4.3",
"@toss/emotion-utils": "^1.1.10",
"@toss/error-boundary": "^1.4.6",
Expand Down
2 changes: 1 addition & 1 deletion src/components/coffeechat/detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default function CoffeechatDetail({ memberId }: CoffeechatDetailProp) {
isMine={profile.isMine}
isCoffeechatTap
/>
<DetailInfoSection profile={profile} isCoffeechat />
<DetailInfoSection profile={profile} />
Copy link
Contributor

Choose a reason for hiding this comment

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

요기 없애준 이유가 뭘까요?!

Copy link
Member Author

@simeunseo simeunseo Dec 16, 2024

Choose a reason for hiding this comment

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

<DetailInfoSection/> 컴포넌트는 멤버 프로필과 커피챗에서 재사용되는 컴포넌트인데요! 기존에 이 섹션 내에서 유저의 생일 정보를 노출하고 있었는데, 이번에 생일 정보를 다른 위치로 옮기는 변경사항이 생겼어요.

그런데 <DetailInfoSection/> 컴포넌트에서 isCoffeeChat이라는 flag를 통해 생일 정보를 조건부 렌더링하고 있었고, 위의 변경사항에 따라 더이상 이 분기가 필요하지 않아서 isCoffeeChat이라는 prop이 필요가 없어졌습니다!

기존의 <DetailInfoSection/> 내 조건부 렌더링

  {!isCoffeechat && profile.birthday && (
    <InfoItem label='생년월일' content={convertBirthdayFormat(profile.birthday)} />
  )}

-> 더이상 이 컴포넌트에서 생일을 노출하지 않으므로 해당 코드 아예 삭제

</ProfileContents>
<SoptActivityTitle>SOPT 활동 정보</SoptActivityTitle>
<SoptActivitySection soptActivities={sortedSoptActivities} />
Expand Down
31 changes: 22 additions & 9 deletions src/components/members/detail/ActivityBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,29 @@ import styled from '@emotion/styled';
import { colors } from '@sopt-makers/colors';
import { FC } from 'react';

import Text from '@/components/common/Text';
import { MOBILE_MEDIA_QUERY } from '@/styles/mediaQuery';
import { textStyles } from '@/styles/typography';

interface ActivityBadgeProps {
category?: string;
name: string;
}

const ActivityBadge: FC<ActivityBadgeProps> = ({ category, name }) => {
return <Container>{`${category} ${name}`}</Container>;
return (
<Container>
<Category typography='SUIT_13_M'>{category}</Category>
<Text typography='SUIT_13_M'>{name}</Text>
</Container>
);
};

const Container = styled.div`
display: flex;
align-items: center;
transition: background-color 0.2s;
border-radius: 13px;
border-radius: 28px;
background-color: ${colors.gray700};
padding: 6px 14px;
line-height: 100%;
letter-spacing: -0.01em;
color: ${colors.gray10};

${textStyles.SUIT_14_M}

&:hover {
background-color: ${colors.gray600};
Expand All @@ -38,4 +37,18 @@ const Container = styled.div`
}
`;

const Category = styled(Text)`
display: flex;
align-items: center;

::after {
display: inline-block;
margin: 0 10px;
background-color: ${colors.gray400};
width: 1px;
height: 14px;
content: '';
}
`;

export default ActivityBadge;
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ const MemberDetail: FC<MemberDetailProps> = ({ memberId }) => {
<Container>
<Wrapper>
<ProfileSection profile={profile} memberId={memberId} />
{!profile.isMine && <MessageSection profile={profile} memberId={memberId} />}
<MessageSection profile={profile} memberId={memberId} />
<DetailInfoSection profile={profile} />
<SoptActivitySection soptActivities={sortedSoptActivities} />
<SoptActivitySection soptActivities={sortedSoptActivities} isMine={profile.isMine} />
<CareerSection
careers={profile.careers}
links={profile.links}
Expand Down Expand Up @@ -119,7 +119,7 @@ const Container = styled.div`
display: flex;
flex-direction: column;
align-items: center;
padding: 123px 0;
padding: 120px 0;
@media ${MOBILE_MEDIA_QUERY} {
padding: 16px 20px;
padding-bottom: 100px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import { MOBILE_MEDIA_QUERY } from '@/styles/mediaQuery';
export const MemberDetailSection = styled.section`
display: flex;
flex-direction: column;
gap: 32px;
border-radius: 20px;
background: ${colors.gray900};
padding: 40px;
width: 100%;

@media ${MOBILE_MEDIA_QUERY} {
gap: 20px;
border-radius: 18px;
padding: 30px 20px;
}
Expand Down
48 changes: 16 additions & 32 deletions src/components/members/detail/DetailinfoSection/index.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,29 @@
import styled from '@emotion/styled';
import { colors } from '@sopt-makers/colors';
import dayjs from 'dayjs';

import { ProfileDetail } from '@/api/endpoint_LEGACY/members/type';
import Text from '@/components/common/Text';
import MemberDetailSection from '@/components/members/detail/ActivitySection/MemberDetailSection';
import InfoItem from '@/components/members/detail/InfoItem';
import { DEFAULT_DATE } from '@/components/members/upload/constants';
import { MOBILE_MEDIA_QUERY } from '@/styles/mediaQuery';

interface DetailInfoSectionProps {
profile: ProfileDetail;
isCoffeechat?: boolean;
}

const convertBirthdayFormat = (birthday?: string) => {
// FIXME: 서버쪽에 YYYY-MM-DD 형태로 무조건 업로드시 전송해줘야 하는 이슈가 있어서,
// 생년월일을 보내지 않았을 경우에 DEFAULT_DATE를 전송하도록 임시처리 해 두었습니다. 이를 클라에서 보여주기 위해 대응합니다.
if (birthday) {
const isDefaultDay = dayjs(birthday).isSame(dayjs(DEFAULT_DATE));
return isDefaultDay ? '' : dayjs(birthday).format('YYYY-MM-DD');
}
return '';
};

const DetailInfoSection = ({ profile, isCoffeechat = false }: DetailInfoSectionProps) => {
const DetailInfoSection = ({ profile }: DetailInfoSectionProps) => {
const hasProfileInfo = profile.birthday || profile.university || profile.major || profile.address;

return hasProfileInfo ? (
<MemberDetailSection style={{ gap: '30px' }}>
{!isCoffeechat && profile.birthday && (
<InfoItem label='생년월일' content={convertBirthdayFormat(profile.birthday)} />
)}
{profile.university && <InfoItem label='학교'>{profile.university}</InfoItem>}
{profile.major && <InfoItem label='전공'>{profile.major}</InfoItem>}
{profile.address && (
<InfoItem label='활동 지역'>
<StyledAddressBadgeWrapper>
{profile.address.split(',').map((address) => (
<AddressBadge key={address}>
<Text typography='SUIT_14_M'>{address}</Text>
</AddressBadge>
<AddressItem key={address}>
<Text typography='SUIT_18_M'>{address}</Text>
</AddressItem>
))}
</StyledAddressBadgeWrapper>
</InfoItem>
Expand All @@ -54,18 +37,19 @@ export default DetailInfoSection;
const StyledAddressBadgeWrapper = styled.div`
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;

@media ${MOBILE_MEDIA_QUERY} {
gap: 10px;
}
`;

const AddressBadge = styled.div`
border-radius: 13px;
background-color: ${colors.gray700};
padding: 6px 14px;
line-height: 16px;
color: ${colors.gray10};
const AddressItem = styled.div`
display: flex;
align-items: center;

&:not(:last-child)::after {
display: inline-block;
margin: 0 10px;
background-color: ${colors.gray600};
width: 1px;
height: 16px;
content: '';
}
`;
18 changes: 8 additions & 10 deletions src/components/members/detail/GroupSection/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from '@emotion/styled';
import { colors } from '@sopt-makers/colors';
import { fonts } from '@sopt-makers/fonts';
import axios from 'axios';
import Link from 'next/link';

Expand All @@ -13,7 +14,6 @@ import { playgroundLink } from '@/constants/links';
import useEnterScreen from '@/hooks/useEnterScreen';
import { MOBILE_MEDIA_QUERY } from '@/styles/mediaQuery';
import { safeParseInt } from '@/utils';
import { fonts } from '@sopt-makers/fonts';

interface GroupSectionProps {
profile: ProfileDetail;
Expand All @@ -40,9 +40,9 @@ const GroupSection = ({ profile, meId, memberId }: GroupSectionProps) => {
}

return (
<Container>
<>
{meetingList.length > 0 ? (
<>
<Container>
<ActivityTitle>
{profile.name}님이 참여한 {meetingList.length}개의 모임이에요!
</ActivityTitle>
Expand All @@ -56,11 +56,11 @@ const GroupSection = ({ profile, meId, memberId }: GroupSectionProps) => {
))}
</ActivityDisplay>
<Target ref={ref} />
</>
</Container>
) : (
<>
{String(meId) === memberId ? (
<>
{String(meId) === memberId && (
<Container>
Copy link
Contributor

Choose a reason for hiding this comment

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

요부분 훨씬 직관성 있게 바뀐 것 같아요!! 배워갑니다!

<ActivityTitle>아직 참여한 모임이 없어요</ActivityTitle>
<ActivityUploadNudge>
<NudgeSubText typography='SUIT_16_M' style={{ textAlign: 'center', lineHeight: '24px' }}>
Expand All @@ -72,13 +72,11 @@ const GroupSection = ({ profile, meId, memberId }: GroupSectionProps) => {
</ActivityUploadButton>
<ActivityUploadMaskImg src='/icons/img/meeting-mask.png' alt='meeting-mask-image' height={134} />
</ActivityUploadNudge>
</>
) : (
<ActivityTitle>아직 {profile.name}님이 참여한 모임이 없어요</ActivityTitle>
</Container>
)}
</>
)}
</Container>
</>
);
};

Expand Down
12 changes: 3 additions & 9 deletions src/components/members/detail/InterestSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,7 @@ interface InterestSectionProps {
balanceGame: BalanceGame;
selfIntroduction?: string;
}
const InterestSection: FC<InterestSectionProps> = ({
mbti,
sojuCapacity,
balanceGame,
interest,
selfIntroduction,
}) => {
const InterestSection: FC<InterestSectionProps> = ({ mbti, sojuCapacity, balanceGame, interest, selfIntroduction }) => {
const balanceGameResults = getBalanceGameResults(balanceGame);
const isBalanceGameAvailable = balanceGame && Object.values(balanceGame).some((value) => value !== null);

Expand Down Expand Up @@ -165,7 +159,7 @@ const BalanceGameWrapper = styled.div`

@media ${MOBILE_MEDIA_QUERY} {
margin-top: 12px;
max-width: 236px;
max-width: 265px;
}
`;

Expand All @@ -176,5 +170,5 @@ const BalanceGameItem = styled.div`
line-height: 16px;
color: ${colors.gray10};

${textStyles.SUIT_14_M};
${textStyles.SUIT_16_SB};
`;
106 changes: 68 additions & 38 deletions src/components/members/detail/MessageSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,44 +49,74 @@ export default function MessageSection({ memberId, profile }: MessageSectionProp
router.push(playgroundLink.coffeechatDetail(memberId));
};

return (
<>
<StyledMemberDetailSection>
<TitleWrapper>
<Title typography='SUIT_18_SB'>{name}님과 나누고 싶은 이야기가 있나요?</Title>
<Subtitle typography='SUIT_16_M' color={colors.gray300}>
궁금한 점에 대해 편하게 소통해보세요!
</Subtitle>
</TitleWrapper>
<ButtonWrapper>
{isCoffeeChatActivate && (
<CoffeeChatButton size='sm' theme='black' onClick={handleClickCoffeeChatButton}>
커피챗 보러가기
</CoffeeChatButton>
)}
<MessageButton size='sm' onClick={handleClickMessageButton} disabled={isEmptyEmail}>
쪽지 보내기
</MessageButton>
</ButtonWrapper>
</StyledMemberDetailSection>
{isOpenMessageModal && (
<MessageModal
receiverId={memberId}
name={name}
profileImageUrl={profileImage}
onClose={onCloseMessageModal}
defaultCategory={MessageCategory.NETWORK}
onLog={(options) =>
logSubmitEvent('sendMessage', {
category: options?.category?.toString() ?? '',
receiverId: +memberId,
referral: 'memberDetail',
})
}
/>
)}
</>
);
const handleClickCoffeeChatOpenButton = () => {
router.push(playgroundLink.coffeechatUpload());
};

const Mine = () => {
return (
<>
{!profile.isCoffeeChatActivate && (
<StyledMemberDetailSection>
<TitleWrapper>
<Title typography='SUIT_18_SB'>SOPT 회원들과 나누고 싶은 이야기가 있나요?</Title>
<Subtitle typography='SUIT_16_M' color={colors.gray300}>
어떤 내용이라도 좋아요. 편하게 오픈해 보세요!
</Subtitle>
</TitleWrapper>
<ButtonWrapper>
<CoffeeChatButton size='sm' theme='black' onClick={handleClickCoffeeChatOpenButton}>
커피챗 오픈하러 가기
</CoffeeChatButton>
</ButtonWrapper>
</StyledMemberDetailSection>
)}
</>
);
};

const Others = () => {
return (
<>
<StyledMemberDetailSection>
<TitleWrapper>
<Title typography='SUIT_18_SB'>{name}님과 나누고 싶은 이야기가 있나요?</Title>
<Subtitle typography='SUIT_16_M' color={colors.gray300}>
궁금한 점에 대해 편하게 소통해보세요!
</Subtitle>
</TitleWrapper>
<ButtonWrapper>
{isCoffeeChatActivate && (
<CoffeeChatButton size='sm' theme='black' onClick={handleClickCoffeeChatButton}>
커피챗 보러가기
</CoffeeChatButton>
)}
<MessageButton size='sm' onClick={handleClickMessageButton} disabled={isEmptyEmail}>
쪽지 보내기
</MessageButton>
</ButtonWrapper>
</StyledMemberDetailSection>
{isOpenMessageModal && (
<MessageModal
receiverId={memberId}
name={name}
profileImageUrl={profileImage}
onClose={onCloseMessageModal}
defaultCategory={MessageCategory.NETWORK}
onLog={(options) =>
logSubmitEvent('sendMessage', {
category: options?.category?.toString() ?? '',
receiverId: +memberId,
referral: 'memberDetail',
})
}
/>
)}
</>
);
};

return profile.isMine ? <Mine /> : <Others />;
}

const StyledMemberDetailSection = styled(MemberDetailSection)`
Expand Down
Loading
Loading