From af955492e88019068ce93acfeba88bbf4e3cfab9 Mon Sep 17 00:00:00 2001 From: sgenoud Date: Sat, 25 May 2019 17:36:44 +0200 Subject: [PATCH] feat: Add poll results to a status (#1219) --- src/routes/_components/status/Status.html | 10 +++++ src/routes/_components/status/StatusPoll.html | 42 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/routes/_components/status/StatusPoll.html diff --git a/src/routes/_components/status/Status.html b/src/routes/_components/status/Status.html index 9fe8757..c9c4f75 100644 --- a/src/routes/_components/status/Status.html +++ b/src/routes/_components/status/Status.html @@ -31,6 +31,9 @@ {#if showMedia } {/if} + {#if showPoll} + + {/if} {#if isStatusInOwnThread} {/if} @@ -58,6 +61,7 @@ "sidebar content content content" "sidebar card card card" "sidebar media-grp media-grp media-grp" + "sidebar poll poll poll" "media media media media" "....... toolbar toolbar toolbar" "compose compose compose compose"; @@ -92,6 +96,7 @@ "card card" "media-grp media-grp" "media media" + "poll poll" "details details" "toolbar toolbar" "compose compose"; @@ -119,6 +124,7 @@ import StatusSpoiler from './StatusSpoiler.html' import StatusComposeBox from './StatusComposeBox.html' import StatusMentions from './StatusMentions.html' + import StatusPoll from './StatusPoll.html' import Shortcut from '../shortcut/Shortcut.html' import { store } from '../../_store/store' import { goto } from '../../../../__sapper__/client' @@ -170,6 +176,7 @@ StatusMediaAttachments, StatusContent, StatusCard, + StatusPoll, StatusSpoiler, StatusComposeBox, StatusMentions, @@ -261,6 +268,9 @@ originalStatus.card && originalStatus.card.title ), + showPoll: ({ originalStatus, isStatusInNotification }) => ( + !isStatusInNotification && originalStatus.poll + ), showMedia: ({ originalStatus, isStatusInNotification }) => ( !isStatusInNotification && originalStatus.media_attachments && diff --git a/src/routes/_components/status/StatusPoll.html b/src/routes/_components/status/StatusPoll.html new file mode 100644 index 0000000..7c8f989 --- /dev/null +++ b/src/routes/_components/status/StatusPoll.html @@ -0,0 +1,42 @@ +
+ {#each options as option} +
+
{option.title} ({option.share}%)
+ + + +
+ {/each} + +
+ +