Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2614 Rev 2806
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'
Línea 4... Línea 5...
4
 
5
 
5
import { axios } from '../../utils'
6
import { axios } from '../../utils'
Línea 6... Línea 7...
6
import { addNotification } from '../../redux/notification/notification.actions'
7
import { addNotification } from '../../redux/notification/notification.actions'
7
 
8
 
8
import QuestionCard from '../../components/my-coach/QuestionCard'
9
import QuestionCard from '../../components/my-coach/QuestionCard'
9
import AnswerCard from '../../components/my-coach/AnswerCard'
10
import AnswerCard from '../../components/my-coach/AnswerCard'
10
import AnswerModal from '../../components/my-coach/AnswerModal'
11
import AnswerModal from '../../components/my-coach/AnswerModal'
11
import ConfirmModal from '../../components/modals/ConfirmModal'
-
 
Línea 12... Línea 12...
12
import TitleSection from '../../components/UI/TitleSection'
12
import ConfirmModal from '../../components/modals/ConfirmModal'
13
import { Container, Grid } from '@mui/material'
13
import TitleSection from '../../components/UI/TitleSection'
14
 
14
 
15
const MyCoachViewPage = () => {
15
const MyCoachViewPage = () => {
Línea 197... Línea 197...
197
    }
197
    }
198
  }, [question])
198
  }, [question])
Línea 199... Línea 199...
199
 
199
 
200
  return (
200
  return (
201
    <>
-
 
202
      <Container sx={{ px: 0 }}>
201
    <>
Línea 203... Línea 202...
203
        <TitleSection title={labels.my_coach} />
202
      <TitleSection title={labels.my_coach} />
204
 
203
 
205
        <Grid container mt={1}>
204
      <Grid container mt={1}>
206
          <Grid
205
        <Grid
207
            item
206
          item
208
            xs={12}
207
          xs={12}
209
            md={8}
208
          md={8}
210
            mx='auto'
209
          mx='auto'
211
            sx={{
210
          sx={{
212
              display: 'flex',
211
            display: 'flex',
213
              flexDirection: 'column',
212
            flexDirection: 'column',
214
              gap: 1
213
            gap: 1
215
            }}
214
          }}
216
          >
215
        >
217
            <QuestionCard
216
          <QuestionCard
218
              key={question.uuid}
217
            key={question.uuid}
219
              onEdit={editQuestion}
218
            onEdit={editQuestion}
220
              onDelete={deleteQuestion}
219
            onDelete={deleteQuestion}
-
 
220
            onReply={addAnswer}
-
 
221
            {...question}
-
 
222
          />
-
 
223
 
-
 
224
          {answers.map((answer) => (
-
 
225
            <AnswerCard
-
 
226
              key={answer.unique}
-
 
227
              {...answer}
-
 
228
              onEdit={editAnswer}
-
 
229
              onDelete={deleteAnswer}
221
              onReply={addAnswer}
230
              updateComments={updateTotalComments}
222
              {...question}
-
 
223
            />
-
 
224
 
-
 
225
            {answers.map((answer) => (
-
 
226
              <AnswerCard
-
 
227
                key={answer.unique}
-
 
228
                {...answer}
-
 
229
                onEdit={editAnswer}
-
 
230
                onDelete={deleteAnswer}
-
 
231
                updateComments={updateTotalComments}
-
 
232
                updateReactions={updateTotalReactions}
231
              updateReactions={updateTotalReactions}
233
              />
-
 
234
            ))}
232
            />
235
          </Grid>
233
          ))}
-
 
234
        </Grid>
236
        </Grid>
235
      </Grid>
237
      </Container>
236
 
238
      <AnswerModal
237
      <AnswerModal
239
        url={currentAnswer ? actionUrl.current : addUrl.current}
238
        url={currentAnswer ? actionUrl.current : addUrl.current}
240
        show={['addAnswer', 'editAnswer'].includes(modalShow)}
239
        show={['addAnswer', 'editAnswer'].includes(modalShow)}