Skip to content
Snippets Groups Projects
Commit df504cf2 authored by germanocaumo's avatar germanocaumo
Browse files

refactor(quick-poll): Remove unneeded code for poll answers

The answers are already translated in the UI based on type.
parent 0be7c6c9
No related branches found
No related tags found
No related merge requests found
......@@ -43,30 +43,7 @@ const propTypes = {
amIPresenter: PropTypes.bool.isRequired,
};
const getLocalizedAnswers = (type, intl, pollTypes) => {
switch (type) {
case pollTypes.TrueFalse:
return [
intl.formatMessage(intlMessages.trueOptionLabel),
intl.formatMessage(intlMessages.falseOptionLabel),
];
case pollTypes.YesNo:
return [
intl.formatMessage(intlMessages.yesOptionLabel),
intl.formatMessage(intlMessages.noOptionLabel),
];
case pollTypes.YesNoAbstention:
return [
intl.formatMessage(intlMessages.yesOptionLabel),
intl.formatMessage(intlMessages.noOptionLabel),
intl.formatMessage(intlMessages.abstentionOptionLabel),
];
default:
return null;
}
};
const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, intl, pollTypes) => {
const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, pollTypes) => {
const pollItemElements = parsedSlides.map((poll) => {
let { poll: label, type } = poll;
let itemLabel = label;
......@@ -78,8 +55,6 @@ const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, intl, pollType
{
const { options } = itemLabel;
itemLabel = options.join('/').replace(/[\n.)]/g, '');
} else {
answers = getLocalizedAnswers(type, intl, pollTypes);
}
// removes any whitespace from the label
......@@ -150,14 +125,6 @@ class QuickPollDropdown extends Component {
singlePollType = type;
}
if (singlePollType === pollTypes.TrueFalse ||
singlePollType === pollTypes.YesNo ||
singlePollType === pollTypes.YesNoAbstention)
{
answers = getLocalizedAnswers(singlePollType, intl, pollTypes);
singlePollType = pollTypes.Custom;
}
let btn = (
<Button
aria-label={intl.formatMessage(intlMessages.quickPollLabel)}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment