Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3015 Rev 3017
Línea 27... Línea 27...
27
    shared_content_type: sharedContentType
27
    shared_content_type: sharedContentType
28
  } = useSelector(({ feed }) => feed.feeds.byId[id])
28
  } = useSelector(({ feed }) => feed.feeds.byId[id])
Línea 29... Línea 29...
29
 
29
 
30
  const answers = useMemo(() => {
30
  const answers = useMemo(() => {
-
 
31
    if (contentType !== 'fast-survey') return []
-
 
32
    return Array.from(
31
    if (contentType !== 'fast-survey') return []
33
      { length: description.number_of_answers },
-
 
34
      (_, i) => description[`answer${i + 1}`]
32
    return Array.from({ length: 5 }, (_, i) => description[`answer${i + 1}`])
35
    )
Línea 33... Línea 36...
33
  }, [description, contentType])
36
  }, [description, contentType])
34
 
37
 
-
 
38
  const votes = useMemo(() => {
-
 
39
    if (contentType !== 'fast-survey') return []
35
  const votes = useMemo(() => {
40
    return Array.from(
-
 
41
      { length: description.number_of_votes ?? 0 },
36
    if (contentType !== 'fast-survey') return []
42
      (_, i) => description[`votes${i + 1}`]
Línea 37... Línea 43...
37
    return Array.from({ length: 5 }, (_, i) => description[`votes${i + 1}`])
43
    )
Línea 38... Línea 44...
38
  }, [description, contentType])
44
  }, [description, contentType])
Línea 85... Línea 91...
85
        )
91
        )
86
      }
92
      }
87
      case 'fast-survey': {
93
      case 'fast-survey': {
88
        return (
94
        return (
89
          <SurveyForm
95
          <SurveyForm
-
 
96
            voteUrl={voteUrl}
90
            active={description.active}
97
            active={Boolean(description.active)}
91
            question={description.question}
98
            question={description.question}
-
 
99
            time={description.time_remaining}
-
 
100
            resultType={description.result_type}
92
            answers={answers}
101
            answers={answers}
93
            votes={votes}
102
            votes={votes}
94
            time={description.time_remaining}
-
 
95
            voteUrl={voteUrl}
-
 
96
            voted={description.voted}
-
 
97
          />
103
          />
98
        )
104
        )
99
      }
105
      }
100
      case 'shared': {
106
      case 'shared': {
101
        return (
107
        return (