Skip to content

Commit 311cee6

Browse files
committed
feat: confirm when resetting on new game
1 parent 4cd4616 commit 311cee6

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

pages/game/new.vue

+22-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,28 @@
55
<v-btn color="blue" class="mr-1" @click="handleOrientation">
66
Switch Sides
77
</v-btn>
8-
<v-btn color="red" class="mr-1" @click="handleReset">
9-
Reset
10-
</v-btn>
8+
<v-dialog width="500">
9+
<template #activator="{ props }">
10+
<v-btn v-bind="props" color="red" class="mr-1">
11+
Reset
12+
</v-btn>
13+
</template>
14+
15+
<template #default="{ isActive }">
16+
<v-card title="Confirmation">
17+
<v-card-text>
18+
Are you sure you want to reset the board?
19+
</v-card-text>
20+
21+
<v-card-actions>
22+
<v-spacer />
23+
24+
<v-btn text="Confirm" color="red" @click="handleReset(isActive)" />
25+
<v-btn text="Cancel" @click="isActive.value = false" />
26+
</v-card-actions>
27+
</v-card>
28+
</template>
29+
</v-dialog>
1130
<v-btn color="orange" class="mr-1" @click="handleUndo">
1231
Undo
1332
</v-btn>

0 commit comments

Comments
 (0)