-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(KtComment): implement CommentActions and CommentActionsReply
Common helper components for KtComment.vue and CommentReply.vue ..that wrap and unify the reply button / more actions button Product-approved Design and Request
- Loading branch information
Showing
5 changed files
with
115 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
packages/kotti-ui/source/kotti-comment/components/CommentActions.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<div class="kt-comment__content__actions"> | ||
<CommentActionsReply @click="handleReplyClick" /> | ||
<CommentActionsOptions :options="options" /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from '@vue/composition-api' | ||
import { Kotti } from '../../types' | ||
import CommentActionsOptions from './CommentActionsOptions.vue' | ||
import CommentActionsReply from './CommentActionsReply.vue' | ||
export default defineComponent<{ | ||
options: Kotti.Popover.Props['options'] | ||
userData: Kotti.Comment.UserData | ||
}>({ | ||
name: 'CommentActions', | ||
props: { | ||
options: { type: Array, required: true }, | ||
userData: { type: Object, required: true }, | ||
}, | ||
components: { | ||
CommentActionsOptions, | ||
CommentActionsReply, | ||
}, | ||
setup(props, { emit }) { | ||
return { | ||
handleReplyClick: () => emit('replyClick', props.userData), | ||
} | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.kt-comment__content__actions { | ||
display: flex; | ||
justify-content: space-between; | ||
margin: 0.2rem 0; | ||
font-size: 0.7rem; | ||
font-weight: 600; | ||
line-height: 1.2rem; | ||
color: var(--link-02); | ||
> * { | ||
&:hover { | ||
cursor: pointer; | ||
color: var(--link-03); | ||
} | ||
} | ||
.yoco { | ||
font-size: 0.9rem; | ||
} | ||
} | ||
</style> |
37 changes: 37 additions & 0 deletions
37
packages/kotti-ui/source/kotti-comment/components/CommentActionsReply.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<div class="kt-comment__actions__reply" @click="$emit('click')"> | ||
<i class="yoco" v-text="'comment'" /> | ||
<span v-text="replyButtonText" /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { computed, defineComponent } from '@vue/composition-api' | ||
import { useTranslationNamespace } from '../../kotti-i18n/hooks' | ||
export default defineComponent({ | ||
name: 'CommentAcionsReply', | ||
props: {}, | ||
setup() { | ||
const translations = useTranslationNamespace('KtComment') | ||
return { | ||
replyButtonText: computed(() => translations.value.replyButton), | ||
} | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.kt-comment__actions__reply { | ||
display: flex; | ||
align-items: center; | ||
flex: 0 0 auto; | ||
padding: 0 var(--unit-01); | ||
> *:not(:last-child) { | ||
margin-right: var(--unit-01); | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters