Skip to content

Commit

Permalink
file select component was weird. fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahuletto committed Jul 3, 2023
1 parent 06a8812 commit aea253a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions components/EditModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ReactJS stuff
import { ChangeEvent } from 'react';
import { ChangeEvent, FormEvent } from 'react';

// Our Imports
import { BoardFile } from '../utils/board';
Expand Down Expand Up @@ -30,8 +30,9 @@ const EditModal: React.FC<FileSelectProps> = ({
back.style['display'] = 'none';
}

function edit(event) {
function edit(event: FormEvent) {
event.preventDefault();
event.stopPropagation()
closeEdit();

const input = document.querySelector<HTMLInputElement>(
Expand Down
3 changes: 2 additions & 1 deletion components/FileSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ const FileSelect: React.FC<FileSelectProps> = ({

return (
<div
onClick={() => setFileName(file.name)}
className={
file.name === fileName ? 'fileSelect active-file' : 'fileSelect'
}>
<button
title={file.name}
onClick={() => setFileName(file.name)}

>
<div>{file.name}</div>
</button>
Expand Down
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ const Index: NextPage = () => {
<button
title="Save the board"
className={styles.save}
disabled={code == '' && files.length <= 1}
disabled={code == ''}
onClick={(event) => {
(event.target as HTMLButtonElement).disabled = true;
(event.target as HTMLElement).style.background = 'var(--red)';
Expand Down

0 comments on commit aea253a

Please sign in to comment.