feat(buttonNavigation): expose readonly selected button and new select function, to allow user to select any button with path animation
This commit is contained in:
@@ -18,7 +18,7 @@ const ACTIONS = {
|
||||
[action: "Copy" | "Open", verb: string, content: string]
|
||||
>;
|
||||
|
||||
const { selectedButton, selectorPosition } = useButtonNavigation({
|
||||
const { selected, selectorPosition } = useButtonNavigation({
|
||||
buttons: {
|
||||
github: [26, 27, 202, 42],
|
||||
email: [26, 59, 202, 42],
|
||||
@@ -48,7 +48,7 @@ const { selectedButton, selectorPosition } = useButtonNavigation({
|
||||
disabled: computed(() => store.isIntro || store.isOutro),
|
||||
});
|
||||
|
||||
const actionateButton = async (button: (typeof selectedButton)["value"]) => {
|
||||
const actionateButton = async (button: (typeof selected)["value"]) => {
|
||||
const [action, verb, content] = ACTIONS[button];
|
||||
if (action === "Copy") {
|
||||
try {
|
||||
@@ -102,7 +102,7 @@ const actionateButton = async (button: (typeof selectedButton)["value"]) => {
|
||||
: 1
|
||||
"
|
||||
b-label="Quit"
|
||||
:a-label="ACTIONS[selectedButton][0]"
|
||||
:a-label="ACTIONS[selected][0]"
|
||||
@activate-b="store.animateOutro()"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user