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

fix: 쪽지 보내기 모달 내 글자수 validation 서버와 불일치 문제 해결 #1652

Merged
merged 5 commits into from
Nov 4, 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
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 @@ -189,7 +189,6 @@ const MemberList: FC<MemberListProps> = ({ banner }) => {
}, 0);

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

Expand Down Expand Up @@ -484,7 +483,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
Loading