fix: import schedule file upload button (#515)

* fix: add active scale style and accept file prop

* chore: improve type safety using MIMEType

* fix: update FileUpload component to support multiple MIME types in accept prop

* chore: run lint

---------

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>
This commit is contained in:
Ethan Lanting
2025-02-24 20:17:49 -06:00
committed by GitHub
parent 4a8d0666c2
commit 766c0bc1b4
3 changed files with 26 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import { CalendarDots, Trash } from '@phosphor-icons/react';
import { background } from '@shared/messages';
import { initSettings, OptionsStore } from '@shared/storage/OptionsStore';
import { UserScheduleStore } from '@shared/storage/UserScheduleStore';
import MIMEType from '@shared/types/MIMEType';
import { downloadBlob } from '@shared/util/downloadBlob';
// import { addCourseByUrl } from '@shared/util/courseUtils';
// import { getCourseColors } from '@shared/util/colors';
@@ -397,7 +398,12 @@ export default function Settings(): JSX.Element {
</Text>
<p className='text-sm text-gray-600'>Import from a schedule file</p>
</div>
<FileUpload variant='filled' color='ut-burntorange' onChange={handleImportClick}>
<FileUpload
variant='filled'
color='ut-burntorange'
onChange={handleImportClick}
accept={MIMEType.JSON}
>
Import Schedule
</FileUpload>
</div>