From ba97a7368bc1362932116aa85d53896029226d26 Mon Sep 17 00:00:00 2001 From: KDSBrowne Date: Tue, 17 Jan 2023 15:04:29 +0000 Subject: [PATCH] change semantic structure from divs to table - user details --- .../src/components/UserDetails/component.jsx | 123 +++++++++--------- 1 file changed, 63 insertions(+), 60 deletions(-) diff --git a/bbb-learning-dashboard/src/components/UserDetails/component.jsx b/bbb-learning-dashboard/src/components/UserDetails/component.jsx index 688f51c844..cffe50a5d0 100644 --- a/bbb-learning-dashboard/src/components/UserDetails/component.jsx +++ b/bbb-learning-dashboard/src/components/UserDetails/component.jsx @@ -205,10 +205,10 @@ const UserDatailsComponent = (props) => { ); return ( -
-
{question}
+ + {question} { isAnonymous ? ( -
{ /> -
+ ) : ( -
{answers.map((answer) =>

{answer}

)}
+ {answers.map((answer) =>

{answer}

)} ) } -
{ id: 'app.learningDashboard.usersTable.notAvailable', defaultMessage: 'N/A', }) } -
-
+ + ); } @@ -257,14 +257,14 @@ const UserDatailsComponent = (props) => { category, average, activityPoints, totalOfActivity, ) { return ( -
-
+ + -
-
+ +
{ (function getAverage() { if (average >= 0 && category === 'Talk Time') return tsToHHmmss(average); @@ -284,13 +284,13 @@ const UserDatailsComponent = (props) => { : null }
-
-
+ + { activityPoints >= 0 ? : } -
- + + ); } @@ -420,7 +420,7 @@ const UserDatailsComponent = (props) => { { !user.isModerator && ( <> -
+
@@ -436,40 +436,42 @@ const UserDatailsComponent = (props) => {

-
-
-
-
-
- { ['Talk Time', 'Messages', 'Emojis', 'Raise Hands', 'Poll Votes'].map((category) => { - let totalOfActivity = 0; + + + + + + + { ['Talk Time', 'Messages', 'Emojis', 'Raise Hands', 'Poll Votes'].map((category) => { + let totalOfActivity = 0; - switch (category) { - case 'Talk Time': - totalOfActivity = user.talk.totalTime; - break; - case 'Messages': - totalOfActivity = user.totalOfMessages; - break; - case 'Emojis': - totalOfActivity = user.emojis.filter((emoji) => emoji.name !== 'raiseHand').length; - break; - case 'Raise Hands': - totalOfActivity = user.emojis.filter((emoji) => emoji.name === 'raiseHand').length; - break; - case 'Poll Votes': - totalOfActivity = Object.values(user.answers).length; - break; - default: - } + switch (category) { + case 'Talk Time': + totalOfActivity = user.talk.totalTime; + break; + case 'Messages': + totalOfActivity = user.totalOfMessages; + break; + case 'Emojis': + totalOfActivity = user.emojis.filter((emoji) => emoji.name !== 'raiseHand').length; + break; + case 'Raise Hands': + totalOfActivity = user.emojis.filter((emoji) => emoji.name === 'raiseHand').length; + break; + case 'Poll Votes': + totalOfActivity = Object.values(user.answers).length; + break; + default: + } - return renderActivityScoreItem( - category, - averages[category], - activityPointsFunctions[category](user), - totalOfActivity, - ); - }) } + return renderActivityScoreItem( + category, + averages[category], + activityPointsFunctions[category](user), + totalOfActivity, + ); + }) } +
@@ -480,16 +482,18 @@ const UserDatailsComponent = (props) => {

-
-
-
-
-
- { Object.values(polls || {}) - .map((poll) => renderPollItem( - poll, - getUserAnswer(poll), - )) } + + + + + + + { Object.values(polls || {}) + .map((poll) => renderPollItem( + poll, + getUserAnswer(poll), + )) } +
) } @@ -500,7 +504,6 @@ const UserDatailsComponent = (props) => { const UserDetailsContainer = (props) => { const { isOpen, dispatch, user } = useContext(UserDetailsContext); - return ReactDOM.createPortal(