Skip to content

Commit

Permalink
add 'button' support in custom menus (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xelus22 authored Sep 29, 2023
1 parent bae0a0f commit 78d670b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/panes/configure-panes/custom/custom-control.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import {PelpiKeycodeInput} from '../../../inputs/pelpi/keycode-input';
import {AccentButton} from '../../../inputs/accent-button';
import {AccentSlider} from '../../../inputs/accent-slider';
import {AccentSelect} from '../../../inputs/accent-select';
import {AccentRange} from '../../../inputs/accent-range';
Expand Down Expand Up @@ -78,6 +79,16 @@ const VIACustomControl = (props: VIACustomControlProps) => {
const {content, type, options, value} = props as any;
const [name, ...command] = content;
switch (type) {
case 'button': {
const buttonOption: any[] = options || [1];
return (
<AccentButton
onClick={() =>
props.updateValue(name, ...command, buttonOption[0])
}
>Click</AccentButton>
);
}
case 'range': {
return (
<AccentRange
Expand Down

0 comments on commit 78d670b

Please sign in to comment.