Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
re-moved the save button
Browse files Browse the repository at this point in the history
  • Loading branch information
matt01y committed May 23, 2024
1 parent 9aa04a7 commit f394d1f
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions frontend/src/components/ProjectStudentComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {make_submission} from "../utils/api/Submission.ts";
import {joinGroup, leaveGroup} from "../utils/api/Groups.ts";
import {getGroupInfo, loadGroupMembers} from "../dataloaders/ProjectsStudentLoader.ts";
import SimpleTests from "./SimpleTests/SimpleTests.tsx";
import { TeacherOrStudent } from "./SimpleTests/TeacherOrStudentEnum.tsx";
import {TeacherOrStudent} from "./SimpleTests/TeacherOrStudentEnum.tsx";

function ProjectInfo(props: { project: ProjectStudent }): JSX.Element {
const {t} = useTranslation();
Expand Down Expand Up @@ -290,15 +290,18 @@ export default function ProjectStudentComponent(props: { project: ProjectStudent
<div className="field-body">
<ul className="field">
<div className="submission-file-download-upload">

{submission != null &&
<button className="button" onClick={() => void downloadLatestSubmission()}>
<span className="mr-2"><FaDownload/></span>
<span>{t('project.download-current')}</span>
</button>
}
<div id="file-js" className="field is-horizontal ">
<label className="file-label">

<input className="file-input" type="file" name="resume"
ref={fileInputRef}
onChange={selectFile}
/>

<span className="file-cta file-chooser-first">
<span className="file-icon">
<FaUpload/>
Expand All @@ -307,39 +310,27 @@ export default function ProjectStudentComponent(props: { project: ProjectStudent
{t('project.submission.choose_file')}
</span>
</span>

{newSelectedFile &&
<span className={"file-name mr-3 file-chooser-second"}>
{file?.name}
</span>
}

</label>
</div>
{submission != null &&
<button className="button" onClick={() => void downloadLatestSubmission()}>
<span className="mr-2"><FaDownload/></span>
<span>{t('project.download-current')}</span>
</button>
}

{newSelectedFile && hasGroup &&
<div className={"is-flex is-justify-content-end"}>
<RegularButton
placeholder={t('project.submit')}
add={false}
onClick={() => void submitFile()}
styling="is-primary"/>
</div>}
</div>
</ul>
</div>
</div>
</>}
{newSelectedFile && hasGroup &&
<div>
<div className={"is-flex is-justify-content-end"}>
<RegularButton
placeholder={t('project.submit')}
add={false}
onClick={() => void submitFile()}
styling="is-primary"/>
</div>
</div>}
<div className="p-5"/>

</div>
);
}

0 comments on commit f394d1f

Please sign in to comment.