add patterns tab with examples
This commit is contained in:
parent
4e7e715f10
commit
1855dae35e
4 changed files with 40 additions and 11 deletions
23
website/src/repl/panel/PatternsTab.jsx
Normal file
23
website/src/repl/panel/PatternsTab.jsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue