Skip to content

Commit

Permalink
Set different icon when editing microblog comment
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Oct 21, 2024
1 parent d8031ea commit 55fcc40
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/Domain/Icon/FontAwesomeFree.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public function icons(): array
'microblogCommentDelete' => 'fas fa-trash-can',
'microblogCommentRestore' => 'fas fa-trash-arrow-up',
'microblogCommentBlockAuthor' => 'fas fa-user-slash',
'microblogCommentNewSave' => 'far fa-share-from-square',
'microblogCommentSaveNew' => 'far fa-share-from-square',
'microblogCommentSaveExisting' => 'far fa-share-from-square',
'microblogCommentMenuEditRemove' => 'fa fa-bars',
'microblogCommentMenuAnswerFlag' => $genericDropdown,

Expand Down
3 changes: 2 additions & 1 deletion app/Domain/Icon/FontAwesomePro.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public function icons(): array
'microblogCommentDelete' => 'fa-light fa-trash-can',
'microblogCommentRestore' => 'fa-light fa-trash-can-undo',
'microblogCommentBlockAuthor' => 'fa-light fa-lock',
'microblogCommentNewSave' => 'fa-light fa-share-from-square',
'microblogCommentSaveNew' => 'fa-light fa-share-from-square',
'microblogCommentSaveExisting' => 'fa-light fa-floppy-disk',
'microblogCommentMenuEditRemove' => 'fa-light fa-bars', // deprecated
'microblogCommentMenuAnswerFlag' => $genericDropdown,

Expand Down
8 changes: 6 additions & 2 deletions resources/js/components/microblog/comment-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<form>
<vue-comment-autocomplete
source="/completion/prompt/users"
placeholder="Napisz komentarz... (Ctrl+Enter aby wysłać)"
:placeholder="editing
? 'Edytujesz komentarz (Ctrl+Enter aby zapisać)'
: 'Napisz komentarz... (Ctrl+Enter aby wysłać)'"
v-model="microblog.text"

allow-paste
Expand All @@ -13,7 +15,8 @@
ref="commentPrompt"
>
<button type="button" @click="saveComment" class="btn btn-sm btn-comment-submit" title="Zapisz (Ctrl+Enter)">
<vue-icon name="microblogCommentNewSave"/>
<vue-icon v-if="editing" name="microblogCommentSaveExisting"/>
<vue-icon v-else name="microblogCommentSaveNew"/>
</button>
</vue-comment-autocomplete>
</form>
Expand All @@ -34,6 +37,7 @@ export default {
VueIcon,
'vue-comment-autocomplete': VueCommentAutocomplete,
},
props: {editing: {type: Boolean}},
mixins: [MicroblogFormMixin],
methods: {
focus() {
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/microblog/comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
:microblog="comment"
ref="form"
class="w-100 me-1"
editing
@cancel="edit(comment)"
@save="edit(comment)"
/>
Expand Down

0 comments on commit 55fcc40

Please sign in to comment.