From 4ed9cf5a320a5469d84253f5f84d43c6402f4ae5 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Fri, 1 Mar 2024 20:49:33 +0100 Subject: [PATCH] Add Bluesky to inbox entry sharing dialog --- .../retrospring/controllers/inbox_sharing_controller.ts | 5 ++++- app/views/inbox/_entry.html.haml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/javascript/retrospring/controllers/inbox_sharing_controller.ts b/app/javascript/retrospring/controllers/inbox_sharing_controller.ts index fe52c0f1..24783da3 100644 --- a/app/javascript/retrospring/controllers/inbox_sharing_controller.ts +++ b/app/javascript/retrospring/controllers/inbox_sharing_controller.ts @@ -1,9 +1,10 @@ import { Controller } from '@hotwired/stimulus'; export default class extends Controller { - static targets = ['twitter', 'tumblr', 'telegram', 'other', 'custom', 'clipboard']; + static targets = ['twitter', 'bluesky', 'tumblr', 'telegram', 'other', 'custom', 'clipboard']; declare readonly twitterTarget: HTMLAnchorElement; + declare readonly blueskyTarget: HTMLAnchorElement; declare readonly tumblrTarget: HTMLAnchorElement; declare readonly telegramTarget: HTMLAnchorElement; declare readonly customTarget: HTMLAnchorElement; @@ -22,6 +23,7 @@ export default class extends Controller { connect(): void { if (this.autoCloseValue) { this.twitterTarget.addEventListener('click', () => this.close()); + this.blueskyTarget.addEventListener('click', () => this.close()); this.tumblrTarget.addEventListener('click', () => this.close()); this.telegramTarget.addEventListener('click', () => this.close()); this.otherTarget.addEventListener('click', () => this.closeAfterShare()); @@ -41,6 +43,7 @@ export default class extends Controller { this.element.classList.remove('d-none'); this.twitterTarget.href = this.configValue['twitter']; + this.blueskyTarget.href = this.configValue['bluesky']; this.tumblrTarget.href = this.configValue['tumblr']; this.telegramTarget.href = this.configValue['telegram']; diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index 85610e65..411ce337 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -21,9 +21,12 @@ .align-self-center %p.fs-3.fw-bold= t(".sharing.heading") %p - %a.btn.btn-primary.mb-1{ href: "https://twitter.com/intent/tweet?text=", data: { inbox_sharing_target: "twitter" }, target: "_blank" } + %a.btn.btn-primary.mb-1{ href: "#", data: { inbox_sharing_target: "twitter" }, target: "_blank" } %i.fab.fa-twitter.fa-fw Twitter + %a.btn.btn-primary.mb-1{ href: "#", data: { inbox_sharing_target: "bluesky" }, target: "_blank" } + %i.fas.fa-cloud.fa-fw + Bluesky %a.btn.btn-primary.mb-1{ href: "#", data: { inbox_sharing_target: "tumblr" }, target: "_blank" } %i.fab.fa-tumblr.fa-fw Tumblr