Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2210 Rev 2246
Línea 64... Línea 64...
64
 
64
 
65
  // states
65
  // states
66
  const [currentTab, setCurrentTab] = useState(withoutFeeds ? groupTabs.INFO_TAB : groupTabs.FEED_TAB);
66
  const [currentTab, setCurrentTab] = useState(withoutFeeds ? groupTabs.INFO_TAB : groupTabs.FEED_TAB);
67
  const [actionLinks, setActionLinks] = useState({})
67
  const [actionLinks, setActionLinks] = useState({})
68
  const [linkInvite, setLinkInvite] = useState('')
68
  const [linkInvite, setLinkInvite] = useState('')
69
  
69
 
70
  setTimelineUrl(routeTimeline);
70
  setTimelineUrl(routeTimeline);
71
  const load = () =>{
71
  const load = () => {
72
    axios.get('')
72
    axios.get('')
73
      .then(res => {
73
      .then(res => {
74
        if(res.data.success){
74
        if (res.data.success) {
75
          setActionLinks(res.data.data)
75
          setActionLinks(res.data.data)
76
        }else{
76
        } else {
77
          AddNotification({
77
          AddNotification({
78
            type: 'error',
78
            type: 'error',
79
            payload: res.data.data
79
            payload: res.data.data
80
          })
80
          })
81
        }
81
        }
82
      })
82
      })
83
      .catch(err => {
83
      .catch(err => {
84
        console.log('>>: err > ', err)
84
        console.log('>>: err > ', err)
85
      })
85
      })
86
  }
86
  }
87
  
87
 
88
  React.useEffect(() =>{
88
  React.useEffect(() => {
89
    load()
89
    load()
Línea 90... Línea 90...
90
  }, [])
90
  }, [])
91
 
91
 
92
  const handleActionLink = (url) => {
92
  const handleActionLink = (url) => {
93
    axios.post(url)
93
    axios.post(url)
94
      .then(res => {
94
      .then(res => {
95
        if(res.data.success){
95
        if (res.data.success) {
96
          AddNotification({
96
          AddNotification({
97
            style: 'success',
97
            style: 'success',
98
            msg: res.data.data
98
            msg: res.data.data
99
          })
99
          })
100
          window.location.reload()
100
          window.location.reload()
101
        }else{
101
        } else {
102
          AddNotification({
102
          AddNotification({
103
            style: 'error',
103
            style: 'error',
104
            msg: res.data.data
104
            msg: res.data.data
105
          })
105
          })
106
        }
106
        }
107
      })
107
      })
108
      .catch(err => {
108
      .catch(err => {
109
        console.log('>>: err > ', err)
109
        console.log('>>: err > ', err)
110
      })
110
      })
111
  }
111
  }
112
  
112
 
113
  return (
113
  return (
114
    <React.Fragment>
114
    <React.Fragment>
115
      <section className="cover-sec">
115
      <section className="cover-sec">
116
        <img
116
        <img
117
          // src="<?php echo $this->url('storage', ['type' => 'group-cover', 'code' => $group_id_encrypted, 'filename' => $cover]) ?>"
-
 
118
          src={`/storage/type/group-cover/code/${groupId}/${
117
          // src="<?php echo $this->url('storage', ['type' => 'group-cover', 'code' => $group_id_encrypted, 'filename' => $cover]) ?>"
119
            cover ? `filename/${cover}` : ""
118
          src={`/storage/type/group-cover/code/${groupId}/${cover ? `filename/${cover}` : ""
120
          }`}
119
            }`}
121
          alt="cover-image"
120
          alt="cover-image"
122
        />
121
        />
123
      </section>
122
      </section>
Línea 130... Línea 129...
130
                  <div className="main-left-sidebar border-radius border-gray">
129
                  <div className="main-left-sidebar border-radius border-gray">
131
                    <div className="user_profile m-0 p-1">
130
                    <div className="user_profile m-0 p-1">
132
                      <div className="user-pro-img">
131
                      <div className="user-pro-img">
133
                        <img
132
                        <img
134
                          // src="<?php echo $this->url('storage', ['type' => 'group', 'code' => $group_id_encrypted, 'filename' => $image]) ?>"
133
                          // src="<?php echo $this->url('storage', ['type' => 'group', 'code' => $group_id_encrypted, 'filename' => $image]) ?>"
135
                          src={`/storage/type/group/code/${groupId}/${
134
                          src={`/storage/type/group/code/${groupId}/${image ? `filename/${image}` : ""
136
                            image ? `filename/${image}` : ""
-
 
137
                          }`}
135
                            }`}
138
                          alt="profile-image"
136
                          alt="profile-image"
139
                        />
137
                        />
140
                      </div>
138
                      </div>
141
                      <div className="user_pro_status">
139
                      <div className="user_pro_status">
142
                        <h1  className="font-weight-bold" style={{fontSize: '1.5rem'}} >{name}</h1>
140
                        <h1 className="font-weight-bold" style={{ fontSize: '1.5rem' }} >{name}</h1>
143
                        <ul className="flw-status">
141
                        <ul className="flw-status">
144
                          <div
142
                          <div
145
                            className="container horizontal-list"
143
                            className="container horizontal-list"
146
                          >
144
                          >
147
                            <div
145
                            <div
148
                              className="row "
146
                              className="row "
149
                            >
147
                            >
150
                              <div className="col">
148
                              <div className="col">
151
                                <p>Miembros</p>
149
                                <p>Miembros</p>
152
                                <b style={{fontSize: '1rem'}} >{totalMembers}</b>
150
                                <b style={{ fontSize: '1rem' }} >{totalMembers}</b>
153
                              </div>
151
                              </div>
154
                              <div className="col">
152
                              <div className="col">
155
                                <a
153
                                <a
156
                                  href={linkInmail || '#'}
154
                                  href={linkInmail || '#'}
157
                                  className="btn btn-primary"
155
                                  className="btn btn-primary"
Línea 160... Línea 158...
160
                                  Mensaje
158
                                  Mensaje
161
                                </a>
159
                                </a>
162
                              </div>
160
                              </div>
163
                              {
161
                              {
164
                                actionLinks.link_accept && (
162
                                actionLinks.link_accept && (
165
                                  <div
-
 
166
                                    className="col"
163
                                  <div className="col">
167
                                  >
-
 
168
                                    <button
164
                                    <button
169
                                      onClick={() => handleActionLink(actionLinks.link_accept)}
165
                                      onClick={() => handleActionLink(actionLinks.link_accept)}
170
                                      className="btn btn-primary"
166
                                      className="btn btn-primary"
171
                                      title=""
167
                                      title=""
172
                                    >
168
                                    >
Línea 177... Línea 173...
177
                                  </div>
173
                                  </div>
178
                                )
174
                                )
179
                              }
175
                              }
180
                              {
176
                              {
181
                                actionLinks.link_cancel && (
177
                                actionLinks.link_cancel && (
182
                                  <div
-
 
183
                                    className="col"
178
                                  <div className="col">
184
                                  >
-
 
185
                                    <button
179
                                    <button
186
                                      onClick={() => handleActionLink(actionLinks.link_cancel)}
180
                                      onClick={() => handleActionLink(actionLinks.link_cancel)}
187
                                      className="btn btn-primary"
181
                                      className="btn btn-primary"
188
                                      title=""
182
                                      title=""
189
                                    >
183
                                    >
Línea 194... Línea 188...
194
                                  </div>
188
                                  </div>
195
                                )
189
                                )
196
                              }
190
                              }
197
                              {
191
                              {
198
                                (!linkInvite && actionLinks.link_leave) && (
192
                                (!linkInvite && actionLinks.link_leave) && (
199
                                  <div
-
 
200
                                    className="col"
193
                                  <div className="col">
201
                                  >
-
 
202
                                    <button
194
                                    <button
203
                                      onClick={() => handleActionLink(actionLinks.link_leave)}
195
                                      onClick={() => handleActionLink(actionLinks.link_leave)}
204
                                      className="btn btn-primary"
196
                                      className="btn btn-primary"
205
                                      title=""
197
                                      title=""
206
                                    >
198
                                    >
Línea 211... Línea 203...
211
                                  </div>
203
                                  </div>
212
                                )
204
                                )
213
                              }
205
                              }
214
                              {
206
                              {
215
                                actionLinks.link_request && (
207
                                actionLinks.link_request && (
216
                                  <div
-
 
217
                                    className="col"
-
 
218
                                  >
-
 
219
                                    <button
-
 
220
                                      onClick={() => handleActionLink(actionLinks.link_request)}
-
 
221
                                      className="btn btn-primary"
-
 
222
                                      title=""
-
 
223
                                    >
-
 
224
                                      Solicitar membresia
-
 
225
                                    </button>
-
 
226
                                  </div>
-
 
227
                                )
-
 
228
                              }
-
 
229
                              {
-
 
230
                                actionLinks.link_request && (
-
 
231
                                  <div className="col">
208
                                  <div className="col">
232
                                    <button
209
                                    <button
233
                                      onClick={() => handleActionLink(actionLinks.link_request)}
210
                                      onClick={() => handleActionLink(actionLinks.link_request)}
234
                                      className="btn btn-primary"
211
                                      className="btn btn-primary"
235
                                      title=""
212
                                      title=""
Línea 239... Línea 216...
239
                                  </div>
216
                                  </div>
240
                                )
217
                                )
241
                              }
218
                              }
242
                            </div>
219
                            </div>
243
                          </div>
220
                          </div>
244
                          
221
 
245
                        </ul>
222
                        </ul>
246
                      </div>
223
                      </div>
247
                    </div>
224
                    </div>
248
                  </div>
225
                  </div>
249
                  <GroupMembersHelper groupId={groupId} handleFirstLinkInvite={link => setLinkInvite(link)} />
226
                  <GroupMembersHelper groupId={groupId} handleFirstLinkInvite={link => setLinkInvite(link)} />
250
                </div>
227
                </div>
Línea 251... Línea 228...
251
 
228
 
252
                <div className="col-lg-6">
229
                <div className="col-lg-6">
253
                  <div className="message-btn d-block d-md-none d-lg-none d-sm-none">
230
                  <div className="message-btn d-block d-md-none d-lg-none d-sm-none">
254
                    
231
 
255
                  </div>
232
                  </div>
256
                  <div className="main-ws-sec">
233
                  <div className="main-ws-sec">
257
                    <div className="user-tab-sec">
234
                    <div className="user-tab-sec">
258
                      {
235
                      {
259
                        !withoutFeeds && (
236
                        !withoutFeeds && (
260
                          <div className="row">
237
                          <div className="row">
261
                            <div className="col text-left pl-0">
238
                            <div className="col text-left pl-0">
262
                              <button
-
 
263
                                className={` ${
239
                              <button
264
                                  currentTab === groupTabs.FEED_TAB ? "active" : ""
240
                                className={` ${currentTab === groupTabs.FEED_TAB ? "active" : ""
265
                                } animated fadeIn btn btn-link p-0 text-decoration-none`}
241
                                  } animated fadeIn btn btn-link p-0 text-decoration-none`}
266
                                onClick={(e) => {
242
                                onClick={(e) => {
267
                                  e.preventDefault();
243
                                  e.preventDefault();
268
                                  setCurrentTab(groupTabs.FEED_TAB);
244
                                  setCurrentTab(groupTabs.FEED_TAB);
269
                                  
245
 
270
                                }}
246
                                }}
271
                              >
247
                              >
272
                                <span className="ellipsis text-dark font-weight-bold">Ver Publicaciones</span>
248
                                <span className="ellipsis text-dark font-weight-bold">Ver Publicaciones</span>
273
                              </button>
249
                              </button>
274
                            </div>
250
                            </div>
275
                            <div className="col text-right pl-0">
251
                            <div className="col text-right pl-0">
276
                              <button
-
 
277
                                className={` ${
252
                              <button
278
                                  currentTab === groupTabs.INFO_TAB ? "active" : ""
253
                                className={` ${currentTab === groupTabs.INFO_TAB ? "active" : ""
279
                                } animated fadeIn btn btn-link p-0 text-decoration-none`}
254
                                  } animated fadeIn btn btn-link p-0 text-decoration-none`}
280
                                onClick={(e) => {
255
                                onClick={(e) => {
281
                                  e.preventDefault();
256
                                  e.preventDefault();
282
                                  setCurrentTab(groupTabs.INFO_TAB);
257
                                  setCurrentTab(groupTabs.INFO_TAB);
283
                                }}
258
                                }}
Línea 298... Línea 273...
298
                      style={{
273
                      style={{
299
                        display:
274
                        display:
300
                          currentTab === groupTabs.FEED_TAB ? "block" : "none",
275
                          currentTab === groupTabs.FEED_TAB ? "block" : "none",
301
                      }}
276
                      }}
302
                    >
277
                    >
303
                      <div className="">
-
 
304
                        <ShareFeed
278
                      <ShareFeed
305
                          feedType={feedTypes.GROUP}
279
                        feedType={feedTypes.GROUP}
306
                          postUrl={`/feed/add/group/${groupId}`}
280
                        postUrl={`/feed/add/group/${groupId}`}
307
                        />
281
                      />
308
                      </div>
-
 
309
                      {/* <!--posts-section star--> */}
282
                      {/* <!--posts-section star--> */}
310
                      <div className="posts-section">
283
                      <div className="posts-section">
311
                        <FeedSection routeTimeline={routeTimeline} />
284
                        <FeedSection routeTimeline={routeTimeline} />
312
                      </div>
285
                      </div>
313
                      {/* <!--posts-section end--> */}
286
                      {/* <!--posts-section end--> */}