Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1659 Rev 1660
Línea 40... Línea 40...
40
  } = comment
40
  } = comment
41
  const [showConfirmModal, setShowConfirmModal] = useState(false)
41
  const [showConfirmModal, setShowConfirmModal] = useState(false)
42
  const labels = useSelector(({ intl }) => intl.labels)
42
  const labels = useSelector(({ intl }) => intl.labels)
43
  const dispatch = useDispatch()
43
  const dispatch = useDispatch()
Línea 44... Línea -...
44
 
-
 
45
  const actions = useMemo(() => {
-
 
46
    const options = []
-
 
47
    if (link_delete) {
-
 
48
      options.push({ label: 'Borrar', action: toggleModal })
-
 
49
    }
-
 
50
 
-
 
51
    if (link_abuse_report) {
-
 
52
      options.push({ label: 'Reportar', action: reportComment })
-
 
53
    }
-
 
54
 
-
 
55
    return options
-
 
56
  }, [link_delete, link_abuse_report])
-
 
57
 
44
 
Línea 58... Línea 45...
58
  const toggleModal = () => setShowConfirmModal(!showConfirmModal)
45
  const toggleModal = () => setShowConfirmModal(!showConfirmModal)
59
 
46
 
60
  const reportComment = () =>
47
  const reportComment = () =>
Línea 86... Línea 73...
86
      .catch((error) => {
73
      .catch((error) => {
87
        dispatch(addNotification({ style: 'danger', msg: error.message }))
74
        dispatch(addNotification({ style: 'danger', msg: error.message }))
88
      })
75
      })
89
  }
76
  }
Línea -... Línea 77...
-
 
77
 
-
 
78
  const actions = useMemo(() => {
-
 
79
    const options = []
-
 
80
    if (link_delete) {
-
 
81
      options.push({ label: 'Borrar', action: toggleModal })
-
 
82
    }
-
 
83
 
-
 
84
    if (link_abuse_report) {
-
 
85
      options.push({ label: 'Reportar', action: reportComment })
-
 
86
    }
-
 
87
 
-
 
88
    return options
-
 
89
  }, [link_delete, link_abuse_report])
90
 
90
 
91
  return (
91
  return (
92
    <>
92
    <>
93
      <StyledCommentTemplate>
93
      <StyledCommentTemplate>
94
        <div className='content'>
94
        <div className='content'>
Línea 97... Línea 97...
97
              <h3>{user_name}</h3>
97
              <h3>{user_name}</h3>
98
            </Link>
98
            </Link>
99
            <span>{time_elapsed}</span>
99
            <span>{time_elapsed}</span>
100
          </div>
100
          </div>
Línea 101... Línea 101...
101
 
101
 
Línea 102... Línea 102...
102
          <Options options={actions} right='0.5rem' top='1.5rem' />
102
          <Options options={actions} />
103
 
103
 
104
          <p>{content}</p>
104
          <p>{content}</p>