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

fix: simplify file formats in upload components for consistency and clarity #384

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading