From 88cf32da7398d3772ce4ccf90332d1f1a390d7f1 Mon Sep 17 00:00:00 2001 From: knoxfighter Date: Sat, 11 Aug 2018 02:26:28 +0200 Subject: [PATCH] changed swal to swal2 in ModLoadSave --- ui/App/components/Mods/ModLoadSave.jsx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ui/App/components/Mods/ModLoadSave.jsx b/ui/App/components/Mods/ModLoadSave.jsx index 6ff9003..9c8fee3 100644 --- a/ui/App/components/Mods/ModLoadSave.jsx +++ b/ui/App/components/Mods/ModLoadSave.jsx @@ -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 { - 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", });