Revize b51488cd
Přidáno uživatelem Jaroslav Hrubý před téměř 3 roky(ů)
webapp/utils/alerts.ts | ||
---|---|---|
1 | 1 |
import Swal, { SweetAlertIcon, SweetAlertPosition } from 'sweetalert2'; |
2 | 2 |
import withReactContent from 'sweetalert2-react-content'; |
3 |
import { AxiosResponse } from 'axios'; |
|
4 | 3 |
|
5 | 4 |
const MySwal = withReactContent(Swal); |
6 | 5 |
|
... | ... | |
43 | 42 |
} |
44 | 43 |
}); |
45 | 44 |
} |
45 |
|
|
46 |
export function ShowConfirm(action: () => void, actionLabel: string) { |
|
47 |
Swal.fire({ |
|
48 |
icon: 'question', |
|
49 |
title: 'Opravdu si přejete ' + actionLabel + '?', |
|
50 |
showCancelButton: true, |
|
51 |
confirmButtonText: 'Potvrdit', |
|
52 |
confirmButtonColor: '#5278ff', |
|
53 |
cancelButtonText: 'Zrušit', |
|
54 |
cancelButtonColor: '#c0c0c0', |
|
55 |
}).then((result) => { |
|
56 |
if (result.isConfirmed) { |
|
57 |
action(); |
|
58 |
} |
|
59 |
}); |
|
60 |
} |
Také k dispozici: Unified diff
Annotation finishing implemented