Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7209 Rev 7212
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { Avatar, Card } from '@mui/material'
2
import { Avatar, Card } from '@mui/material'
3
import { useSelector } from 'react-redux'
3
import { useSelector } from 'react-redux'
-
 
4
import { useHistory } from 'react-router-dom'
4
import styled from 'styled-components'
5
import styled from 'styled-components'
-
 
6
 
5
import OpenInNewIcon from '@mui/icons-material/OpenInNew'
7
import OpenInNewIcon from '@mui/icons-material/OpenInNew'
6
import EditIcon from '@mui/icons-material/Edit'
8
import EditIcon from '@mui/icons-material/Edit'
7
import DeleteIcon from '@mui/icons-material/Delete'
9
import DeleteIcon from '@mui/icons-material/Delete'
8
import { useHistory } from 'react-router-dom'
10
import ArrowBackIosNewIcon from '@mui/icons-material/ArrowBackIosNew'
Línea 9... Línea 11...
9
 
11
 
10
export const StyledQuestionCard = styled(Card)`
12
export const StyledQuestionCard = styled(Card)`
11
  background: var(--bg-color);
13
  background: var(--bg-color);
12
  border: 1px solid var(--border-primary);
14
  border: 1px solid var(--border-primary);
Línea 100... Línea 102...
100
`
102
`
Línea 101... Línea 103...
101
 
103
 
102
const QuestionCard = ({
104
const QuestionCard = ({
103
  updated_on = '',
105
  updated_on = '',
-
 
106
  link_add_comment = '',
104
  link_add_comment = '',
107
  last_answer_on = '',
105
  added_on = '',
108
  added_on = '',
106
  user_name = '',
109
  user_name = '',
107
  user_image = '',
110
  user_image = '',
108
  title = '',
111
  title = '',
Línea 113... Línea 116...
113
  reactions = 0,
116
  reactions = 0,
114
  comments = 0,
117
  comments = 0,
115
  link_view = '',
118
  link_view = '',
116
  link_edit = '',
119
  link_edit = '',
117
  link_delete = '',
120
  link_delete = '',
-
 
121
  link_answers_add = '',
-
 
122
  link_answers = '',
118
  onDelete = () => null,
123
  onDelete = () => null,
119
  onEdit = () => null,
124
  onEdit = () => null,
-
 
125
  onReply = () => null,
120
}) => {
126
}) => {
121
  const labels = useSelector(({ intl }) => intl.labels)
127
  const labels = useSelector(({ intl }) => intl.labels)
122
  const history = useHistory()
128
  const history = useHistory()
Línea 123... Línea 129...
123
 
129
 
Línea 143... Línea 149...
143
        </QuestionCategories>
149
        </QuestionCategories>
144
      </QuestionDetails>
150
      </QuestionDetails>
Línea 145... Línea 151...
145
 
151
 
146
      <h2>{title}</h2>
152
      <h2>{title}</h2>
-
 
153
      <span>{`${labels.my_coach_question} ${added_on}`}</span>
-
 
154
      {last_answer_on && (
-
 
155
        <span>{`${labels.my_coach_question} ${last_answer_on}`}</span>
147
      <span>{`${labels.my_coach_question} ${added_on}`}</span>
156
      )}
Línea 148... Línea 157...
148
      <p className="my-3">{description}</p>
157
      <p className="my-3">{description}</p>
149
 
158
 
150
      <QuestionStats className="mb-2">
159
      <QuestionStats className="mb-2">
151
        <span>{`${answers} ${labels.my_coach_answers}`}</span>
160
        <span>{`${answers} ${labels.my_coach_answers}`}</span>
152
        <span>{`${reactions} ${labels.my_coach_reactions}`}</span>
161
        <span>{`${reactions} ${labels.my_coach_reactions}`}</span>
153
        <span>{`${views} ${labels.my_coach_views}`}</span>
162
        <span>{`${views} ${labels.my_coach_views}`}</span>
Línea 154... Línea 163...
154
        <span>{`${comments} ${labels.comments}`}</span>
163
        <span>{`${comments} ${labels.comments}`}</span>
-
 
164
      </QuestionStats>
-
 
165
 
-
 
166
      <QuestionActions>
-
 
167
        {link_answers && (
-
 
168
          <button
-
 
169
            className="btn feed__share-option"
-
 
170
            onClick={() => onView(link_view)}
-
 
171
          >
-
 
172
            <ArrowBackIosNewIcon />
155
      </QuestionStats>
173
            {labels.back}
156
 
174
          </button>
157
      <QuestionActions>
175
        )}
158
        {link_view && (
176
        {link_view && (
159
          <button
177
          <button
Línea 171... Línea 189...
171
          >
189
          >
172
            <EditIcon />
190
            <EditIcon />
173
            {labels.edit}
191
            {labels.edit}
174
          </button>
192
          </button>
175
        )}
193
        )}
-
 
194
        {link_answers_add && (
-
 
195
          <button
-
 
196
            className="btn feed__share-option"
-
 
197
            onClick={() => onReply(link_edit)}
-
 
198
          >
-
 
199
            <EditIcon />
-
 
200
            {labels.reply}
-
 
201
          </button>
-
 
202
        )}
176
        {link_delete && (
203
        {link_delete && (
177
          <button
204
          <button
178
            className="btn feed__share-option"
205
            className="btn feed__share-option"
179
            onClick={() => onDelete(link_delete)}
206
            onClick={() => onDelete(link_delete)}
180
          >
207
          >