-
Notifications
You must be signed in to change notification settings - Fork 4
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
게시글 작성 시 이미지 복사 붙혀넣기로 이미지 첨부 가능하도록 구현 #624
Conversation
⚡️ Lighthouse report!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
공통된 파일 추출하는 부분을 분리하니 가독성이 훨씬 좋아졌어요!
붙여넣기 이벤트를 통해서 웹에서 사용할때 사용성이 훨씬 좋아질 것 같아요bb 너무 좋습니다
클립보드 이벤트도 이미지 등록 이벤트와 유사한 부분이 있네요
궁금한 점이 하나 있어서 남겼습니다.
다른 수정 부분은 없어서 approve하겠습니다.
제꺼 머지되면 선택지도 넣으면 좋겠네요ㅎㅎㅎ
fe-리뷰완
const handlePasteImage = (event: ClipboardEvent<HTMLTextAreaElement>) => { | ||
const file = event.clipboardData.files[0]; | ||
|
||
if (file.type.slice(0, 5) === 'image') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 해당 file.type이 뭐라고 나오나요??
찾아도 관련없는 것들이 많이 나오네요
참고하신 자료가 있다면 공유 부탁들려요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'image/png' , 'image/webp'와 같이 나와요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
참고한 자료는 따로 없고 console.log를 통해 파일의 정보를 확인하고 코드를 작성했었습니다 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bb 대단합니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와 붙여넣기 정말 편리하겠는걸요??
uploadImage 함수 리팩터링도 깔끔해서 좋네요👍👍
|
||
import { convertImageToWebP } from '@utils/resizeImage'; | ||
|
||
export const uploadImage = async ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍
}) => { | ||
if (!inputElement) return; | ||
|
||
const webpFileList = await convertImageToWebP(imageFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 혹시 정말 사소하게 궁금한 부분인데, 변환하는데 몇초가 걸리는지 궁금해요! 만약 시간이 걸리는 작업이거나, slow 3g 환경이라면 변환 중..
같은 문구나 로딩 스피너를 보여줘도 좋겠네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제로의 제안으로 webp로 이미지 변환 속도를 측정해보았습니다 ~
fe-리뷰요청
fe-리뷰완 |
🔥 연관 이슈
close: #602
📝 작업 요약
⏰ 소요 시간
40분
🔎 작업 상세 설명
적용된 동영상
2023-09-15.1.46.35.mov
🌟 논의 사항
크루들과 이야기 해보고 싶은 부분을 적어주세요.