Skip to content

Commit c55e6ed

Browse files
ldmwebjackdishman
andauthored
Items/draft (#400)
* add 'no more posts' message at the end of all posts display + fix texts frmo Tess + fix filter bug * remove right/left images to keep only left and rotate in CSS when necessary * fix default draft handling + repost popup bug * remove duplicate css classes * fix no more posts message always displayed * responsive comment face selector * consolidated no more posts check Co-authored-by: jack dishman <[email protected]>
1 parent 05f9232 commit c55e6ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+253
-232
lines changed
Binary file not shown.
-31.7 KB
Binary file not shown.
-33.8 KB
Binary file not shown.
-39.5 KB
Binary file not shown.
-41.7 KB
Binary file not shown.
-48.5 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-63.5 KB
Binary file not shown.
Binary file not shown.
-37.3 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-40.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-60.9 KB
Binary file not shown.
Binary file not shown.
-85.2 KB
Binary file not shown.
Binary file not shown.
-72.3 KB
Binary file not shown.
-70.9 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-38.4 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-55.2 KB
Binary file not shown.
-48.1 KB
Binary file not shown.
-37.1 KB
Binary file not shown.

src/components/DraftPreview.vue

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
<template>
2-
<div class="my-4 flex flex-row items-center justify-between">
2+
<div
3+
v-if="draft.title !== `` || draft.subtitle !== `` || draft.content !== ``"
4+
class="my-4 flex flex-row items-center justify-between"
5+
>
36
<!-- Title -->
47
<div class="flex flex-grow flex-col">
58
<h6
6-
v-if="numberOfDrafts > 1"
79
class="truncate text-base font-semibold"
810
:style="$route.name === `home` ? `max-width: 259px` : `max-width: 408px`"
911
>
1012
{{ draft.title === `` ? `New Post` : draft.title }}
1113
</h6>
12-
<h6
13-
v-else
14-
class="truncate text-base font-semibold"
15-
:style="$route.name === `home` ? `max-width: 259px` : `max-width: 408px`"
16-
>
17-
{{ draft.title === `` ? `Default draft` : draft.title }}
18-
</h6>
1914
<p v-if="draft.timestamp !== 0" class="text-gray5 text-sm">Last saved {{ $formatDate(draft.timestamp) }}</p>
2015
<p v-else class="text-gray5 text-sm">No save</p>
2116
</div>
@@ -50,11 +45,7 @@
5045
<span class="text-primary ml-1 self-center text-sm">Edit this draft</span>
5146
</button>
5247
<!-- Delete -->
53-
<button
54-
v-if="numberOfDrafts > 1"
55-
class="focus:outline-none text-negative mt-2 flex"
56-
@click="deleteDraft(draft)"
57-
>
48+
<button class="focus:outline-none text-negative mt-2 flex" @click="deleteDraft(draft)">
5849
<BinIcon class="p-1" />
5950
<span class="text-negative ml-1 self-center text-sm">Delete this draft</span>
6051
</button>

src/components/OnboardingWizard.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,17 @@ export default Vue.extend({
164164
getText(): string {
165165
switch (this.step) {
166166
case 0:
167-
return `As your daily entry point to Blogchain, this screen is important. Make it truly your own by picking whichever options you prefer for displaying content, editing tools, widgets, and more.`
167+
return `Make it truly your own by selecting your preferences for displaying content, editing tools, updating widgets, and customizing everything as you wish!`
168168
case 1:
169-
return `On this page, we make it easy for you to find posts by writers who suit your interests well. Browse categories, featured tags, or trending topics to get started.`
169+
return `Here you can easily browse posts that suit your interests. Scroll through various categories, featured tags, or trending topics to get started.`
170170
case 2:
171-
return `Sometimes a post or headline catches your attention, but there’s no time to read it now. That’s why Blogchain makes it easy to highlight such content for later and then share with friends if you want.`
171+
return `Sometimes a post or headline catches your attention, but you’re short of time. No worries. Blogchain makes it easy to save and share content for later.`
172172
case 3:
173-
return `Have an idea you’d like to share with the world? Blogchain’s simple editing tool will make it easy for you to craft and publish your post in a intuitive writing experience.`
173+
return `Have an idea you’d like to share with the world? Blogchain’s simple editing tool makes it easy to craft and publish your post through an intuitive writing experience.`
174174
case 4:
175-
return `Agree or disagree with something you’ve read on Blogchain? Use our comment features to talk about it with other readers. You can even include one of our custom reaction illustrations to make your point.`
175+
return `Agree or disagree with something you’ve read on Blogchain? Use our comment features to discuss with other readers. You can even include a custom reaction illustration to make your point.`
176176
case 5:
177-
return `You will be able to change your profile and add more informations later on your profile page.`
177+
return `You’ll be able to update your profile or add more information later!`
178178
default:
179179
return `out of scope`
180180
}

src/components/icons/Send.vue

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<template>
2-
<svg
3-
class="-mr-px h-5 w-5 rotate-90 transform"
4-
fill="none"
5-
stroke="currentColor"
6-
viewBox="0 0 24 24"
7-
xmlns="http://www.w3.org/2000/svg"
8-
>
2+
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
93
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"></path>
104
</svg>
115
</template>

src/components/post/Actions.vue

+56-35
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<div v-for="f in faceStats.slice(page * 6, page * 6 + 6)" :key="f.face.label" class="flex w-24 flex-col">
8686
<div class="flex flex-col rounded-lg border p-1" :class="`border-` + getStyle(f.face.label)">
8787
<span class="self-center text-xs">{{ f.face.label }}</span>
88-
<img :src="f.face.leftImage" :alt="f.face.label" class="h-16 w-16 self-center" />
88+
<img :src="f.face.image" :alt="f.face.label" class="h-16 w-16 self-center" />
8989
</div>
9090
<span class="mt-1 self-center text-sm font-semibold"
9191
>{{ ((f.count / getCommentCount(`total`)) * 100).toFixed(1) }}%</span
@@ -106,7 +106,7 @@
106106
<button class="focus:outline-none ml-2" @click="toggleStats = true"><StatsIcon /></button>
107107
</div>
108108
<CommentFilter
109-
v-show="!showEmotions && comments.length > 0"
109+
v-show="!showEmotions && (comments.length > 0 || this.filter !== ``)"
110110
:filter="filter"
111111
class="modal-animation"
112112
@clicked="setFilter"
@@ -115,20 +115,18 @@
115115
<!-- Top overlay with selector -->
116116
<div v-show="showEmotions" class="relative flex w-full flex-row-reverse">
117117
<div
118-
class="z-10 mr-1 flex flex-row justify-between rounded-tr-lg bg-white p-5"
119-
:style="$route.name === `post-post` ? `width: 490px` : `width: 406px`"
118+
class="z-10 mr-1 hidden xl:flex flex-row justify-between rounded-tr-lg bg-white p-5 xl:w-3/5"
120119
style="margin-bottom: -112px; margin-top: 1px; pointer-events: none"
121120
>
122121
<h6 class="text-primary self-center text-center text-2xl font-semibold">How do you feel?</h6>
123122
</div>
124-
<div class="absolute z-10 mt-10 mr-8 flex items-center">
123+
<div class="absolute z-20 mt-8 xl:mt-10 mr-8 flex items-center">
125124
<button class="bg-gray1 focus:outline-none rounded-full p-1" @click="showEmotions = false">
126125
<CloseIcon />
127126
</button>
128127
</div>
129128
<div
130-
class="z-10 flex flex-row justify-between rounded-tl-lg bg-white p-5"
131-
:style="$route.name === `post-post` ? `width: 350px` : `width: 306px`"
129+
class="z-10 flex flex-row justify-between rounded-tl-lg bg-white p-5 w-full xl:w-2/5 mr-1 xl:mr-0"
132130
style="
133131
margin-bottom: -112px;
134132
background: linear-gradient(#ffffff, rgba(255, 255, 255, 0));
@@ -159,7 +157,7 @@
159157
:class="showEmotions ? `` : `border p-2 bg-` + selectedEmotionColor"
160158
>
161159
<div
162-
class="flex w-full items-center justify-center overflow-hidden rounded-xl"
160+
class="flex w-full items-center justify-center overflow-hidden rounded-xl relative"
163161
:style="showEmotions ? `height: 20rem` : `height: 10rem`"
164162
>
165163
<div v-if="this.$store.state.session.id !== ``" class="flex w-full flex-row">
@@ -168,29 +166,45 @@
168166
<button class="focus:outline-none h-auto flex-shrink-0" @click="toggleShowEmotions">
169167
<span v-if="activeEmotion.label !== ``">
170168
<img
171-
:src="activeEmotion.rightImage"
169+
:src="activeEmotion.image"
172170
:alt="activeEmotion.label"
173-
class="object-contain"
174-
style="width: 126px; height: 126px"
171+
class="object-contain w-24 h-24 xl:w-32 xl:h-32"
172+
style="transform: rotateY(180deg)"
175173
/>
176174
</span>
177175
<span v-else
178176
><FlipIcon
179-
class="transition duration-500 ease-in-out opacity-50 hover:opacity-100"
180-
style="width: 140px; height: 140px"
177+
class="transition duration-500 ease-in-out opacity-50 hover:opacity-100 w-24 h-24 xl:w-32 xl:h-32"
181178
/></span>
182179
</button>
183180
<textarea
181+
v-if="comments.length > 0"
184182
v-model="comment"
185-
class="focus:outline-none mr-6 h-40 w-full resize-none overflow-y-auto py-4 pl-2 pr-16 leading-normal"
183+
class="focus:outline-none mr-6 h-40 w-full resize-none overflow-y-auto py-4 pl-2 pr-10 xl:pr-16 leading-normal"
186184
name="body"
187185
placeholder="What's your response?"
188186
/>
187+
<textarea
188+
v-else
189+
v-model="comment"
190+
class="focus:outline-none mr-6 h-40 w-full resize-none overflow-y-auto py-4 pl-2 pr-10 xl:pr-16 leading-normal"
191+
name="body"
192+
placeholder="Be the first one commenting this post..."
193+
/>
189194
<div class="relative">
190195
<span class="absolute bottom-0 right-0 flex flex-col">
196+
<button
197+
class="bg-primary focus:outline-none block rounded-lg xl:hidden"
198+
style="margin-right: 15.2px; margin-bottom: 15px"
199+
:class="comment !== '' && activeEmotion.label !== '' ? '' : 'opacity-50'"
200+
@click="sendComment"
201+
>
202+
<SendIcon class="m-2 mb-3 ml-3 h-5 w-5 text-white transform rotate-45" />
203+
</button>
191204
<BrandedButton
192205
style="margin-right: 15.2px; margin-bottom: 15px"
193206
text="Post"
207+
class="hidden xl:block"
194208
:action="sendComment"
195209
:thin="true"
196210
:class="comment !== '' && activeEmotion.label !== '' ? '' : 'opacity-50'"
@@ -202,28 +216,27 @@
202216
<div
203217
v-show="showEmotions"
204218
ref="scrollContainer"
205-
class="modal-animation w-full overflow-y-scroll bg-white px-6"
219+
class="modal-animation w-full overflow-y-scroll bg-white px-4 xl:px-6 flex justify-center"
206220
style="height: 320px; scroll-snap-type: y mandatory; scroll-snap-stop: always"
207221
>
208222
<!-- Middle selector area -->
209223
<div
210-
class="absolute rounded-lg p-2"
224+
class="absolute rounded-lg p-2 h-32 xl:h-24 mt-24 xl:mt-28"
211225
:class="
212226
selectedEmotionColor === `positive` ||
213227
selectedEmotionColor === `neutral` ||
214228
selectedEmotionColor === `negative`
215229
? `bg-opacity-25 bg-` + selectedEmotionColor
216230
: `bg-gray1`
217231
"
218-
style="height: 96px; margin-top: 112px"
219-
:style="$route.name === `post-post` ? `width: 716px` : `width: 646px`"
232+
style="width: 92%"
220233
></div>
221234
<!-- Faces grid -->
222-
<div class="relative" style="padding-bottom: 120px; padding-top: 120px">
235+
<div class="relative w-full" style="padding-bottom: 120px; padding-top: 120px">
223236
<div
224237
v-for="row in faceGroupings"
225238
:key="row[0].label + row[1].label + row[2].label"
226-
class="relative flex w-full flex-row px-2"
239+
class="relative flex w-full flex-row mb-2 xl:px-2 justify-between"
227240
style="scroll-snap-align: center"
228241
>
229242
<button
@@ -234,12 +247,20 @@
234247
style="transition: all 0.3s ease-in-out"
235248
@click="setEmotion(face)"
236249
>
237-
<img :src="face.leftImage" :alt="face.label" class="h-20 w-20" />
250+
<img :src="face.image" :alt="face.label" class="h-20 w-20" style="transform: rotateY(180deg)" />
251+
<p
252+
class="capitalize xl:hidden mt-1"
253+
:class="
254+
selectedEmotion.label === face.label ? `font-bold text-` + selectedEmotionColor : `text-gray7`
255+
"
256+
>
257+
{{ face.label }}
258+
</p>
238259
</button>
239260
<div
240261
v-for="face in row"
241262
:key="face.label + face.label"
242-
class="face-tag flex flex-grow items-center justify-center"
263+
class="face-tag hidden xl:flex flex-grow items-center justify-center"
243264
>
244265
<button
245266
class="focus:outline-none outline-none flex flex-grow items-center justify-center"
@@ -269,18 +290,17 @@
269290
<!-- Bottom overlay with selector -->
270291
<div v-show="showEmotions" class="relative flex w-full flex-row-reverse">
271292
<div
272-
class="z-10 mr-1 flex flex-row-reverse items-end rounded-br-xl bg-white p-5"
293+
class="z-10 mr-1 hidden xl:flex flex-row-reverse items-end rounded-br-xl bg-white p-5 xl:w-3/5"
273294
style="height: 111px; margin-top: -112px; margin-bottom: 1px; pointer-events: none"
274-
:style="$route.name === `post-post` ? `width: 490px` : `width: 406px; margin-right: 53px;`"
275295
></div>
276296
<button
277-
class="bg-primary focus:outline-none absolute bottom-0 right-0 z-10 mb-7 mr-7 rounded-lg px-6 py-2 text-white"
297+
class="bg-primary focus:outline-none absolute bottom-0 right-0 z-20 mb-7 mr-7 rounded-lg px-6 py-2 text-white"
278298
@click="confirmEmotion"
279299
>
280300
Select
281301
</button>
282302
<div
283-
class="z-10 flex flex-row-reverse items-end rounded-bl-lg bg-white p-5"
303+
class="z-10 flex flex-row-reverse items-end rounded-bl-lg bg-white p-5 w-full mr-1 xl:mr-0 xl:w-2/5"
284304
style="
285305
height: 111px;
286306
margin-top: -112px;
@@ -289,7 +309,6 @@
289309
margin-bottom: 1px;
290310
margin-left: 1px;
291311
"
292-
:style="$route.name === `post-post` ? `width: 350px` : `width: 306px`"
293312
></div>
294313
</div>
295314
<Comment
@@ -313,6 +332,7 @@ import BrandedButton from '@/components/BrandedButton.vue'
313332
import Comment from '@/components/post/Comment.vue'
314333
import CommentFilter from '@/components/post/CommentFilter.vue'
315334
import FlipIcon from '@/components/icons/Flip.vue'
335+
import SendIcon from '@/components/icons/Send.vue'
316336
import CloseIcon from '@/components/icons/X.vue'
317337
import StatsIcon from '@/components/icons/Stats.vue'
318338
import ChevronLeft from '@/components/icons/ChevronLeft.vue'
@@ -324,15 +344,15 @@ import { createComment, sendComment, ICommentData, getCommentsOfPost } from '@/b
324344
import { getPhotoFromIPFS } from '@/backend/photos'
325345
326346
interface FaceStat {
327-
face: { label: string; leftImage: any; rightImage: any }
347+
face: { label: string; image: any }
328348
count: number
329349
}
330350
331351
interface IData {
332352
faceGroupings: object[]
333353
feelingList: Record<string, any>
334-
activeEmotion: { label: string; leftImage: any; rightImage: any }
335-
selectedEmotion: { label: string; leftImage: any; rightImage: any }
354+
activeEmotion: { label: string; image: any }
355+
selectedEmotion: { label: string; image: any }
336356
comments: ICommentData[]
337357
avatar: string
338358
comment: string
@@ -358,6 +378,7 @@ export default Vue.extend({
358378
StatsIcon,
359379
ChevronLeft,
360380
ChevronRight,
381+
SendIcon,
361382
},
362383
props: {
363384
postCID: {
@@ -386,8 +407,8 @@ export default Vue.extend({
386407
faceGroupings,
387408
feelingList: feelings,
388409
avatar: ``,
389-
activeEmotion: { label: ``, leftImage: null, rightImage: null },
390-
selectedEmotion: { label: ``, leftImage: null, rightImage: null },
410+
activeEmotion: { label: ``, image: null },
411+
selectedEmotion: { label: ``, image: null },
391412
comment: ``,
392413
comments: [],
393414
emotion: ``,
@@ -427,7 +448,7 @@ export default Vue.extend({
427448
this.filter = reaction
428449
this.filterComments()
429450
},
430-
setEmotion(r: { label: string; leftImage: any; rightImage: any }) {
451+
setEmotion(r: { label: string; image: any }) {
431452
this.selectedEmotion = r
432453
if (feelings.positive.has(r.label)) {
433454
this.selectedEmotionColor = `positive`
@@ -465,8 +486,8 @@ export default Vue.extend({
465486
// Apply filter to comments, in case new comment was added in filtered category
466487
this.comment = ``
467488
this.filterComments()
468-
this.selectedEmotion = { label: ``, leftImage: null, rightImage: null }
469-
this.activeEmotion = { label: ``, leftImage: null, rightImage: null }
489+
this.selectedEmotion = { label: ``, image: null }
490+
this.activeEmotion = { label: ``, image: null }
470491
this.emotion = ``
471492
this.filter = ``
472493
this.selectedEmotionColor = `neutralLightest`

src/components/post/Card.vue

+19-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,14 @@
177177
:class="quoteContent !== `` ? '' : 'opacity-50'"
178178
style="transition: all 0.4s"
179179
>
180-
<BrandedButton :action="handleSendRepost" :text="`Post`" />
180+
<button
181+
class="bg-primary focus:outline-none block rounded-lg xl:hidden"
182+
style="margin-right: 15.2px; margin-bottom: 15px"
183+
@click="handleSendRepost"
184+
>
185+
<SendIcon class="m-2 mb-3 ml-3 h-5 w-5 text-white transform rotate-45" />
186+
</button>
187+
<BrandedButton :action="handleSendRepost" :text="`Quote`" class="hidden xl:block" />
181188
</div>
182189
</div>
183190
<PostActions
@@ -439,6 +446,15 @@
439446
<CommentIcon :isActive="showComments" />
440447
<span v-if="comments" class="ml-1">{{ comments.length }}</span>
441448
</button>
449+
<Repost
450+
:repost="repost"
451+
:post="post"
452+
:cid="postCID"
453+
class="fill-primary mr-4"
454+
:hasRepost="hasReposted"
455+
:repostCount="repostCount"
456+
@toggleRepost="toggleQuoteRepost"
457+
/>
442458
<Share
443459
:repost="repost"
444460
:post="post"
@@ -472,6 +488,7 @@ import Repost from '@/components/post/Repost.vue'
472488
import TagPill from '@/components/Tag.vue'
473489
import More from '@/components/icons/More.vue'
474490
import XIcon from '@/components/icons/X.vue'
491+
import SendIcon from '@/components/icons/Send.vue'
475492
import FriendButton from '@/components/FriendButton.vue'
476493
import RepostIcon from '@/components/icons/Repost.vue'
477494
import StatsIcon from '@/components/icons/Stats.vue'
@@ -535,6 +552,7 @@ export default Vue.extend({
535552
FriendButton,
536553
RepostIcon,
537554
BrandedButton,
555+
SendIcon,
538556
},
539557
props: {
540558
repost: {

0 commit comments

Comments
 (0)