diff --git a/bigbluebutton-html5/imports/ui/components/poll/live-result/component.jsx b/bigbluebutton-html5/imports/ui/components/poll/live-result/component.jsx
index 448dc4e4e3..44521be3d9 100644
--- a/bigbluebutton-html5/imports/ui/components/poll/live-result/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/poll/live-result/component.jsx
@@ -2,11 +2,11 @@ import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';
import { defineMessages, injectIntl } from 'react-intl';
-import Button from '/imports/ui/components/button/component';
import caseInsensitiveReducer from '/imports/utils/caseInsensitiveReducer';
import { Session } from 'meteor/session';
-import { styles } from './styles';
+import Styled from './styles';
import Service from './service';
+import Settings from '/imports/ui/services/settings';
const intlMessages = defineMessages({
usersTitle: {
@@ -99,14 +99,14 @@ class LiveResult extends PureComponent {
...acc,
(
- {user.name} |
-
+ {user.name}
+
{
defaultPoll && pollAnswerIds[formattedMessageIndex]
? intl.formatMessage(pollAnswerIds[formattedMessageIndex])
: user.answer
}
- |
+
),
]);
@@ -124,22 +124,22 @@ class LiveResult extends PureComponent {
};
return pollStats.push(
-
-
+
+
{
defaultPoll && pollAnswerIds[formattedMessageIndex]
? intl.formatMessage(pollAnswerIds[formattedMessageIndex])
: obj.key
}
-
-
-
-
{obj.numVotes || 0}
-
-
+
+
+
+ {obj.numVotes || 0}
+
+
{pctFotmatted}
-
-
,
+
+ ,
);
});
@@ -170,6 +170,7 @@ class LiveResult extends PureComponent {
} = this.props;
const { userAnswers, pollStats, currentPollQuestion } = this.state;
+ const { animations } = Settings.application;
let waiting;
let userCount = 0;
@@ -189,9 +190,9 @@ class LiveResult extends PureComponent {
return (
-
- {currentPollQuestion ?
{currentPollQuestion} : null}
-
+
+ {currentPollQuestion ? {currentPollQuestion} : null}
+
{waiting
? (
@@ -203,14 +204,14 @@ class LiveResult extends PureComponent {
)
: {intl.formatMessage(intlMessages.doneLabel)}}
{waiting
- ? : null}
-
+ ?
: null}
+
{pollStats}
-
+
{currentPoll && currentPoll.answers.length > 0
? (
-
-
+
) : (
-
{
handleBackClick();
@@ -243,18 +242,17 @@ class LiveResult extends PureComponent {
label={intl.formatMessage(intlMessages.backLabel)}
color="primary"
data-test="restartPoll"
- className={styles.btn}
/>
)
}
-
+
{ currentPoll && !currentPoll.secretPoll
? (
- {intl.formatMessage(intlMessages.usersTitle)} |
- {intl.formatMessage(intlMessages.responsesTitle)} |
+ {intl.formatMessage(intlMessages.usersTitle)}
+ {intl.formatMessage(intlMessages.responsesTitle)}
{userAnswers}
diff --git a/bigbluebutton-html5/imports/ui/components/poll/live-result/styles.js b/bigbluebutton-html5/imports/ui/components/poll/live-result/styles.js
new file mode 100644
index 0000000000..fd81175925
--- /dev/null
+++ b/bigbluebutton-html5/imports/ui/components/poll/live-result/styles.js
@@ -0,0 +1,228 @@
+import styled, { css, keyframes } from 'styled-components';
+import {
+ colorGrayLightest,
+ colorText,
+ colorGrayLighter,
+ pollStatsBorderColor,
+} from '/imports/ui/stylesheets/styled-components/palette';
+import {
+ smPaddingX,
+ smPaddingY,
+ mdPaddingX,
+ pollStatsElementWidth,
+ pollSmMargin,
+ pollResultWidth,
+ borderSizeLarge,
+} from '/imports/ui/stylesheets/styled-components/general';
+import { fontSizeBase } from '/imports/ui/stylesheets/styled-components/typography';
+import Button from '/imports/ui/components/button/component';
+
+const ResultLeft = styled.td`
+ padding: 0 .5rem 0 0;
+ border-bottom: 1px solid ${colorGrayLightest};
+
+ [dir="rtl"] & {
+ padding: 0 0 0 .5rem;
+ }
+ padding-bottom: .25rem;
+ word-break: break-all;
+`;
+
+const ResultRight = styled.td`
+ padding-bottom: .25rem;
+ word-break: break-all;
+`;
+
+const Main = styled.div`
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+`;
+
+const Left = styled.div`
+ font-weight: bold;
+ max-width: ${pollResultWidth};
+ min-width: ${pollStatsElementWidth};
+ word-wrap: break-word;
+ flex: 6;
+
+ padding: ${smPaddingY};
+ margin-top: ${pollSmMargin};
+ margin-bottom: ${pollSmMargin};
+ color: ${colorText};
+
+ position: relative;
+`;
+
+const Center = styled.div`
+ position: relative;
+ flex: 3;
+ border-left: 1px solid ${colorGrayLighter};
+ border-right : none;
+ width: 100%;
+ height: 100%;
+
+ [dir="rtl"] & {
+ border-left: none;
+ border-right: 1px solid ${colorGrayLighter};
+ }
+
+ padding: ${smPaddingY};
+ margin-top: ${pollSmMargin};
+ margin-bottom: ${pollSmMargin};
+ color: ${colorText};
+`;
+
+const Right = styled.div`
+ text-align: right;
+ max-width: ${pollStatsElementWidth};
+ min-width: ${pollStatsElementWidth};
+ flex: 1;
+
+ [dir="rtl"] & {
+ text-align: left;
+ }
+
+ padding: ${smPaddingY};
+ margin-top: ${pollSmMargin};
+ margin-bottom: ${pollSmMargin};
+ color: ${colorText};
+
+ position: relative;
+`;
+
+const BarShade = styled.div`
+ background-color: ${colorGrayLighter};
+ height: 100%;
+ min-height: 100%;
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ right: 0;
+`;
+
+const BarVal = styled.div`
+ position: inherit;
+`;
+
+const Stats = styled.div`
+ margin-bottom: ${smPaddingX};
+ display: flex;
+ flex-direction: column;
+ border: 1px solid ${pollStatsBorderColor};
+ border-radius: ${borderSizeLarge};
+ padding: ${mdPaddingX};
+
+ & > div {
+ display: flex;
+ flex-direction: row;
+
+ & > div:nth-child(even) {
+ position: relative;
+ height: 75%;
+ width: 50%;
+ text-align: center;
+ }
+ }
+`;
+
+const Title = styled.span`
+ font-weight: bold;
+ word-break: break-all;
+ white-space: pre-wrap;
+`;
+
+const Status = styled.div`
+ margin-bottom: .5rem;
+`;
+
+const ellipsis = keyframes`
+ to {
+ width: 1.25em;
+ margin-right: 0;
+ margin-left: 0;
+ }
+`
+
+const ConnectingAnimation = styled.span`
+ &:after {
+ overflow: hidden;
+ display: inline-block;
+ vertical-align: bottom;
+ content: "\\2026"; /* ascii code for the ellipsis character */
+ width: 0;
+ margin: 0 1.25em 0 0;
+
+ [dir="rtl"] & {
+ margin: 0 0 0 1.25em;
+ }
+
+ ${({ animations }) => animations && css`
+ animation: ${ellipsis} steps(4, end) 900ms infinite;
+ `}
+ }
+`;
+
+const ButtonsActions = styled.div`
+ display: flex;
+ width: 100%;
+ justify-content: space-between;
+`;
+
+const PublishButton = styled(Button)`
+ width: 48%;
+ overflow-wrap: break-word;
+ white-space: pre-wrap;
+`;
+
+const CancelButton = styled(PublishButton)``;
+
+const LiveResultButton = styled(Button)`
+ width: 100%;
+ margin-top: ${smPaddingY};
+ margin-bottom: ${smPaddingY};
+ font-size: ${fontSizeBase};
+ overflow-wrap: break-word;
+ white-space: pre-wrap;
+`;
+
+const Separator = styled.div`
+ display: flex;
+ flex: 1 1 100%;
+ height: 1px;
+ min-height: 1px;
+ background-color: ${colorGrayLightest};
+ padding: 0;
+ margin-top: 1rem;
+ margin-bottom: 1rem;
+`;
+
+const THeading = styled.th`
+ text-align: left;
+
+ [dir="rtl"] & {
+ text-align: right;
+ }
+`;
+
+export default {
+ ResultLeft,
+ ResultRight,
+ Main,
+ Left,
+ Center,
+ Right,
+ BarShade,
+ BarVal,
+ Stats,
+ Title,
+ Status,
+ ConnectingAnimation,
+ ButtonsActions,
+ PublishButton,
+ CancelButton,
+ LiveResultButton,
+ Separator,
+ THeading,
+};
diff --git a/bigbluebutton-html5/imports/ui/components/poll/live-result/styles.scss b/bigbluebutton-html5/imports/ui/components/poll/live-result/styles.scss
deleted file mode 100644
index 6aa49fa212..0000000000
--- a/bigbluebutton-html5/imports/ui/components/poll/live-result/styles.scss
+++ /dev/null
@@ -1,197 +0,0 @@
-:root {
- --poll-stats-border-color: #d4d9df;
- --poll-stats-option-width: 4em;
- --poll-stats-element-width: 17%;
-
- --poll-sm-margin: 0.3125rem;
- --poll-md-margin: 0.7rem;
- --poll-user-line-height: 1.75rem;
- --poll-result-width: 15rem;
-}
-
-.btn {
- width: 100%;
- margin-top: var(--sm-padding-y);
- margin-bottom: var(--sm-padding-y);
- font-size: var(--font-size-base);
- overflow-wrap: break-word;
- white-space: pre-wrap;
-}
-
-.publishBtn,
-.cancelBtn {
- width: 48%;
- overflow-wrap: break-word;
- white-space: pre-wrap;
-}
-
-.buttonsActions {
- display: flex;
- width: 100%;
- justify-content: space-between;
-}
-
-.main {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-
-.center {
- position: relative;
- flex: 3;
- border-left: 1px solid var(--color-gray-lighter);
- border-right : none;
- width: 100%;
- height: 100%;
-
- [dir="rtl"] & {
- border-left: none;
- border-right: 1px solid var(--color-gray-lighter);
- }
-}
-
-.left {
- font-weight: bold;
- max-width: var(--poll-result-width);
- min-width: var(--poll-stats-element-width);
- word-wrap: break-word;
- flex: 6;
-}
-
-.right {
- text-align: right;
- max-width: var(--poll-stats-element-width);
- min-width: var(--poll-stats-element-width);
- flex: 1;
-
- [dir="rtl"] & {
- text-align: left;
- }
-}
-
-.left,
-.right,
-.center {
- padding: var(--sm-padding-y);
- margin-top: var(--poll-sm-margin);
- margin-bottom: var(--poll-sm-margin);
- color: var(--color-text);
-}
-
-.left,
-.right {
- position: relative;
-}
-
-.container,
-.stats {
- margin-bottom: var(--sm-padding-x);
-}
-
-.stats {
- display: flex;
- flex-direction: column;
- border: 1px solid var(--poll-stats-border-color);
- border-radius: var(--border-size-large);
- padding: var(--md-padding-x);
-
- > div {
- display: flex;
- flex-direction: row;
-
- > div:nth-child(even) {
- position: relative;
- height: 75%;
- width: 50%;
- text-align: center;
- }
-
- }
-}
-
-.barShade {
- background-color: var(--color-gray-lighter);
- height: 100%;
- min-height: 100%;
- position: absolute;
- left: 0;
- top: 0;
- bottom: 0;
- right: 0;
-}
-
-.barVal {
- position: inherit;
-}
-
-.theading {
- text-align: left;
-
- [dir="rtl"] & {
- text-align: right;
- }
-}
-
-.resultLeft {
- padding: 0 .5rem 0 0;
- border-bottom: 1px solid var(--color-gray-lightest);
-
- [dir="rtl"] & {
- padding: 0 0 0 .5rem;
- }
-}
-
-.resultRight,
-.resultLeft {
- padding-bottom: .25rem;
- word-break: break-all;
-}
-
-.status {
- margin-bottom: .5rem;
-}
-
-.connectingAnimation {
- &:after {
- overflow: hidden;
- display: inline-block;
- vertical-align: bottom;
- content: "\2026"; /* ascii code for the ellipsis character */
- width: 0;
- margin: 0 1.25em 0 0;
-
- [dir="rtl"] & {
- margin: 0 0 0 1.25em;
- }
-
- :global(.animationsEnabled) & {
- animation: ellipsis steps(4,end) 900ms infinite;
- }
- }
-}
-
-.separator {
- display: flex;
- flex: 1 1 100%;
- height: 1px;
- min-height: 1px;
- background-color: var(--color-gray-lightest);
- padding: 0;
- margin-top: 1rem;
- margin-bottom: 1rem;
-}
-
-.title {
- font-weight: bold;
- word-break: break-all;
- white-space: pre-wrap;
-}
-
-@keyframes ellipsis {
- to {
- width: 1.25em;
- margin-right: 0;
- margin-left: 0;
- }
-}
diff --git a/bigbluebutton-html5/imports/ui/stylesheets/styled-components/general.js b/bigbluebutton-html5/imports/ui/stylesheets/styled-components/general.js
index c00eae4a63..9fb19a0ce5 100644
--- a/bigbluebutton-html5/imports/ui/stylesheets/styled-components/general.js
+++ b/bigbluebutton-html5/imports/ui/stylesheets/styled-components/general.js
@@ -42,6 +42,10 @@ const toolbarButtonBorderRadius = '5px';
const toolbarItemTrianglePadding = '2px';
const toolbarMargin = '.8rem';
+const pollStatsElementWidth = '17%';
+const pollSmMargin = '0.3125rem';
+const pollResultWidth = '15rem';
+
export {
borderSizeSmall,
borderSize,
@@ -83,4 +87,7 @@ export {
toolbarButtonBorderRadius,
toolbarItemTrianglePadding,
toolbarMargin,
+ pollStatsElementWidth,
+ pollSmMargin,
+ pollResultWidth,
};
diff --git a/bigbluebutton-html5/imports/ui/stylesheets/styled-components/palette.js b/bigbluebutton-html5/imports/ui/stylesheets/styled-components/palette.js
index 6aeb2098b2..89d0dcc6e1 100644
--- a/bigbluebutton-html5/imports/ui/stylesheets/styled-components/palette.js
+++ b/bigbluebutton-html5/imports/ui/stylesheets/styled-components/palette.js
@@ -52,6 +52,8 @@ const toolbarButtonBg = btnDefaultBg;
const toolbarListBg = '#DDD';
const toolbarListBgFocus = '#C6C6C6';
+const pollStatsBorderColor = '#d4d9df';
+
export {
colorWhite,
colorOffWhite,
@@ -94,4 +96,5 @@ export {
toolbarButtonBg,
toolbarListBg,
toolbarListBgFocus,
+ pollStatsBorderColor,
};