From ee99673cecee478c877b7795fdef66508ec66fd9 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 23 Sep 2019 18:41:22 +0200 Subject: [PATCH] Add Comment story, add spacing above user info --- webapp/components/Comment/Comment.story.js | 54 +++++++++++++++++++ webapp/components/{ => Comment}/Comment.vue | 11 ++-- webapp/components/CommentForm/CommentForm.vue | 1 + webapp/components/CommentList/CommentList.vue | 2 +- webapp/storybook/helpers.js | 4 +- 5 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 webapp/components/Comment/Comment.story.js rename webapp/components/{ => Comment}/Comment.vue (95%) diff --git a/webapp/components/Comment/Comment.story.js b/webapp/components/Comment/Comment.story.js new file mode 100644 index 000000000..291b6cb11 --- /dev/null +++ b/webapp/components/Comment/Comment.story.js @@ -0,0 +1,54 @@ +import { storiesOf } from '@storybook/vue' +import { withA11y } from '@storybook/addon-a11y' +import Comment from './Comment' +import helpers from '~/storybook/helpers' + +helpers.init() + +const comment = { + id: '5d42a2277f2725002a449cb3', + content: + '

Thank you all!

@wolfgang-huss @robert-schafer @greg @human-connection

watch my video

I think we can all learn a lot from Alex\'s video :)

It\'s really great stuff!!

Please give him a big smiley face emoticon :D

', + contentExcerpt: + '

Thank you all!

@wolfgang-huss @robert-schafer @greg @human-connection

watch my video

I think we can all learn a lot from Alex\'s video :)

It\'s really great stuff!!

Please give him a …

', + createdAt: '2019-08-01T08:26:15.839Z', + updatedAt: '2019-08-01T08:26:15.839Z', + deleted: false, + disabled: false, + author: { + id: '1', + avatar: + 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg', + slug: 'jenny-rostock', + name: 'Rainer Unsinn', + disabled: false, + deleted: false, + contributionsCount: 25, + shoutedCount: 5, + commentedCount: 39, + followedByCount: 2, + followedByCurrentUser: true, + location: null, + badges: [ + { + id: 'indiegogo_en_bear', + icon: '/img/badges/indiegogo_en_bear.svg', + __typename: 'Badge', + }, + ], + __typename: 'User', + }, + __typename: 'Comment', +} + +storiesOf('Comment', module) + .addDecorator(withA11y) + .addDecorator(helpers.layout) + .add('Basic comment', () => ({ + components: { Comment }, + store: helpers.store, + data: () => ({ + comment, + }), + template: ``, + })) diff --git a/webapp/components/Comment.vue b/webapp/components/Comment/Comment.vue similarity index 95% rename from webapp/components/Comment.vue rename to webapp/components/Comment/Comment.vue index 2cebde0b6..a1bd7dd34 100644 --- a/webapp/components/Comment.vue +++ b/webapp/components/Comment/Comment.vue @@ -11,7 +11,7 @@
- + @@ -21,7 +21,7 @@ resource-type="comment" :resource="comment" :modalsData="menuModalsData" - style="float-right" + class="float-right" :is-owner="isAuthor(author.id)" @showEditCommentMenu="editCommentMenu" /> @@ -34,6 +34,7 @@ :comment="comment" @showEditCommentMenu="editCommentMenu" @updateComment="updateComment" + @collapse="isCollapsed = true" />
@@ -61,7 +62,7 @@ />
- + {{ $t('comment.show.less') }} @@ -168,6 +169,10 @@ export default { }