From 0554cac113555b948cdad3d9f14ec6f548c93c01 Mon Sep 17 00:00:00 2001
From: Vivian Lim <vivlim@pm.me>
Date: Wed, 27 Jun 2018 22:43:22 -0700
Subject: Add click-to-show content warnings on posts

---
 src/components/status/status.vue | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

(limited to 'src/components/status/status.vue')

diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index f88c810d..cffa8e26 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -73,7 +73,16 @@
 
           <div :class="{'tall-status': hideTallStatus}" class="status-content-wrapper">
             <a class="tall-status-hider" :class="{ 'tall-status-hider_focused': isFocused }" v-if="hideTallStatus" href="#" @click.prevent="toggleShowTall">Show more</a>
-            <div @click.prevent="linkClicked" class="status-content media-body" v-html="status.statusnet_html"></div>
+            <div v-if="status.summary" @click.prevent="linkClicked" class="status-content media-body">
+              <div class="contentWarningLabel">
+                <span v-html="status.summary"></span>
+                <button v-if="showingContentWarningContent" @click.prevent="toggleContentWarningContent">Hide</button>
+                <button v-else @click.prevent="toggleContentWarningContent">Show</button>
+              </div>
+              <div v-if="showingContentWarningContent" v-html="status.content" class="contentWarnedContent"></div>
+              <div v-else class="hiddenContent" @click.prevent="toggleContentWarningContent">Click to view this post.</div>
+            </div>
+            <div v-else @click.prevent="linkClicked" class="status-content media-body" v-html="status.statusnet_html"></div>
             <a v-if="showingTall" href="#" class="tall-status-unhider" @click.prevent="toggleShowTall">Show less</a>
           </div>
 
@@ -488,4 +497,15 @@ a.unmute {
   }
 }
 
+.hiddenContent {
+  margin: 8px;
+  padding: 32px;
+    background: var(--lightBg, $fallback--lightBg);
+  color: #CCCCCC;
+    border-radius: var(--panelRadius, $fallback--panelRadius);
+}
+.contentWarnedContent {
+  margin: 8px;
+}
+
 </style>
-- 
cgit v1.2.3-70-g09d2

