changed swal to swal2 in ModLoadSave

This commit is contained in:
knoxfighter 2018-08-11 02:26:28 +02:00
parent b679415860
commit 88cf32da73

View File

@ -1,7 +1,7 @@
import React from 'react';
import ReactDOMServer from 'react-dom/server';
import {instanceOfModsContent} from "./ModsPropTypes";
import PropTypes from "prop-types";
import {ReactSwalNormal, ReactSwalDanger} from './../../../js/customSwal';
class ModLoadSave extends React.Component {
constructor(props) {
@ -46,7 +46,7 @@ class ModLoadSave extends React.Component {
});
if(checkboxes.length == 0) {
swal({
ReactSwalNormal.fire({
title: "No mods in this save!",
type: "error"
});
@ -76,20 +76,19 @@ class ModLoadSave extends React.Component {
</div>
</div>
swal({
ReactSwalDanger.fire({
title: "Mods to install",
text: ReactDOMServer.renderToStaticMarkup(table),
html: true,
type: 'info',
html: table,
type: 'question',
showCancelButton: true,
closeOnConfirm: false,
confirmButtonText: "Download Mods!",
cancelButtonText: "Cancel",
showLoaderOnConfirm: true
}, this.loadModsSwalHandler);
showLoaderOnConfirm: true,
preConfirm: this.loadModsSwalHandler
});
},
error: (jqXHR) => {
swal({
ReactSwalNormal.fire({
title: jqXHR.responseJSON.data,
html: true,
type: "error",
@ -105,7 +104,7 @@ class ModLoadSave extends React.Component {
dataType: "JSON",
data: $("#swalForm").serialize(),
success: (data) => {
swal({
ReactSwalNormal.fire({
title: "All Mods installed successfully!",
type: "success"
});
@ -117,7 +116,7 @@ class ModLoadSave extends React.Component {
error: (jqXHR) => {
let json_data = JSON.parse(jqXHR.responseJSON.data);
swal({
ReactSwalNormal.fire({
title: json_data.detail,
type: "error",
});