From d5aae28b8e1f456ee1e965a8243075502a19b1a5 Mon Sep 17 00:00:00 2001
From: xaralis <filip.varecha@fragaria.cz>
Date: Mon, 4 Jan 2021 09:10:59 +0100
Subject: [PATCH] feat: render speakers alongside proposer in program

---
 src/actions/program.js     |  1 +
 src/pages/Program.jsx      | 19 ++++++++++++++-----
 src/ws/handlers/program.js |  3 +++
 typings/cf2021.d.ts        |  1 +
 4 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/src/actions/program.js b/src/actions/program.js
index 72b5d7c..82c0c4c 100644
--- a/src/actions/program.js
+++ b/src/actions/program.js
@@ -37,6 +37,7 @@ export const loadProgram = createAsyncAction(
                   "title",
                   "description",
                   "proposer",
+                  "speakers",
                 ]),
                 discussionOpened: entry.discussion_opened,
                 expectedStartAt: parse(
diff --git a/src/pages/Program.jsx b/src/pages/Program.jsx
index 40b8f4d..e02ba5c 100644
--- a/src/pages/Program.jsx
+++ b/src/pages/Program.jsx
@@ -68,10 +68,10 @@ const Schedule = () => {
                   )}
                 </div>
                 <div className="w-full md:w-32 flex flex-row md:flex-col items-center md:items-stretch md:text-right md:pr-8">
-                  <p className="head-heavy-xs md:head-heavy-base">
+                  <p className="head-allcaps-2xs md:head-heavy-base">
                     {format(entry.expectedStartAt, "H:mm")}
                   </p>
-                  <p className="ml-auto md:ml-0 head-heavy-xs md:head-heavy-xs md:text-grey-200 whitespace-no-wrap">
+                  <p className="ml-auto md:ml-0 head-allcaps-2xs md:head-heavy-xs md:text-grey-200 whitespace-no-wrap">
                     {format(entry.expectedStartAt, "d. M. Y")}
                   </p>
                 </div>
@@ -80,9 +80,17 @@ const Schedule = () => {
                     {isCurrent && <Link to="/">{fullTitle}</Link>}
                     {!isCurrent && fullTitle}
                   </h2>
-                  <div className="flex space-x-2">
-                    <strong>Navrhovatel:</strong>
-                    <span>{entry.proposer}</span>
+                  <div className="leading-normal sm:flex sm:space-x-4">
+                    <div className="space-x-2">
+                      <strong>Navrhovatel:</strong>
+                      <span>{entry.proposer}</span>
+                    </div>
+                    {entry.speakers && (
+                      <div className="space-x-2">
+                        <strong>Řečníci:</strong>
+                        <span>{entry.speakers}</span>
+                      </div>
+                    )}
                   </div>
                   {htmlContent && (
                     <div
@@ -98,6 +106,7 @@ const Schedule = () => {
                           onClick={() => setEntryToActivate(entry)}
                           color="grey-125"
                           className="text-xs"
+                          fullwidth
                         >
                           Aktivovat tento bod programu
                         </Button>
diff --git a/src/ws/handlers/program.js b/src/ws/handlers/program.js
index c677db1..4aef8aa 100644
--- a/src/ws/handlers/program.js
+++ b/src/ws/handlers/program.js
@@ -11,6 +11,9 @@ export const handleProgramEntryChanged = (payload) => {
       if (has(payload, "title")) {
         state.items[payload.id].title = payload.title;
       }
+      if (has(payload, "description")) {
+        state.items[payload.id].description = payload.description;
+      }
     }
   });
 };
diff --git a/typings/cf2021.d.ts b/typings/cf2021.d.ts
index 8d14ea8..09b5b89 100644
--- a/typings/cf2021.d.ts
+++ b/typings/cf2021.d.ts
@@ -15,6 +15,7 @@ declare namespace CF2021 {
     number: string;
     title: string;
     proposer: string;
+    speakers: string;
     discussionOpened: boolean;
     description?: string;
     expectedStartAt: Date;
-- 
GitLab