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