Skip to content

Commit 94c1724

Browse files
fix(confirm-dialog): add prop for accept label (#149)
fix(confirm-dialog): add accept label and refactor usage
1 parent 1130b0d commit 94c1724

File tree

8 files changed

+11
-3
lines changed

8 files changed

+11
-3
lines changed

src/components/audio/SpotifyUserDeleteButton.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
delete
66
:loading="loading"
77
:message="confirmMessage"
8+
acceptLabel="Delete"
89
:on-accept="
910
() => {
1011
loading = true;

src/components/integrations/IntegrationDeleteButton.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ref="confirmRef"
1010
:loading="loading"
1111
message="Are you sure you want to delete this integration?"
12+
acceptLabel="Delete"
1213
:on-accept="
1314
() => {
1415
loading = true;

src/components/modes/time-trail-race/TimeTrailRaceStepper.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<ConfirmWrapper
1717
ref="confirmRef"
1818
message="Are you sure you want to reset this trail race?"
19+
acceptLabel="Reset"
1920
:on-accept="timeTrailStore.resetPlayer"
2021
/>
2122
</template>

src/components/poster/StaticPosterButtonDelete.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
ref="confirmRef"
55
:loading="loading"
66
message="Are you sure you want to delete this poster?"
7+
acceptLabel="Delete"
78
:on-accept="
89
async () => {
910
loading = true;

src/components/prime/ConfirmWrapper.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useConfirm } from 'primevue/useconfirm';
77
88
const props = defineProps<{
99
message: string;
10+
acceptLabel: string;
1011
loading?: boolean;
1112
onAccept?: () => void;
1213
onReject?: () => void;
@@ -19,7 +20,7 @@ const confirmDialog = () => {
1920
header: 'Confirm',
2021
rejectClass: 'p-button-secondary',
2122
rejectLabel: 'Cancel',
22-
acceptLabel: 'Quit',
23+
acceptLabel: props.acceptLabel,
2324
reject() {
2425
if (props.onReject) {
2526
props.onReject();

src/components/timed-events/TimedEventDeleteButton.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
ref="confirmRef"
55
:loading="loading"
66
message="Are you sure you want to delete this timed event?"
7+
acceptLabel="Delete"
78
:on-accept="
89
() => {
910
loading = true;

src/views/Modes/CenturionModeView.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<ConfirmWrapper
99
ref="confirmRef"
1010
message="Are you sure you want to quit this centurion?"
11+
acceptLabel="Quit"
1112
:on-accept="centurionStore.quitCenturion"
1213
/>
1314
</div>

src/views/Modes/TimeTrailRaceModeView.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
<template #header>
1010
<div v-if="timeTrailInitialized">
1111
<Button icon="pi pi-times" @click="confirmRef?.confirmDialog" />
12-
<DialogWrapper
12+
<ConfirmWrapper
1313
ref="confirmRef"
1414
message="Are you sure you want to quit this spoelbakkenrace?"
15+
acceptLabel="Quit"
1516
:on-accept="timeTrailStore.quit"
1617
/>
1718
</div>
@@ -36,7 +37,7 @@ import TimeTrailRaceInitialize from '@/components/modes/time-trail-race/TimeTrai
3637
import TimeTrailRaceStepper from '@/components/modes/time-trail-race/TimeTrailRaceStepper.vue';
3738
import TimeTrailRaceScoreboard from '@/components/modes/time-trail-race/TimeTrailRaceScoreboard.vue';
3839
import AppContainer from '@/layout/AppContainer.vue';
39-
import DialogWrapper from '@/components/prime/ConfirmWrapper.vue';
40+
import ConfirmWrapper from '@/components/prime/ConfirmWrapper.vue';
4041
import { useLayoutStore } from '@/stores/layout.store';
4142
4243
const confirmRef = ref();

0 commit comments

Comments
 (0)