-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from PetrIvan/feature/delete-all-chords
Added an option to delete all chords
- Loading branch information
Showing
4 changed files
with
100 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from "react"; | ||
import { useStore } from "@/state/use_store"; | ||
|
||
interface Props { | ||
dropdownRef: React.RefObject<HTMLDivElement>; | ||
setIsOpen: (isOpen: boolean) => void; | ||
} | ||
|
||
export default function DeleteAllDropdown({ dropdownRef, setIsOpen }: Props) { | ||
const [clearChords] = useStore((state) => [state.clearChords]); | ||
|
||
return ( | ||
<div | ||
className="absolute z-[15] top-full mt-[0.5dvw] bg-zinc-950 rounded-[0.5dvw] flex flex-row items-center justify-between p-[1dvw] shadow-lg shadow-zinc-950" | ||
ref={dropdownRef} | ||
> | ||
<p className="w-full select-none text-[2.5dvh] mr-[1dvw]"> | ||
Delete all chords? | ||
</p> | ||
<button | ||
className="bg-zinc-800 rounded-[0.5dvw] p-[0.5dvw] hover:bg-zinc-900" | ||
onClick={() => { | ||
clearChords(); | ||
setIsOpen(false); | ||
}} | ||
> | ||
Confirm | ||
</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters