Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7217 Rev 7218
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { Avatar } from '@mui/material'
2
import { Avatar } from '@mui/material'
3
import { Link } from 'react-router-dom'
3
import { Link } from 'react-router-dom'
4
import parse from 'html-react-parser'
4
import parse from 'html-react-parser'
5
import { useSelector } from 'react-redux'
5
import { useSelector } from 'react-redux'
-
 
6
import styled from 'styled-components'
6
import EditIcon from '@mui/icons-material/Edit'
7
import EditIcon from '@mui/icons-material/Edit'
7
import DeleteIcon from '@mui/icons-material/Delete'
8
import DeleteIcon from '@mui/icons-material/Delete'
Línea 8... Línea 9...
8
 
9
 
9
import {
10
import {
Línea 12... Línea 13...
12
  QuestionStats,
13
  QuestionStats,
13
  QuestionUserInfo,
14
  QuestionUserInfo,
14
  StyledQuestionCard,
15
  StyledQuestionCard,
15
} from './QuestionCard'
16
} from './QuestionCard'
16
import CommentSection from '../feed/CommentSection'
17
import CommentSection from '../feed/CommentSection'
-
 
18
import ReactionsButton from '../UI/buttons/ReactionsButton'
-
 
19
 
-
 
20
const AnswerActions = styled(QuestionActions)`
-
 
21
  margin-bottom: 0.5rem;
-
 
22
`
Línea 17... Línea 23...
17
 
23
 
18
const AnswerCard = ({
24
const AnswerCard = ({
19
  unique = '',
25
  // unique = '',
20
  uuid = '',
26
  // uuid = '',
-
 
27
  // question_uuid = '',
21
  question_uuid = '',
28
  time_elapsed = '',
22
  user_image = '',
29
  user_image = '',
23
  user_url = '',
30
  user_url = '',
24
  user_name = '',
-
 
25
  time_elapsed = '',
31
  user_name = '',
26
  text = '',
32
  text = '',
27
  reaction = '',
33
  reaction = '',
28
  total_comments = 0,
34
  total_comments = 0,
29
  total_reactions = 0,
35
  total_reactions = 0,
30
  comments = [
-
 
31
    {
-
 
32
      unique: '64de4a4714a45',
-
 
33
      answer_uuid: '0370dcb5-453c-4e6e-8fbf-c40b0488ca83',
-
 
34
      user_image:
-
 
35
        '/storage/type/user/code/e85129fa-18eb-4149-8640-fea9ae916cdc/filename/user-profile-64d514603a742.png/',
-
 
36
      user_url: '/profile/view/e85129fa-18eb-4149-8640-fea9ae916cdc',
-
 
37
      user_name: 'Santiago Olivera',
-
 
38
      time_elapsed: '2 meses',
-
 
39
      comment: 'weerwerwe',
-
 
40
      link_delete:
-
 
41
        '/my-coach/questions/comments/0370dcb5-453c-4e6e-8fbf-c40b0488ca83/delete/d2eda6ff-ca35-425c-b791-fe0e97aafc28',
-
 
42
    },
-
 
43
  ],
36
  comments = [],
44
  link_edit = '',
37
  link_edit = '',
45
  link_delete = '',
38
  link_delete = '',
46
  link_reaction_delete = '',
39
  link_reaction_delete = '',
47
  link_save_reaction = '',
40
  link_save_reaction = '',
Línea 67... Línea 60...
67
            </Link>
60
            </Link>
68
            <p>{user_name}</p>
61
            <p>{user_name}</p>
69
          </QuestionUserInfo>
62
          </QuestionUserInfo>
Línea 70... Línea 63...
70
 
63
 
-
 
64
          <QuestionStats className="mb-2">
-
 
65
            <span>{`${labels.published} ${time_elapsed}`}</span>
71
          <QuestionStats className="mb-2">
66
            <span>{`${total_reactions} ${labels.reactions}`}</span>
72
            <span>{`${comments} ${labels.comments}`}</span>
67
            <span>{`${total_comments} ${labels.comments}`}</span>
73
          </QuestionStats>
68
          </QuestionStats>
74
        </QuestionDetails>
69
        </QuestionDetails>
Línea 75... Línea 70...
75
        {text && parse(text)}
70
        {text && parse(text)}
76
 
71
 
77
        <QuestionActions>
72
        <AnswerActions>
78
          {link_edit && (
73
          {link_edit && (
79
            <button
74
            <button
80
              className="btn feed__share-option"
75
              className="btn feed__share-option"
Línea 91... Línea 86...
91
            >
86
            >
92
              <DeleteIcon />
87
              <DeleteIcon />
93
              {labels.delete}
88
              {labels.delete}
94
            </button>
89
            </button>
95
          )}
90
          )}
-
 
91
          {link_save_reaction && (
-
 
92
            <ReactionsButton
-
 
93
              currentReaction={reaction}
-
 
94
              saveUrl={link_save_reaction}
-
 
95
              deleteUrl={link_reaction_delete}
-
 
96
              withLabel
-
 
97
            />
-
 
98
          )}
96
        </QuestionActions>
99
        </AnswerActions>
97
        <CommentSection
100
        <CommentSection
98
          addUrl={link_add_comment}
101
          addUrl={link_add_comment}
99
          currentComments={comments}
102
          currentComments={comments}
100
          isShow
103
          isShow
101
        />
104
        />