Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 3521 | Rev 3526 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3521 Rev 3522
Línea 81... Línea 81...
81
    setShowLeaveConfirmationBox(show);
81
    setShowLeaveConfirmationBox(show);
82
  };
82
  };
Línea 83... Línea 83...
83
 
83
 
84
  const handleCancelApply = (url = link_delete) => {
84
  const handleCancelApply = (url = link_delete) => {
85
    setLoading(true);
-
 
86
    axios
85
    setLoading(true);
87
      .post(url)
86
    axios.post(url)
88
      .then((response) => {
-
 
89
        const resData = response.data;
-
 
90
        (resData);
87
      .then(({ data }) => {
91
        if (resData.success) {
-
 
92
          const msg = resData.data;
-
 
93
          addNotification({
-
 
94
            style: "success",
-
 
95
            msg: msg,
-
 
96
          });
-
 
97
          if (fetchCallback)
-
 
98
            fetchCallback();
-
 
99
        } else {
88
        if (!data.success) {
100
          const errorMsg =
89
          const errorMsg =
101
            typeof resData.data === "string"
90
            typeof data.data === "string"
102
              ? resData.data
91
              ? data.data
103
              : "Ha ocurrido un error, Por favor intente más tarde";
92
              : "Ha ocurrido un error, Por favor intente más tarde";
104
          addNotification({
93
          addNotification({
105
            style: "danger",
94
            style: "danger",
106
            msg: errorMsg,
95
            msg: errorMsg,
107
          });
-
 
108
          setLoading(false);
96
          });
-
 
97
        }
-
 
98
        const msg = data.data;
-
 
99
        addNotification({
-
 
100
          style: "success",
-
 
101
          msg: msg,
-
 
102
        });
109
        }
103
        if (fetchCallback) fetchCallback();
110
      })
-
 
111
      .catch((error) => {
104
      })
112
        console.log('>>: error > ', error)
-
 
113
      })
-
 
114
      .finally(() => {
105
      .catch((error) => console.log('>>: error > ', error))
115
        setLoading(false);
-
 
116
      });
106
      .finally(() => setLoading(false))
Línea 117... Línea 107...
117
  };
107
  };
118
 
108
 
119
  const handleUnfollow = async (link_unfollow) => {
109
  const handleUnfollow = async (link_unfollow) => {
Línea 140... Línea 130...
140
    }
130
    }
141
  }
131
  }
Línea 142... Línea 132...
142
 
132
 
143
  return (
133
  return (
144
    <div className='profile_info'>
134
    <div className='profile_info'>
145
      <div className='profile_info_header'>
135
      <div className={`${image ? 'd-flex' : 'd-block'} position-relative`}>
146
        {!!image && (
136
        {!!image &&
147
          <div className='profile_info_header_imgContainer'>
137
          <div className='profile_info_header_imgContainer'>
148
            <img src={image} className="object-fit-contain" style={{ maxHeight: '100px' }} alt="group image" />
138
            <img src={image} className="object-fit-contain" style={{ maxHeight: '100px' }} alt="group image" />
149
          </div>
-
 
150
        )
139
          </div>
151
        }
140
        }
152
        <div className={image ? 'col-md-8 d-flex flex-column justify-content-center align-items-start' : 'col-md-12 ' + ' col-sm-12 col-12'}>
141
        <div className={image ? 'col-md-8 d-flex flex-column justify-content-center align-items-start' : 'col-md-12 ' + ' col-sm-12 col-12'}>
153
          <h3 className={status ? '' : "w-100 text-left" + ' w-100'}>
142
          <h3 className={status ? '' : "w-100 text-left" + ' w-100'}>
154
            {name}
143
            {name}
Línea 501... Línea 490...
501
              onAccept={() => handleCancelApply(link_leave)}
490
              onAccept={() => handleCancelApply(link_leave)}
502
            />
491
            />
503
          </div>
492
          </div>
504
        )
493
        )
505
      }
494
      }
506
      {
-
 
507
        loading && (
495
      {loading &&
508
          <StyledSpinnerContainer>
496
        <StyledSpinnerContainer>
509
            <Spinner />
497
          <Spinner />
510
          </StyledSpinnerContainer>
498
        </StyledSpinnerContainer>
511
        )
-
 
512
      }
499
      }
513
    </div>
500
    </div>
514
  );
501
  );
515
};
502
};