diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/post_status_modal/post_status_modal.js | 25 | ||||
| -rw-r--r-- | src/components/post_status_modal/post_status_modal.vue | 42 | ||||
| -rw-r--r-- | src/components/user_card/user_card.js | 2 |
3 files changed, 68 insertions, 1 deletions
diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js new file mode 100644 index 00000000..86a4e1d8 --- /dev/null +++ b/src/components/post_status_modal/post_status_modal.js @@ -0,0 +1,25 @@ +import PostStatusForm from '../post_status_form/post_status_form.vue' + +const PostStatusModal = { + components: { + PostStatusForm + }, + computed: { + isLoggedIn () { + return !!this.$store.state.users.currentUser + }, + isOpen () { + return this.isLoggedIn && this.$store.state.postStatus.modalActivated + }, + params () { + return this.$store.state.postStatus.params + } + }, + methods: { + closeModal () { + this.$store.dispatch('closePostStatusModal') + } + } +} + +export default PostStatusModal diff --git a/src/components/post_status_modal/post_status_modal.vue b/src/components/post_status_modal/post_status_modal.vue new file mode 100644 index 00000000..85a5401c --- /dev/null +++ b/src/components/post_status_modal/post_status_modal.vue @@ -0,0 +1,42 @@ +<template> + <div + v-if="isOpen" + class="post-form-modal-view modal-view" + @click="closeModal" + > + <div + class="post-form-modal-panel panel" + @click.stop="" + > + <div class="panel-heading"> + {{ $t('post_status.new_status') }} + </div> + <PostStatusForm + class="panel-body" + @posted="closeModal" + /> + </div> + </div> +</template> + +<script src="./post_status_modal.js"></script> + +<style lang="scss"> +@import '../../_variables.scss'; + +.post-form-modal-view { + align-items: flex-start; +} + +.post-form-modal-panel { + flex-shrink: 0; + margin-top: 25%; + margin-bottom: 2em; + width: 100%; + max-width: 700px; + + @media (orientation: landscape) { + margin-top: 8%; + } +} +</style> diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index d42be9fc..0c200ad1 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -170,7 +170,7 @@ export default { this.$store.dispatch('setCurrent', attachment) }, mentionUser () { - + this.$store.dispatch('openPostStatusModal', { replyTo: true, repliedUser: this.user }) } } } |
