-
{vote.question}
+
+ {vote.question}
+
{vote.has_voted || successfullyVoted ? (
-
{alreadyVotedText}
+
{alreadyVotedText}
) : (
<>
-
diff --git a/src/components/vote/votePanel.js b/src/components/vote/votePanel.js
index 11887f5e..17345f4f 100644
--- a/src/components/vote/votePanel.js
+++ b/src/components/vote/votePanel.js
@@ -1,8 +1,12 @@
import React, { useEffect, useState } from 'react'
import VoteForm from './voteForm'
-import { formError } from '../../scss/vote.module.scss'
import backendService from '../request/backendService'
import socket, { joinRoom, leaveRoom } from '../request/socket'
+import {
+ formError,
+ votePanelHeader,
+ noActiveVoting,
+} from '../../scss/votePanel.module.scss'
const VotePanel = ({ meeting }) => {
const [votes, setVotes] = useState([])
@@ -116,11 +120,13 @@ const VotePanel = ({ meeting }) => {
return (
-
Rösta
- {errors &&
{errors.voteError}
}
+
Rösta
+ {errors.voteError &&
{errors.voteError}
}
{votes && (
<>
- {votes.length === 0 &&
Det finns ingen aktiv omröstning
}
+ {votes.length === 0 && (
+
Det finns ingen aktiv omröstning
+ )}
{votes.map((vote) => (
))}
diff --git a/src/components/votingAdmin/addVote.js b/src/components/votingAdmin/addVote.js
index dd1724f8..a408f626 100644
--- a/src/components/votingAdmin/addVote.js
+++ b/src/components/votingAdmin/addVote.js
@@ -14,8 +14,11 @@ const AddVote = ({ currentMeeting, create, updateData, update }) => {
)
const [alternatives, setAlternatives] = useState(
updateData
- ? updateData.alternatives.map(alt => createAlternative(alt))
- : [createAlternative({text: 'Vakant'}), createAlternative({text: 'Blankt'})]
+ ? updateData.alternatives.map((alt) => createAlternative(alt))
+ : [
+ createAlternative({ text: 'Vakant' }),
+ createAlternative({ text: 'Blankt' }),
+ ]
)
const [currentQuestion, setCurrentQuestion] = useState(
updateData ? updateData.open : true
@@ -27,7 +30,7 @@ const AddVote = ({ currentMeeting, create, updateData, update }) => {
Fråga
{
+ onChange={(e) => {
setQuestion(e.target.value)
}}
/>
@@ -38,9 +41,9 @@ const AddVote = ({ currentMeeting, create, updateData, update }) => {
{
+ onChange={(e) => {
const newVal = e.target.value
- setAlternatives(prev => [
+ setAlternatives((prev) => [
...prev.slice(0, i),
{ ...prev[i], text: newVal },
...prev.slice(i + 1),
@@ -50,7 +53,7 @@ const AddVote = ({ currentMeeting, create, updateData, update }) => {