Skip to content

Commit

Permalink
fix: simplify file formats in upload components for consistency and c…
Browse files Browse the repository at this point in the history
…larity (#384)
  • Loading branch information
typeWolffo authored Jan 15, 2025
1 parent 674a839 commit 8e9cf87
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 4 additions & 2 deletions apps/web/app/components/FileUploadInput/EmptyStateUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface EmptyStateUploadProps {

const contentTypeFormats = {
[ContentTypes.VIDEO_LESSON_FORM]: "MP4, MOV, MPEG-2, or Hevc (max. 100MB)",
[ContentTypes.PRESENTATION_FORM]: "PPT/PPTX, KEY, ODP, or PDF (max. 100MB)",
[ContentTypes.PRESENTATION_FORM]: "PPT/PPTX (max. 100MB)",
};

const EmptyStateUpload = ({
Expand All @@ -36,7 +36,9 @@ const EmptyStateUpload = ({
<span className="text-primary-700">{t("uploadFile.header")}</span>{" "}
<span className="text-neutral-950">{t("uploadFile.subHeader")}</span>
</div>
<div className="details text-neutral-600">{contentTypeFormats[contentTypeToDisplay]}</div>
<div className="details text-center text-neutral-600">
{contentTypeFormats[contentTypeToDisplay]}
</div>
</div>
<input
type="file"
Expand Down
4 changes: 1 addition & 3 deletions apps/web/app/components/FileUploadInput/FileUploadInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ const FileUploadInput = ({
<span className="text-primary-400">Click to replace</span>{" "}
<span className="text-white">or drag and drop</span>
</div>
<div className="details text-neutral-200">
PPT/PPTX, KEY, ODP or PDF (max. to 100MB)
</div>
<div className="details text-neutral-200">PPT/PPTX (max. to 100MB)</div>
</div>
<input
type="file"
Expand Down
5 changes: 3 additions & 2 deletions apps/web/app/components/FileUploadInput/ImageUploadInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const ImageUploadInput = ({
fileInputRef,
}: ImageUploadProps) => {
const { t } = useTranslation();

return (
<div className="flex flex-col items-center justify-center gap-y-2">
<div className="relative flex h-80 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-lg border-2 border-solid border-gray-300 bg-gray-100">
Expand Down Expand Up @@ -50,13 +51,13 @@ const ImageUploadInput = ({
"text-gray-600": !field.value,
})}
>
{field.value ? "SVG, PNG, JPG (max. to 20MB)" : "SVG, PNG, JPG or GIF (max. 800x400px)"}
{field.value ? "SVG, PNG, JPG (max. to 20MB)" : "PNG, JPG or JPEG (max. 800x400px)"}
</div>
</div>
<input
ref={fileInputRef}
type="file"
accept=".svg, .png, .jpg, .jpeg, .gif"
accept=".png, .jpg, .jpeg"
onChange={(e) => {
const file = e.target.files?.[0];
if (file) {
Expand Down

0 comments on commit 8e9cf87

Please sign in to comment.