Skip to content

Commit

Permalink
feat: mscz button (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoro authored Jul 20, 2024
1 parent 18a2166 commit 4002786
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/tsx/ArrangementItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { PlayingSong, SongArrangement } from "../types";
import { PartItem } from "./PartItem";

import "../css/ArrangementItem.css";
import { SiMidi } from "react-icons/si";
import { SiMidi, SiMusescore } from "react-icons/si";

interface ArrangementItemProps {
handleSelect: (songArrnagement: SongArrangement, checked: boolean) => void;
Expand All @@ -31,6 +31,9 @@ const ArrangementItem = ({
const arrangementMidiAsset = arrangement.assets.find(
(asset) => asset.extension == ".midi"
);
const arrangementMsczAsset = arrangement.assets.find(
(asset) => asset.extension == ".mscz"
);

return (
<>
Expand All @@ -51,6 +54,13 @@ const ArrangementItem = ({
</a>
)}
</td>
<td>
{arrangementMsczAsset && (
<a href={`collection/${arrangementMsczAsset.path}`} target="_blank">
<SiMusescore />
</a>
)}
</td>
</tr>
{expand &&
arrangement.parts.map((part) => (
Expand Down
13 changes: 12 additions & 1 deletion src/tsx/SongBookArrangementRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
BsArrowUp,
BsFillTrashFill,
} from "react-icons/bs";
import { SiMidi } from "react-icons/si";
import { SiMidi, SiMusescore } from "react-icons/si";

import type { PlayingSong, SongArrangement } from "../types";
import { PartItem } from "./PartItem";
Expand Down Expand Up @@ -35,6 +35,10 @@ const SongBookArrangementRow = ({
(asset) => asset.extension == ".midi"
);

const arrangementMsczAsset = arrangement.assets.find(
(asset) => asset.extension == ".mscz"
);

return (
<>
<tr className="cursor">
Expand Down Expand Up @@ -63,6 +67,13 @@ const SongBookArrangementRow = ({
</a>
)}
</td>
<td>
{arrangementMsczAsset && (
<a href={`collection/${arrangementMsczAsset.path}`} target="_blank">
<SiMusescore />
</a>
)}
</td>
</tr>
{expand &&
arrangement.parts.map((part) => (
Expand Down

0 comments on commit 4002786

Please sign in to comment.