Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3741 Rev 3745
Línea 1... Línea 1...
1
import React, { useEffect, useRef, useState } from 'react';
1
import React, { useEffect, useRef, useState } from 'react';
2
import { useNavigate, useLocation } from 'react-router-dom';
2
import { useNavigate, useLocation } from 'react-router-dom';
3
import { useDispatch, useSelector } from 'react-redux';
3
import { useDispatch, useSelector } from 'react-redux';
4
import { Grid } from '@mui/material';
-
 
5
 
-
 
6
import { axios } from '../../../utils';
-
 
7
import { addNotification } from '../../../redux/notification/notification.actions';
-
 
8
 
-
 
9
import ConfirmModal from '../../../components/modals/ConfirmModal';
-
 
10
import GoBackLayout from '@layouts/go-back';
-
 
11
import { AnswerCard, AnswerModal, QuestionCard } from '@my-coach/components';
4
import { QuestionCard } from '@my-coach/components';
Línea 12... Línea 5...
12
 
5
 
13
export function MyCoachViewPage() {
6
export function MyCoachViewPage() {
14
  const [question, setQuestion] = useState({});
7
  const [question, setQuestion] = useState({});
15
  const [answers, setAnswers] = useState([]);
8
  const [answers, setAnswers] = useState([]);
Línea 190... Línea 183...
190
        });
183
        });
191
    }
184
    }
192
  }, [question]);
185
  }, [question]);
Línea 193... Línea 186...
193
 
186
 
194
  return (
-
 
195
    <GoBackLayout title={labels.my_coach}>
187
  return (
196
      <Grid container>
-
 
197
        <Grid size={{ xs: 12, md: 8 }} sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>
188
    <>
198
          <QuestionCard
-
 
199
            key={question.uuid}
189
      <QuestionCard
200
            onEdit={editQuestion}
190
        onEdit={editQuestion}
201
            onDelete={deleteQuestion}
191
        onDelete={deleteQuestion}
202
            onReply={addAnswer}
192
        onReply={addAnswer}
203
            question={question}
193
        question={question}
204
          />
-
 
205
 
194
      />
206
          {answers.map((answer) => (
195
      {/* {answers.map((answer) => (
207
            <AnswerCard
196
        <AnswerCard
208
              key={answer.unique}
197
          key={answer.unique}
209
              {...answer}
198
          {...answer}
210
              onEdit={editAnswer}
199
          onEdit={editAnswer}
211
              onDelete={deleteAnswer}
200
          onDelete={deleteAnswer}
212
              updateComments={updateTotalComments}
201
          updateComments={updateTotalComments}
213
              updateReactions={updateTotalReactions}
202
          updateReactions={updateTotalReactions}
214
            />
203
        />
215
          ))}
-
 
216
        </Grid>
-
 
217
      </Grid>
-
 
218
 
204
      ))}
219
      <AnswerModal
205
      <AnswerModal
220
        url={currentAnswer ? actionUrl.current : addUrl.current}
206
        url={currentAnswer ? actionUrl.current : addUrl.current}
221
        show={['addAnswer', 'editAnswer'].includes(modalShow)}
207
        show={['addAnswer', 'editAnswer'].includes(modalShow)}
222
        currentAnswer={currentAnswer}
208
        currentAnswer={currentAnswer}
Línea 226... Línea 212...
226
      <ConfirmModal
212
      <ConfirmModal
227
        show={modalShow === 'deleteAnswer'}
213
        show={modalShow === 'deleteAnswer'}
228
        onClose={closeModal}
214
        onClose={closeModal}
229
        onAccept={confirmDeleteAnswer}
215
        onAccept={confirmDeleteAnswer}
230
      />
216
      />
231
      <ConfirmModal show={modalShow === 'delete'} onClose={closeModal} onAccept={confirmDelete} />
217
      <ConfirmModal show={modalShow === 'delete'} onClose={closeModal} onAccept={confirmDelete} /> */}
232
    </GoBackLayout>
218
    </>
233
  );
219
  );
234
}
220
}