Skip to content

Commit

Permalink
fix: 쪽지 보내기 모달 내 글자수 validation 서버와 불일치 문제 해결 (#1652)
Browse files Browse the repository at this point in the history
* fix: 쪽지 보내기 내용 글자수 제한 500자로 변경

* fix: debugger; 삭제

* fix: 기존 쪽지보내기에서 커피챗 상수 제거

* fix: 기존 COFFEE_CHAT 상수를 사용하던 곳 제거

* fix: 쪽지 보내기 모달 placeholder 문구 변경
  • Loading branch information
simeunseo authored Nov 4, 2024
1 parent a3e5be6 commit 38f6e6b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 22 deletions.
12 changes: 0 additions & 12 deletions src/components/coffeechat/CoffeeChatCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import Divider from '@/components/common/Divider/Divider';
import ResizedImage from '@/components/common/ResizedImage';
import Text from '@/components/common/Text';
import useEventLogger from '@/components/eventLogger/hooks/useEventLogger';
import MessageModal, { MessageCategory } from '@/components/members/detail/MessageSection/MessageModal';
import { useVisibleBadges } from '@/components/members/main/hooks/useVisibleBadges';
import { MessageModalState } from '@/components/members/main/MemberList';
import { LATEST_GENERATION } from '@/constants/generation';
import {
MB_BIG_MEDIA_QUERY,
Expand Down Expand Up @@ -53,7 +51,6 @@ export default function CoffeeChatCard({
isMine,
}: MentoringCardProps) {
const router = useRouter();
const [messageModalState, setMessageModalState] = useState<MessageModalState>({ show: false });
const [isImageLoaded, setIsImageLoaded] = useState(false);
const { logClickEvent } = useEventLogger();

Expand Down Expand Up @@ -181,15 +178,6 @@ export default function CoffeeChatCard({
</InfoSection>
</ProfileSection>
</Container>
{messageModalState.show && (
<MessageModal
receiverId={messageModalState.data.targetId}
name={messageModalState.data.name}
profileImageUrl={messageModalState.data.profileUrl}
onClose={() => setMessageModalState({ show: false })}
defaultCategory={MessageCategory.COFFEE_CHAT}
/>
)}
</>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const StyledInput = styled.input<InputProps>`
${textStyles.SUIT_16_M};
&::placeholder {
color: ${colors.gray600};
color: ${colors.gray400};
}
&:focus {
Expand Down
8 changes: 2 additions & 6 deletions src/components/members/detail/MessageSection/MessageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { MOBILE_MEDIA_QUERY } from '@/styles/mediaQuery';
import { zIndex } from '@/styles/zIndex';

export enum MessageCategory {
COFFEE_CHAT = '커피챗',
NETWORK = '친목',
APPJAM_TEAM_BUILDING = '앱잼 팀 빌딩',
PROJECT_SUGGESTION = '프로젝트 제안',
Expand Down Expand Up @@ -50,12 +49,9 @@ const CATEGORY: Category[] = [

const schema = yup.object().shape({
email: yup.string().email('올바른 이메일 형태를 입력해주세요.').required('이메일을 입력해주세요.'),
content: yup.string().required('내용을 입력해주세요.').max(750, '750자 이내로 입력해주세요.'),
content: yup.string().required('내용을 입력해주세요.').max(500, '500자 이내로 입력해주세요.'),
});

const COFFEECHAT_PLACEHOLDER =
'커피챗을 통해 어떤 걸 얻고 싶은지 자세하게 적어주세요. 멘토님의 스킬과 소개와 관련된 내용으로 작성한다면 멘토님이 더욱 자세하게 공유해주실 거예요.';

interface MessageForm {
email: string;
content: string;
Expand Down Expand Up @@ -180,7 +176,7 @@ const MessageModal: FC<MessageModalProps> = ({
name='content'
component={StyledTextArea}
placeholder={
selectedCategory === MessageCategory.COFFEE_CHAT ? COFFEECHAT_PLACEHOLDER : '전달할 내용을 입력해주세요!'
'멤버에게 궁금한 점을 자세하게 적어주세요. 이야기 나누고 싶은 주제를 쉽게 이해할 수 있도록, 회원님에 대해 간단하게 소개해 주시면 더 좋아요.'
}
/>
<StyledButton isDisabled={!isValid || isPending}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/members/detail/MessageSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function MessageSection({
name={name}
profileImageUrl={profileImage}
onClose={onCloseMessageModal}
defaultCategory={MessageCategory.COFFEE_CHAT}
defaultCategory={MessageCategory.NETWORK}
onLog={(options) =>
logSubmitEvent('sendMessage', {
category: options?.category?.toString() ?? '',
Expand Down
3 changes: 1 addition & 2 deletions src/components/members/main/MemberList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ const MemberList: FC<MemberListProps> = ({ banner }) => {
}, 0);

const handleClickCard = (profile: Profile) => {
debugger;
logClickEvent('memberCard', { id: profile.id, name: profile.name });
};

Expand Down Expand Up @@ -480,7 +479,7 @@ const MemberList: FC<MemberListProps> = ({ banner }) => {
name={messageModalState.data.name}
profileImageUrl={messageModalState.data.profileUrl}
onClose={() => setMessageModalState({ show: false })}
defaultCategory={MessageCategory.COFFEE_CHAT}
defaultCategory={MessageCategory.NETWORK}
onLog={(options) =>
logSubmitEvent('sendMessage', {
category: options?.category?.toString() ?? '',
Expand Down

0 comments on commit 38f6e6b

Please sign in to comment.