hide download button

This commit is contained in:
2023-02-17 00:00:48 +08:00
parent 7738e061fc
commit 55f48de4db
2 changed files with 10 additions and 6 deletions

View File

@@ -40,6 +40,7 @@ const Timetable = ({
replaceInputType = "checkbox", replaceInputType = "checkbox",
apiRecordEndPoint = "/api/record", apiRecordEndPoint = "/api/record",
openRecordMode = false, openRecordMode = false,
hideDownloadButton = true,
}) => { }) => {
const [editable, setEditable] = React.useState(true); const [editable, setEditable] = React.useState(true);
const ref = React.useRef(); const ref = React.useRef();
@@ -251,20 +252,22 @@ const Timetable = ({
return ( return (
<> <>
<h2 style={{textAlign: 'center'}}>Login as {user}</h2> <h2 style={{ textAlign: "center" }}>Login as {user}</h2>
<div <div
ref={ref} ref={ref}
contentEditable={editable} contentEditable={editable}
style={{ style={{
overflow: "scroll", overflow: "scroll",
display: 'flex', display: "flex",
justifyContent: 'center', justifyContent: "center",
}} }}
onInput={handleInput} onInput={handleInput}
></div>{" "} ></div>{" "}
<p style={{ display: "flex", justifyContent: "center" }}> {!hideDownloadButton && (
<button onClick={DownloadMarks}>Download Selection</button> <p style={{ display: "flex", justifyContent: "center" }}>
</p> <button onClick={DownloadMarks}>Download Selection</button>
</p>
)}
<div style={{ display: "none" }} id="download-dom"></div> <div style={{ display: "none" }} id="download-dom"></div>
</> </>
); );

View File

@@ -47,6 +47,7 @@ export default function Home() {
disableConflictCheck={true} disableConflictCheck={true}
disableNetwork={true} disableNetwork={true}
replaceInputType={"number"} replaceInputType={"number"}
hideDownloadButton={false}
/> />
)} )}
</main> </main>