update src/components/Alert/index.js, src/components/Toast/index.js and alert.js

master
mahdi andalib 3 years ago
parent 19f6ae9ce6
commit 33d7a1ec8c
  1. 1
      src/components/Alert/index.js
  2. 13
      src/components/Toast/index.js
  3. 2
      src/redux/reducers/alert.js

@ -7,6 +7,7 @@ import { connect } from "react-redux";
function Alert(props) { function Alert(props) {
props.confirmAlert(); props.confirmAlert();
return ( return (
<div className=""> <div className="">
{/* 1 */} {/* 1 */}

@ -7,13 +7,14 @@ import { connect } from "react-redux";
function Toast(props) { function Toast(props) {
props.confirmAlert(); props.confirmAlert();
return ( return (
<div className=""> <div className="">
{/* toast1 */} {/* toast1 */}
<button <button
className="bg-orange-300 p-4 rounded text-white m-4" className="bg-orange-300 p-4 rounded text-white m-4"
onClick={() => onClick={() =>
props.customAlert({ props.confirmAlert({
icon: "error", icon: "error",
title: "ارور شماره 1", title: "ارور شماره 1",
showCloseButton: true, showCloseButton: true,
@ -37,7 +38,7 @@ function Toast(props) {
<button <button
className="bg-orange-300 p-4 rounded text-white m-4" className="bg-orange-300 p-4 rounded text-white m-4"
onClick={() => onClick={() =>
props.customAlert({ props.confirmAlert({
icon: "success", icon: "success",
title: "ارور شماره 2", title: "ارور شماره 2",
showCloseButton: true, showCloseButton: true,
@ -60,7 +61,7 @@ function Toast(props) {
<button <button
className="bg-orange-300 p-4 rounded text-white m-4" className="bg-orange-300 p-4 rounded text-white m-4"
onClick={() => onClick={() =>
props.customAlert({ props.confirmAlert({
icon: false, icon: false,
title: "ارور شماره 1", title: "ارور شماره 1",
showCloseButton: true, showCloseButton: true,
@ -84,7 +85,7 @@ function Toast(props) {
<button <button
className="bg-orange-300 p-4 rounded text-white m-4" className="bg-orange-300 p-4 rounded text-white m-4"
onClick={() => onClick={() =>
props.customAlert({ props.confirmAlert({
icon: false, icon: false,
title: "ارور شماره 2", title: "ارور شماره 2",
showCloseButton: true, showCloseButton: true,
@ -107,7 +108,7 @@ function Toast(props) {
<button <button
className="bg-orange-300 p-4 rounded text-white m-4" className="bg-orange-300 p-4 rounded text-white m-4"
onClick={() => onClick={() =>
props.customAlert({ props.confirmAlert({
icon: false, icon: false,
title: "ارور شماره 2", title: "ارور شماره 2",
showCloseButton: true, showCloseButton: true,
@ -130,7 +131,7 @@ function Toast(props) {
<button <button
className="bg-orange-300 p-4 rounded text-white m-4" className="bg-orange-300 p-4 rounded text-white m-4"
onClick={() => onClick={() =>
props.customAlert({ props.confirmAlert({
icon: false, icon: false,
title: "ارور شماره 2", title: "ارور شماره 2",
showCloseButton: true, showCloseButton: true,

@ -35,7 +35,7 @@ const alert = (state = initialState, action) => {
return { return {
...state, ...state,
}; };
case "alert.toast": case "alert/toast":
Swal.fire({ Swal.fire({
icon: data.icon, icon: data.icon,
title: data.title, title: data.title,

Loading…
Cancel
Save