aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/interaction_button.php
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interaction_button.php')
-rw-r--r--templates/interaction_button.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/templates/interaction_button.php b/templates/interaction_button.php
index 9115435..edd1a25 100644
--- a/templates/interaction_button.php
+++ b/templates/interaction_button.php
@@ -10,6 +10,13 @@ $icon = match ($action) {
'dislike' => 'heart_broken',
'reshare' => $active ? 'repeat_on' : 'repeat'
};
+$id = "interactButton-$action-$note->id";
?>
-<button title="<?= $tooltip ?>" class="icon material-symbols-outlined <?= $action . ($active ? ' active' : '') ?>"
- hx-post="<?= "/fragment/note/$note->id/$action" ?>" hx-swap="outerHTML" hx-disabled-elt="this"><?= $icon ?></button> \ No newline at end of file
+<div class="interactButtonContainer <?= $action . ($active ? ' active' : '') ?>">
+ <button title="<?= $tooltip ?>" class="icon material-symbols-outlined <?= $active ? 'active' : '' ?>"
+ hx-post="<?= "/fragment/note/$note->id/$action" ?>" hx-swap="outerHTML"
+ hx-target="closest .interactButtonContainer" hx-disabled-elt="this" id="<?= $id ?>">
+ <?= $icon ?>
+ </button>
+ <label for="<?= $id ?>" class="interactionCount"><?= $count ?? '' ?></label>
+</div> \ No newline at end of file