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: fileUrl에서 확장자명 추출 후 fileType 뒤에 삽입 #439 #440

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jongse7
Copy link
Contributor

@jongse7 jongse7 commented Mar 3, 2025

1️⃣ 작업 내용 Summary

결과물 이미지
image

  **// fileUrl에서 확장자명을 추출한 후 대문자로 변경
  const lastDotIndex = file.fileUrl.lastIndexOf('.');
  const fileExtension = lastDotIndex !== -1 ? file.fileUrl.substring(lastDotIndex + 1) : '';**
  return (
    <a
      className={cn(
        buttonVariants(),
        'h-[31px] w-[143px] rounded-[9px] bg-gray-200 text-[16px] font-medium text-gray-600',
        'cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap px-2 hover:text-white',
        className
      )}
      title={file.fileType}
      href={file.fileUrl}
      download={file.fileName}
    >
      **{`${file.fileType} ${fileExtension.toUpperCase()}`}**
    </a>
  );

확장자명 앞에만 .이 있는 게 아니라서 마지막 .을 기준으로 문자열 끝까지를 확장자명으로 추출했습니다.
디자인에는 확장자명을 대문자로 표현해서 toUpperCase()로 대문자화 했습니다.

더 좋은 방법 있으면 말씀해주세요 💀

2️⃣ 추후 작업할 내용

3️⃣ 체크리스트

  • develop 브랜치의 최신 코드를 pull 받았나요?

@jongse7 jongse7 self-assigned this Mar 3, 2025
@jongse7 jongse7 deployed to develop March 3, 2025 19:29 — with GitHub Actions Active
Copy link

vercel bot commented Mar 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dev-homepage-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 3, 2025 7:30pm

@jongse7 jongse7 marked this pull request as ready for review March 3, 2025 19:33
Copy link
Contributor

@EATSTEAK EATSTEAK left a comment

Choose a reason for hiding this comment

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

스쿼시 머지 부탁드립니다

@jongse7
Copy link
Contributor Author

jongse7 commented Mar 4, 2025

스쿼시 머지 부탁드립니다

네넹

Copy link
Contributor

@nebulaBdj nebulaBdj left a comment

Choose a reason for hiding this comment

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

확인했습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants