Skip to content

feat(files): add distinct file type icons and colors based on extension#218

Open
Git-Shubham14 wants to merge 1 commit into
imanchalsingh:mainfrom
Git-Shubham14:feat/file-type-icons
Open

feat(files): add distinct file type icons and colors based on extension#218
Git-Shubham14 wants to merge 1 commit into
imanchalsingh:mainfrom
Git-Shubham14:feat/file-type-icons

Conversation

@Git-Shubham14

Copy link
Copy Markdown

Description

Closes #193

All files in My Files previously showed the same generic icon regardless of type. This PR enhances getFileIcon and getFileTypeColor functions to display distinct icons and colors based on file extension and MIME type category.

Changes

  • client/src/components/Home/MyFiles.tsx
    • Added FileVideo, FileAudio, FileImage, FileCode, Check to lucide-react imports
    • Enhanced getFileIcon to return specific icons based on file extension:
      • 📄 PDF, DOC, DOCX, TXT, MD, CSV → FileText
      • 🖼️ JPG, PNG, GIF, WEBP, SVG → FileImage
      • 🎥 MP4, MOV, AVI, MKV → FileVideo
      • 🎵 MP3, WAV, OGG, FLAC → FileAudio
      • 💻 JS, TS, HTML, CSS, JSON → FileCode
    • Enhanced getFileTypeColor to return distinct colors per extension:
      • PDF → Red #e74c3c
      • DOC/DOCX → Blue #2980b9
      • XLS/XLSX → Green #27ae60
      • PPT/PPTX → Orange #e67e22
      • Audio → Purple #9b59b6
      • Code files → Yellow #f39c12
    • Updated all getFileIcon and getFileTypeColor call sites to pass file.name for extension-based matching

Type of Change

  • New feature

Checklist

@netlify

netlify Bot commented Jul 5, 2026

Copy link
Copy Markdown

👷 Deploy request for file-sharingsystem pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9c8bc54

@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

@Git-Shubham14 is attempting to deploy a commit to the imanchalsingh Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the SSoC26 Official label of org label Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend SSoC26 Official label of org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Display file type icon next to filenames in the My Files list

1 participant