Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2117 Rev 2281
Línea 2... Línea 2...
2
import { addNotification } from "../redux/notification/notification.actions";
2
import { addNotification } from "../redux/notification/notification.actions";
3
import ConfirmationBox from "../shared/confirmation-box/ConfirmationBox";
3
import ConfirmationBox from "../shared/confirmation-box/ConfirmationBox";
4
import Spinner from "../shared/loading-spinner/Spinner";
4
import Spinner from "../shared/loading-spinner/Spinner";
5
import { axios } from "../utils";
5
import { axios } from "../utils";
6
import styled from 'styled-components'
6
import styled from 'styled-components'
-
 
7
import styles from './Profile.module.scss'
Línea 7... Línea 8...
7
 
8
 
8
const StyledSpinnerContainer = styled.div`
9
const StyledSpinnerContainer = styled.div`
9
  position: absolute;
10
  position: absolute;
10
  left: 0;
11
  left: 0;
Línea 80... Línea 81...
80
    setLoading(true);
81
    setLoading(true);
81
    axios
82
    axios
82
      .post(url)
83
      .post(url)
83
      .then((response) => {
84
      .then((response) => {
84
        const resData = response.data;
85
        const resData = response.data;
85
         (resData);
86
        (resData);
86
        if (resData.success) {
87
        if (resData.success) {
87
          const msg = resData.data;
88
          const msg = resData.data;
88
          addNotification({
89
          addNotification({
89
            style: "success",
90
            style: "success",
90
            msg: msg,
91
            msg: msg,
91
          });
92
          });
92
          if(fetchCallback)
93
          if (fetchCallback)
93
            fetchCallback();
94
            fetchCallback();
94
        } else {
95
        } else {
95
          const errorMsg =
96
          const errorMsg =
96
            typeof resData.data === "string"
97
            typeof resData.data === "string"
97
              ? resData.data
98
              ? resData.data
Línea 130... Línea 131...
130
  };
131
  };
Línea 131... Línea 132...
131
 
132
 
132
  const getManageUrl = async () => {
133
  const getManageUrl = async () => {
133
    try {
134
    try {
134
      const res = await axios.get(link_admin)
135
      const res = await axios.get(link_admin)
135
      if(res.data.success){
136
      if (res.data.success) {
136
        window.open(res.data.data, '_backend')
137
        window.open(res.data.data, '_backend')
137
      }
138
      }
138
    } catch (error) {
139
    } catch (error) {
139
      console.log('>>: error > ', error)
140
      console.log('>>: error > ', error)
140
    }
141
    }
Línea 141... Línea 142...
141
  }
142
  }
142
 
143
 
143
  return (
-
 
144
    <div className="col-md-4 col-sm-6 col-12">
144
  return (
145
      <div className="company_profile_info border-radius border-gray">
145
    <div className="col-md-4 col-sm-6 col-12">
146
        <div className="company-up-info border-radius">
-
 
147
          <div className={!isTopData && "ph-15"}>
146
      <div className={styles.profile_info}>
148
            <div
147
        <div className={!isTopData && "px-4"}>
149
              className="row border-bottom-gray mb-2"
-
 
150
            >
148
          <div className="row border-bottom-gray mb-2">
151
              {
149
            {
152
                !!image && (
150
              !!image && (
153
                  <div className="col-md-4 col-sm-12 p-0">
151
                <div className="col-md-4 col-sm-12 p-0">
154
                    <img src={image} className="object-fit-contain" style={{borderRadius: 0}} alt="" />
152
                  <img src={image} className="object-fit-contain" style={{ borderRadius: 0 }} alt="" />
155
                  </div>
153
                </div>
156
                )
154
              )
157
              }
155
            }
158
              <div className={image ? 'col-md-8 d-flex justify-content-center align-items-center' : 'col-md-12 '+ ' col-sm-12 col-12'}>
156
            <div className={image ? 'col-md-8 d-flex justify-content-center align-items-center' : 'col-md-12 ' + ' col-sm-12 col-12'}>
159
                <div className="row">
157
              <div className="row">
160
                  <h3 className={status ? '' : "col-sm-12 d-flex justify-content-center align-items-center" + ' w-100'}>
-
 
161
                    {name}
-
 
162
                    {
-
 
163
                      status && (
-
 
164
                        <>
-
 
165
                          <br />
-
 
166
                          <h4 className="col-sm-12 d-flex justify-content-center align-items-center">{status}</h4>
-
 
167
                        </>
-
 
168
                      )
-
 
169
                    }
158
                <h3 className={status ? '' : "col-sm-12 d-flex justify-content-center align-items-center" + ' w-100'}>
170
                  </h3>
159
                  {name}
171
                  {
160
                  {
172
                    isTopData && (
-
 
173
                      <>
-
 
174
                        <div className="col-6 list-style-none">
-
 
175
                          {
-
 
176
                            link_view && (
-
 
177
                              <li>
-
 
178
                                <a
-
 
179
                                  href={link_view}
-
 
180
                                  data-link={link_view}
-
 
181
                                  title=""
-
 
182
                                  className="btn btn-secondary ellipsis"
-
 
183
                                >
-
 
184
                                  Ver perfil
-
 
185
                                </a>
-
 
186
                              </li>
-
 
187
                            )
161
                    status && (
188
                          }
162
                      <>
189
                        </div>
-
 
190
                        <div className="col-6 list-style-none">
-
 
191
                          {
-
 
192
                            link_inmail && (
-
 
193
                              <li>
-
 
194
                                <a
-
 
195
                                  href={link_inmail}
-
 
196
                                  data-link={link_inmail}
-
 
197
                                  title=""
-
 
198
                                  className="btn btn-primary"
-
 
199
                                >
-
 
200
                                  Mensaje
-
 
201
                                </a>
-
 
202
                              </li>
-
 
203
                            )
-
 
204
                          }
163
                        <br />
205
                        </div>
164
                        <h4 className="col-sm-12 d-flex justify-content-center align-items-center">{status}</h4>
206
                      </>
165
                      </>
207
                    )
166
                    )
-
 
167
                  }
-
 
168
                </h3>
-
 
169
                {
-
 
170
                  isTopData && (
-
 
171
                    <>
-
 
172
                      <div className="col-6 list-style-none">
-
 
173
                        {
-
 
174
                          link_view && (
-
 
175
                            <li>
-
 
176
                              <a
-
 
177
                                href={link_view}
-
 
178
                                data-link={link_view}
-
 
179
                                title=""
-
 
180
                                className="btn btn-secondary ellipsis"
-
 
181
                              >
-
 
182
                                Ver perfil
-
 
183
                              </a>
-
 
184
                            </li>
-
 
185
                          )
-
 
186
                        }
-
 
187
                      </div>
-
 
188
                      <div className="col-6 list-style-none">
-
 
189
                        {
-
 
190
                          link_inmail && (
-
 
191
                            <li>
-
 
192
                              <a
-
 
193
                                href={link_inmail}
-
 
194
                                data-link={link_inmail}
-
 
195
                                title=""
-
 
196
                                className="btn btn-primary"
-
 
197
                              >
-
 
198
                                Mensaje
-
 
199
                              </a>
-
 
200
                            </li>
-
 
201
                          )
-
 
202
                        }
-
 
203
                      </div>
-
 
204
                    </>
208
                  }
205
                  )
209
                </div>
206
                }
210
              </div>
207
              </div>
-
 
208
            </div>
Línea 411... Línea 409...
411
                </li>
409
              </li>
412
              )
-
 
413
            }
-
 
414
 
-
 
415
          </ul>
-
 
416
        </div>
-
 
417
        {link_delete && (
-
 
418
          <div style={{ position: "relative" }}>
-
 
419
            <ConfirmationBox
-
 
420
              show={showConfirmationBox}
-
 
421
              onClose={() => handleShowConfirmationBox(false)}
-
 
422
              onAccept={() => handleCancelApply(link_delete)}
-
 
423
            />
-
 
424
          </div>
-
 
425
        )}
-
 
426
        {link_cancel && (
-
 
427
          <div style={{ position: "relative" }}>
-
 
428
            <ConfirmationBox
-
 
429
              show={showCancelConfirmationBox}
-
 
430
              onClose={() => handleCancelConfirmationBox(false)}
-
 
431
              onAccept={() => handleCancelApply(link_cancel)}
-
 
432
            />
-
 
433
          </div>
-
 
434
        )}
-
 
435
        {link_block && (
-
 
436
          <div style={{ position: "relative" }}>
-
 
437
            <ConfirmationBox
-
 
438
              show={showBlockConfirmationBox}
-
 
439
              onClose={() => handleBlockConfirmationBox(false)}
-
 
440
              onAccept={() => handleCancelApply(link_block)}
-
 
441
            />
-
 
442
          </div>
-
 
443
        )}
-
 
444
        {link_approve && (
-
 
445
          <div style={{ position: "relative" }}>
-
 
446
            <ConfirmationBox
-
 
447
              show={showApproveConfirmationBox}
-
 
448
              onClose={() => handleApproveConfirmationBox(false)}
-
 
449
              onAccept={() => handleCancelApply(link_approve)}
-
 
450
            />
-
 
451
          </div>
-
 
452
        )}
-
 
453
        {link_reject && (
-
 
454
          <div style={{ position: "relative" }}>
-
 
455
            <ConfirmationBox
-
 
456
              show={showRejectConfirmationBox}
-
 
457
              onClose={() => handleRejectConfirmationBox(false)}
-
 
458
              onAccept={() => handleCancelApply(link_reject)}
-
 
459
            />
-
 
460
          </div>
-
 
461
        )}
-
 
462
        {link_request && (
-
 
463
          <div style={{ position: "relative" }}>
-
 
464
            <ConfirmationBox
-
 
465
              show={showRequestConfirmationBox}
-
 
466
              onClose={() => handleRequestConfirmationBox(false)}
-
 
467
              onAccept={() => handleCancelApply(link_request)}
-
 
468
            />
-
 
469
          </div>
-
 
470
        )}
-
 
471
        {link_unblock && (
-
 
472
          <div style={{ position: "relative" }}>
-
 
473
            <ConfirmationBox
-
 
474
              show={showUnblockConfirmationBox}
-
 
475
              onClose={() => handleUnblockConfirmationBox(false)}
-
 
476
              onAccept={() => handleCancelApply(link_unblock)}
-
 
477
            />
-
 
478
          </div>
-
 
479
        )}
-
 
480
        {link_leave && (
-
 
481
          <div style={{ position: "relative" }}>
-
 
482
            <ConfirmationBox
-
 
483
              show={showLeaveConfirmationBox}
-
 
484
              onClose={() => handleLeaveConfirmationBox(false)}
-
 
485
              onAccept={() => handleCancelApply(link_leave)}
-
 
486
            />
-
 
487
          </div>
-
 
488
        )}
-
 
489
        {loading && (
-
 
490
          <StyledSpinnerContainer>
410
            )
-
 
411
          }
-
 
412
 
-
 
413
        </ul>
-
 
414
      </div>
-
 
415
      {link_delete && (
-
 
416
        <div style={{ position: "relative" }}>
-
 
417
          <ConfirmationBox
-
 
418
            show={showConfirmationBox}
-
 
419
            onClose={() => handleShowConfirmationBox(false)}
-
 
420
            onAccept={() => handleCancelApply(link_delete)}
-
 
421
          />
-
 
422
        </div>
-
 
423
      )}
-
 
424
      {link_cancel && (
-
 
425
        <div style={{ position: "relative" }}>
-
 
426
          <ConfirmationBox
-
 
427
            show={showCancelConfirmationBox}
-
 
428
            onClose={() => handleCancelConfirmationBox(false)}
-
 
429
            onAccept={() => handleCancelApply(link_cancel)}
-
 
430
          />
-
 
431
        </div>
-
 
432
      )}
-
 
433
      {link_block && (
-
 
434
        <div style={{ position: "relative" }}>
-
 
435
          <ConfirmationBox
-
 
436
            show={showBlockConfirmationBox}
-
 
437
            onClose={() => handleBlockConfirmationBox(false)}
-
 
438
            onAccept={() => handleCancelApply(link_block)}
-
 
439
          />
-
 
440
        </div>
-
 
441
      )}
-
 
442
      {link_approve && (
-
 
443
        <div style={{ position: "relative" }}>
-
 
444
          <ConfirmationBox
-
 
445
            show={showApproveConfirmationBox}
-
 
446
            onClose={() => handleApproveConfirmationBox(false)}
-
 
447
            onAccept={() => handleCancelApply(link_approve)}
-
 
448
          />
-
 
449
        </div>
-
 
450
      )}
-
 
451
      {link_reject && (
-
 
452
        <div style={{ position: "relative" }}>
-
 
453
          <ConfirmationBox
-
 
454
            show={showRejectConfirmationBox}
-
 
455
            onClose={() => handleRejectConfirmationBox(false)}
-
 
456
            onAccept={() => handleCancelApply(link_reject)}
-
 
457
          />
-
 
458
        </div>
-
 
459
      )}
-
 
460
      {link_request && (
-
 
461
        <div style={{ position: "relative" }}>
-
 
462
          <ConfirmationBox
-
 
463
            show={showRequestConfirmationBox}
-
 
464
            onClose={() => handleRequestConfirmationBox(false)}
-
 
465
            onAccept={() => handleCancelApply(link_request)}
-
 
466
          />
-
 
467
        </div>
-
 
468
      )}
-
 
469
      {link_unblock && (
-
 
470
        <div style={{ position: "relative" }}>
-
 
471
          <ConfirmationBox
-
 
472
            show={showUnblockConfirmationBox}
-
 
473
            onClose={() => handleUnblockConfirmationBox(false)}
-
 
474
            onAccept={() => handleCancelApply(link_unblock)}
-
 
475
          />
-
 
476
        </div>
-
 
477
      )}
-
 
478
      {link_leave && (
-
 
479
        <div style={{ position: "relative" }}>
-
 
480
          <ConfirmationBox
-
 
481
            show={showLeaveConfirmationBox}
-
 
482
            onClose={() => handleLeaveConfirmationBox(false)}
-
 
483
            onAccept={() => handleCancelApply(link_leave)}
-
 
484
          />
-
 
485
        </div>
-
 
486
      )}
-
 
487
      {loading && (
491
            <Spinner />
488
        <StyledSpinnerContainer>
492
          </StyledSpinnerContainer>
489
          <Spinner />
493
        )}
490
        </StyledSpinnerContainer>
Línea 494... Línea 491...
494
      </div>
491
      )}