add patterns tab with examples

This commit is contained in:
Felix Roos 2023-08-23 22:51:36 +02:00
parent 4e7e715f10
commit 1855dae35e
4 changed files with 40 additions and 11 deletions

View file

@ -0,0 +1,23 @@
import { cx } from '@strudel.cycles/react';
import React from 'react';
import * as tunes from '../tunes.mjs';
export function PatternsTab({ context }) {
return (
<div className="px-4 w-full">
<h2 className="text-xl mb-2">Examples</h2>
{Object.entries(tunes).map(([key, tune]) => (
<a
key={key}
className="mr-4 hover:opacity-50 cursor-pointer inline-block"
onClick={() => {
console.log('clikkk', tune);
context.handleUpdate(tune);
}}
>
{key}
</a>
))}
</div>
);
}