Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6399 Rev 6401
Línea 11... Línea 11...
11
const SurveyForm = ({
11
const SurveyForm = ({
12
  question,
12
  question,
13
  answers = [],
13
  answers = [],
14
  active,
14
  active,
15
  time,
15
  time,
-
 
16
  resultType,
16
  voteUrl,
17
  voteUrl,
17
  addNotification,
18
  addNotification, // Redux action
-
 
19
  updateFeed, // Redux action
18
}) => {
20
}) => {
19
  const [isActive, setIsActive] = useState(Boolean(active))
21
  const [isActive, setIsActive] = useState(Boolean(active))
20
  const { register, handleSubmit } = useForm()
22
  const { register, handleSubmit } = useForm()
Línea 21... Línea 23...
21
 
23
 
Línea 44... Línea 46...
44
  })
46
  })
Línea 45... Línea 47...
45
 
47
 
46
  return (
48
  return (
47
    <form onChange={sendVote} className={styles.survey_form}>
49
    <form onChange={sendVote} className={styles.survey_form}>
-
 
50
      <h3>{question}</h3>
-
 
51
      {resultType === 'pu' && <p>El autor puede ver tu voto</p>}
48
      <h3>{question}</h3>
52
      {resultType === 'pr' && <p>Tu voto es privado</p>}
49
      {answers.map(
53
      {answers.map(
50
        (option, index) =>
54
        (option, index) =>
-
 
55
          option && (
51
          option && (
56
            <div
-
 
57
              className={`${styles.survey_input} ${
-
 
58
                !isActive ? 'disabled' : ''
-
 
59
              }`}
-
 
60
              key={index}
52
            <div className={styles.survey_input} key={index}>
61
            >
53
              <input
62
              <input
54
                type="radio"
63
                type="radio"
55
                name="vote"
64
                name="vote"
56
                id={`vote-${index + 1}`}
65
                id={`vote-${index + 1}`}
Línea 66... Línea 75...
66
  )
75
  )
67
}
76
}
Línea 68... Línea 77...
68
 
77
 
69
const mapDispatchToProps = {
78
const mapDispatchToProps = {
-
 
79
  addNotification: (notification) => addNotification(notification),
70
  addNotification: (notification) => addNotification(notification),
80
  updateFeed: (payload) => updateFeed(payload),
Línea 71... Línea 81...
71
}
81
}