feat(utils): useButtonConfirmation.onButtonClick -> onActivate
This commit is contained in:
@@ -4,7 +4,7 @@ export const useButtonNavigation = <T extends Record<string, Rect>>({
|
||||
buttons,
|
||||
initialButton,
|
||||
canClickButton,
|
||||
onButtonClick,
|
||||
onActivate,
|
||||
navigation,
|
||||
disabled,
|
||||
selectorAnimation,
|
||||
@@ -12,7 +12,7 @@ export const useButtonNavigation = <T extends Record<string, Rect>>({
|
||||
buttons: T;
|
||||
initialButton: keyof T;
|
||||
canClickButton?: (buttonName: keyof T) => boolean;
|
||||
onButtonClick?: (buttonName: keyof T) => void;
|
||||
onActivate?: (buttonName: keyof T) => void;
|
||||
navigation: Record<
|
||||
keyof T,
|
||||
{
|
||||
@@ -201,7 +201,7 @@ export const useButtonNavigation = <T extends Record<string, Rect>>({
|
||||
if (canClickButton && !canClickButton(buttonName)) continue;
|
||||
|
||||
if (selectedButton.value === buttonName) {
|
||||
onButtonClick?.(buttonName);
|
||||
onActivate?.(buttonName);
|
||||
} else {
|
||||
const path = findPath(graph, selectedButton.value, buttonName);
|
||||
|
||||
@@ -305,7 +305,7 @@ export const useButtonNavigation = <T extends Record<string, Rect>>({
|
||||
|
||||
case "NDS_START":
|
||||
case "NDS_A": {
|
||||
onButtonClick?.(selectedButton.value);
|
||||
onActivate?.(selectedButton.value);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user