Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7221 Rev 7225
Línea 6... Línea 6...
6
import { addNotification } from '../../redux/notification/notification.actions'
6
import { addNotification } from '../../redux/notification/notification.actions'
Línea 7... Línea 7...
7
 
7
 
8
import ConfirmModal from '../modals/ConfirmModal'
8
import ConfirmModal from '../modals/ConfirmModal'
9
import useOutsideClick from '../../hooks/useOutsideClick'
9
import useOutsideClick from '../../hooks/useOutsideClick'
-
 
10
import FormErrorFeedback from '../UI/FormErrorFeedback'
Línea 10... Línea 11...
10
import FormErrorFeedback from '../UI/FormErrorFeedback'
11
import Options from '../UI/Option'
11
 
12
 
12
const FeedComments = ({
13
const FeedComments = ({
13
  isShow = true,
14
  isShow = true,
Línea 124... Línea 125...
124
    time_elapsed,
125
    time_elapsed,
125
    comment: content,
126
    comment: content,
126
    link_delete,
127
    link_delete,
127
  } = comment
128
  } = comment
128
  const [showConfirmModal, setShowConfirmModal] = useState(false)
129
  const [showConfirmModal, setShowConfirmModal] = useState(false)
129
  const [displayOption, setDisplayOption] = useState(false)
-
 
130
  const deleteButton = useRef(null)
-
 
131
  const labels = useSelector(({ intl }) => intl.labels)
130
  const labels = useSelector(({ intl }) => intl.labels)
132
  useOutsideClick(deleteButton, () => setDisplayOption(false))
-
 
Línea -... Línea 131...
-
 
131
 
133
 
132
  const toggleModal = () => {
-
 
133
    setShowConfirmModal(!showConfirmModal)
Línea 134... Línea 134...
134
  const toggleModal = () => setShowConfirmModal(!showConfirmModal)
134
  }
135
 
135
 
136
  return (
136
  return (
137
    <li>
137
    <li>
Línea 141... Línea 141...
141
            <a href={user_url}>
141
            <a href={user_url}>
142
              <h3>{user_name}</h3>
142
              <h3>{user_name}</h3>
143
            </a>
143
            </a>
144
            <span>
144
            <span>
145
              {time_elapsed}
145
              {time_elapsed}
146
              {comment.link_delete && (
146
              {link_delete && (
147
                <>
-
 
148
                  <img
147
                <Options
149
                    src="/images/icons/options.png"
-
 
150
                    className="cursor-pointer img-icon options-sm"
-
 
151
                    onClick={() => setDisplayOption(!displayOption)}
-
 
152
                  />
-
 
153
                  <div
148
                  options={[
154
                    className={`comments-options ${
-
 
155
                      displayOption ? 'active' : ''
-
 
156
                    }`}
149
                    {
157
                  >
-
 
158
                    <ul>
-
 
159
                      <li>
-
 
160
                        <button
-
 
161
                          className="option-btn"
-
 
162
                          onClick={toggleModal}
-
 
163
                          ref={deleteButton}
-
 
164
                        >
-
 
165
                          <i className="fa fa-trash-o mr-1" />
-
 
166
                          {labels.delete}
150
                      label: labels.delete,
167
                        </button>
151
                      action: toggleModal,
168
                      </li>
-
 
169
                    </ul>
152
                    },
170
                  </div>
153
                  ]}
171
                </>
154
                />
172
              )}
155
              )}
173
            </span>
156
            </span>
174
          </div>
157
          </div>
175
          <p>{content}</p>
158
          <p>{content}</p>
176
        </div>
159
        </div>