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) {
props.confirmAlert();
return (
<div className="">
{/* 1 */}

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

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

Loading…
Cancel
Save