From cb286d37e5fc7626506b63b072246f32729112af Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 24 Mar 2026 21:46:16 +0200 Subject: [PATCH] Add share tournament URL button --- .../tournament/routes/to.$id.register.tsx | 42 +++++++++++++++++++ locales/da/common.json | 1 + locales/de/common.json | 1 + locales/en/common.json | 1 + locales/es-ES/common.json | 1 + locales/es-US/common.json | 1 + locales/fr-CA/common.json | 1 + locales/fr-EU/common.json | 1 + locales/he/common.json | 1 + locales/it/common.json | 1 + locales/ja/common.json | 1 + locales/ko/common.json | 1 + locales/nl/common.json | 1 + locales/pl/common.json | 1 + locales/pt-BR/common.json | 1 + locales/ru/common.json | 1 + locales/zh/common.json | 1 + 17 files changed, 58 insertions(+) diff --git a/app/features/tournament/routes/to.$id.register.tsx b/app/features/tournament/routes/to.$id.register.tsx index 8744ccd7a..9e707e1d3 100644 --- a/app/features/tournament/routes/to.$id.register.tsx +++ b/app/features/tournament/routes/to.$id.register.tsx @@ -6,6 +6,7 @@ import { BookmarkCheck, Check, Clock, + Share2, Trash, User, X, @@ -16,6 +17,7 @@ import { Form, Link, useFetcher, useLoaderData } from "react-router"; import { useCopyToClipboard } from "react-use"; import { Alert } from "~/components/Alert"; import { Avatar } from "~/components/Avatar"; +import { CopyToClipboardPopover } from "~/components/CopyToClipboardPopover"; import { Divider } from "~/components/Divider"; import { LinkButton, SendouButton } from "~/components/elements/Button"; import { SendouPopover } from "~/components/elements/Popover"; @@ -57,6 +59,7 @@ import { SENDOU_INK_BASE_URL, tournamentJoinPage, tournamentOrganizationPage, + tournamentPage, tournamentSubsPage, userEditProfilePage, userPage, @@ -226,6 +229,7 @@ function TournamentRegisterInfoTabs() { ) : null} +
@@ -1327,6 +1331,44 @@ function SaveTournamentButton() { ); } +function ShareTournamentButton() { + const { t } = useTranslation(["common"]); + const tournament = useTournament(); + + const url = `${SENDOU_INK_BASE_URL}${tournamentPage(tournament.ctx.id)}`; + + const handleShare = () => { + navigator.share({ url }); + }; + + if ( + typeof navigator !== "undefined" && + typeof navigator.share === "function" + ) { + return ( + } + onPress={handleShare} + > + {t("common:actions.share")} + + ); + } + + return ( + }> + {t("common:actions.share")} + + } + /> + ); +} + function TOPickedMapPoolInfo() { const { t } = useTranslation(["calendar"]); const tournament = useTournament(); diff --git a/locales/da/common.json b/locales/da/common.json index 400065b5d..08d7e0b49 100644 --- a/locales/da/common.json +++ b/locales/da/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Hjælp og feedback", "footer.patreon.subtitle": "Støt hjemmesiden", "footer.thanks": "Tak til vores patrons for støtten", + "actions.share": "", "actions.save": "Gem", "actions.unsave": "", "actions.saveChanges": "Gem ændringer", diff --git a/locales/de/common.json b/locales/de/common.json index 32aacdbb1..e44d03064 100644 --- a/locales/de/common.json +++ b/locales/de/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Hilfe & Feedback", "footer.patreon.subtitle": "Support", "footer.thanks": "Danke an die Patrons für den Support", + "actions.share": "", "actions.save": "Speichern", "actions.unsave": "", "actions.saveChanges": "Änderungen speichern", diff --git a/locales/en/common.json b/locales/en/common.json index 9b676ee9f..eeaa5e3e6 100644 --- a/locales/en/common.json +++ b/locales/en/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Help & feedback", "footer.patreon.subtitle": "Support", "footer.thanks": "Thanks to the patrons for the support", + "actions.share": "Share", "actions.save": "Save", "actions.unsave": "Unsave", "actions.saveChanges": "Save changes", diff --git a/locales/es-ES/common.json b/locales/es-ES/common.json index 8aa828308..00960a8e1 100644 --- a/locales/es-ES/common.json +++ b/locales/es-ES/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Ayuda y comentarios", "footer.patreon.subtitle": "Apoyar", "footer.thanks": "Gracias a los mecenas por su apoyo", + "actions.share": "", "actions.save": "Guardar", "actions.unsave": "", "actions.saveChanges": "Guardar cambios", diff --git a/locales/es-US/common.json b/locales/es-US/common.json index 788a5c9c3..b17806548 100644 --- a/locales/es-US/common.json +++ b/locales/es-US/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Ayuda y comentarios", "footer.patreon.subtitle": "Apoyar", "footer.thanks": "Gracias a los Patrons por su apoyo", + "actions.share": "", "actions.save": "Guardar", "actions.unsave": "", "actions.saveChanges": "Guardar cambios", diff --git a/locales/fr-CA/common.json b/locales/fr-CA/common.json index 4bdabe6fa..ee947aeeb 100644 --- a/locales/fr-CA/common.json +++ b/locales/fr-CA/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Aide & retours", "footer.patreon.subtitle": "Soutien", "footer.thanks": "Merci à nos Supporters pour le soutien", + "actions.share": "", "actions.save": "Sauvegarder", "actions.unsave": "", "actions.saveChanges": "Sauvegarder les changements", diff --git a/locales/fr-EU/common.json b/locales/fr-EU/common.json index b54475625..ab96e9bd7 100644 --- a/locales/fr-EU/common.json +++ b/locales/fr-EU/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Aide & retours", "footer.patreon.subtitle": "Soutien", "footer.thanks": "Merci à nos Supporters pour le soutien", + "actions.share": "", "actions.save": "Sauvegarder", "actions.unsave": "", "actions.saveChanges": "Sauvegarder les changements", diff --git a/locales/he/common.json b/locales/he/common.json index db08c87d0..813d518e5 100644 --- a/locales/he/common.json +++ b/locales/he/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "עזרה ומשוב", "footer.patreon.subtitle": "תמיכה", "footer.thanks": "תודה לפטרונים על התמיכה", + "actions.share": "", "actions.save": "שמירה", "actions.unsave": "", "actions.saveChanges": "שמירת שינויים", diff --git a/locales/it/common.json b/locales/it/common.json index 3a40c5b96..03030027a 100644 --- a/locales/it/common.json +++ b/locales/it/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Aiuto & feedback", "footer.patreon.subtitle": "Supporto", "footer.thanks": "Mille grazie ai supporter su Patreon!", + "actions.share": "", "actions.save": "Salva", "actions.unsave": "", "actions.saveChanges": "Salva cambiamenti", diff --git a/locales/ja/common.json b/locales/ja/common.json index 9f89c8e88..87f63c88b 100644 --- a/locales/ja/common.json +++ b/locales/ja/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "ヘルプ & フィードバック", "footer.patreon.subtitle": "寄付", "footer.thanks": "寄付のご協力ありがとうございます", + "actions.share": "", "actions.save": "保存", "actions.unsave": "", "actions.saveChanges": "変更を保存", diff --git a/locales/ko/common.json b/locales/ko/common.json index e6951c6d3..072fd4743 100644 --- a/locales/ko/common.json +++ b/locales/ko/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "도움 & 피드백", "footer.patreon.subtitle": "후원", "footer.thanks": "Patreon 후원자들에게 갑사드립니다", + "actions.share": "", "actions.save": "저장하기", "actions.unsave": "", "actions.saveChanges": "수정사항 저장", diff --git a/locales/nl/common.json b/locales/nl/common.json index c7102d088..7dd9ad586 100644 --- a/locales/nl/common.json +++ b/locales/nl/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Help & Feedback", "footer.patreon.subtitle": "Steun sendou.ink", "footer.thanks": "Met dank aan alle patrons voor de steun", + "actions.share": "", "actions.save": "Opslaan", "actions.unsave": "", "actions.saveChanges": "", diff --git a/locales/pl/common.json b/locales/pl/common.json index 866e4ee60..b9fa57e7b 100644 --- a/locales/pl/common.json +++ b/locales/pl/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Pomoc", "footer.patreon.subtitle": "Wsparcie", "footer.thanks": "Dziękujemy patronom za wsparcie", + "actions.share": "", "actions.save": "Zapisz", "actions.unsave": "", "actions.saveChanges": "Zapisz zmiany", diff --git a/locales/pt-BR/common.json b/locales/pt-BR/common.json index 58732d3cb..461326305 100644 --- a/locales/pt-BR/common.json +++ b/locales/pt-BR/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Ajuda e Feedback", "footer.patreon.subtitle": "Suporte", "footer.thanks": "Obrigado aos patronos e patronesses pelo suporte", + "actions.share": "", "actions.save": "Salvar", "actions.unsave": "", "actions.saveChanges": "Salvar mudanças", diff --git a/locales/ru/common.json b/locales/ru/common.json index 78ce21813..08714b482 100644 --- a/locales/ru/common.json +++ b/locales/ru/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "Помощь и обратная связь", "footer.patreon.subtitle": "Поддержать", "footer.thanks": "Спасибо меценатам за поддержку", + "actions.share": "", "actions.save": "Сохранить", "actions.unsave": "", "actions.saveChanges": "Сохранить изменения", diff --git a/locales/zh/common.json b/locales/zh/common.json index b4135502b..b795c8078 100644 --- a/locales/zh/common.json +++ b/locales/zh/common.json @@ -104,6 +104,7 @@ "footer.discord.subtitle": "帮助及反馈", "footer.patreon.subtitle": "支持", "footer.thanks": "感谢Patreon上的支持者", + "actions.share": "", "actions.save": "保存", "actions.unsave": "", "actions.saveChanges": "保存更改内容",