Skip to content

Commit

Permalink
[fix]: 해시태그 잘림 현상 해소 (#246)
Browse files Browse the repository at this point in the history
- 한글의 경우 더 넓은 크기를 차지하여 6 -> 7
  • Loading branch information
JuneParkCode authored Oct 6, 2023
1 parent 03a1924 commit ae49aa7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 42manito/src/components/Mentor/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const sliceHashtags = (hashtags: HashtagResponseDto[], limit: number) => {
if (acc + hashtag.name.length > limit) {
continue;
}
acc += hashtag.name.length + 6; // 최적화된 값임.. 6은 #{} 의 길이
acc += hashtag.name.length + 7; // 최적화된 값임.. 6은 #{} 의 길이
slicedHashtags.push(hashtag);
}
return slicedHashtags;
Expand All @@ -34,7 +34,7 @@ const MentorCard = ({ data }: props) => {
const dispatch = useAppDispatch();
const { nickname, profileImage } = data.user;
const { shortDescription, hashtags } = data;
const slicedHashtags = sliceHashtags(hashtags, 31);
const slicedHashtags = sliceHashtags(hashtags, 32);
const openMentorModal = (data: MentorProfileDto) => {
dispatch(CurrMentorSlice.actions.deleteMentor());
dispatch(CurrMentorSlice.actions.setMentor(data));
Expand Down

0 comments on commit ae49aa7

Please sign in to comment.