feat: enable self-zapping with friendly warning message (#645)
Co-authored-by: The Daniel <dmnyc@users.noreply.github.com>
This commit is contained in:
@@ -35,7 +35,6 @@ export default function ZapButton({ event }: { event: Event }) {
|
||||
useEffect(() => {
|
||||
client.fetchProfile(event.pubkey).then((profile) => {
|
||||
if (!profile) return
|
||||
if (pubkey === profile.pubkey) return
|
||||
const lightningAddress = getLightningAddressFromProfile(profile)
|
||||
if (lightningAddress) setDisable(false)
|
||||
})
|
||||
|
||||
@@ -139,6 +139,7 @@ function ZapDialogContent({
|
||||
const { defaultZapSats, defaultZapComment } = useZap()
|
||||
const [sats, setSats] = useState(defaultAmount ?? defaultZapSats)
|
||||
const [comment, setComment] = useState(defaultComment ?? defaultZapComment)
|
||||
const isSelfZap = useMemo(() => pubkey === recipient, [pubkey, recipient])
|
||||
const [zapping, setZapping] = useState(false)
|
||||
const presetAmounts = useMemo(() => {
|
||||
if (i18n.language.startsWith('zh')) {
|
||||
@@ -229,6 +230,13 @@ function ZapDialogContent({
|
||||
<Label htmlFor="sats">{t('Sats')}</Label>
|
||||
</div>
|
||||
|
||||
{/* Self-zap easter egg warning */}
|
||||
{isSelfZap && (
|
||||
<div className="text-sm text-yellow-600 dark:text-yellow-400 text-center px-4 py-2 bg-yellow-50 dark:bg-yellow-950/30 rounded-md border border-yellow-200 dark:border-yellow-900">
|
||||
{t('selfZapWarning')}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Preset sats buttons */}
|
||||
<div className="grid grid-cols-6 gap-2">
|
||||
{presetAmounts.map(({ display, val }) => (
|
||||
|
||||
@@ -491,5 +491,6 @@ export default {
|
||||
'Explore Relays': 'استكشف المرحلات',
|
||||
'Choose a feed': 'اختر خلاصة',
|
||||
'and {{x}} others': 'و {{x}} آخرون'
|
||||
selfZapWarning: 'Jumble غير مسؤولة عما يحدث إذا أرسلت zap لنفسك. تابع على مسؤوليتك الخاصة. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -505,5 +505,6 @@ export default {
|
||||
'Explore Relays': 'Relays erkunden',
|
||||
'Choose a feed': 'Wähle einen Feed',
|
||||
'and {{x}} others': 'und {{x}} andere'
|
||||
selfZapWarning: 'Jumble ist nicht verantwortlich für das, was passiert, wenn Sie sich selbst zappen. Fahren Sie auf eigene Gefahr fort. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,5 +490,6 @@ export default {
|
||||
'Explore Relays': 'Explore Relays',
|
||||
'Choose a feed': 'Choose a feed',
|
||||
'and {{x}} others': 'and {{x}} others'
|
||||
selfZapWarning: 'Jumble is not responsible for what happens if you zap yourself. Proceed at your own risk. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,5 +499,6 @@ export default {
|
||||
'Explore Relays': 'Explorar Relays',
|
||||
'Choose a feed': 'Elige un feed',
|
||||
'and {{x}} others': 'y {{x}} otros'
|
||||
selfZapWarning: 'Jumble no se hace responsable de lo que suceda si te zapeas a ti mismo. Procede bajo tu propio riesgo. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,5 +494,6 @@ export default {
|
||||
'Explore Relays': 'کاوش در رلهها',
|
||||
'Choose a feed': 'یک فید انتخاب کنید',
|
||||
'and {{x}} others': 'و {{x}} دیگر'
|
||||
selfZapWarning: 'Jumble مسئولیتی در قبال اتفاقاتی که در صورت ارسال zap به خودتان میافتد ندارد. با مسئولیت خود ادامه دهید. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,5 +504,6 @@ export default {
|
||||
'Explore Relays': 'Explorer les relais',
|
||||
'Choose a feed': 'Choisir un fil',
|
||||
'and {{x}} others': 'et {{x}} autres'
|
||||
selfZapWarning: "Jumble n'est pas responsable de ce qui se passe si vous vous zappez vous-même. Procédez à vos risques et périls. 😉⚡",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -496,5 +496,6 @@ export default {
|
||||
'Explore Relays': 'रिले एक्सप्लोर करें',
|
||||
'Choose a feed': 'एक फीड चुनें',
|
||||
'and {{x}} others': 'और {{x}} अन्य'
|
||||
selfZapWarning: 'Jumble आपके द्वारा स्वयं को zap करने पर क्या होता है, इसके लिए जिम्मेदार नहीं है। अपनी जोखिम पर आगे बढ़ें। 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,5 +499,6 @@ export default {
|
||||
'Explore Relays': 'Esplora Relay',
|
||||
'Choose a feed': 'Scegli un feed',
|
||||
'and {{x}} others': 'e altri {{x}}'
|
||||
selfZapWarning: 'Jumble non è responsabile di ciò che accade se zappi te stesso. Procedi a tuo rischio e pericolo. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,5 +495,6 @@ export default {
|
||||
'Explore Relays': 'リレーを探索',
|
||||
'Choose a feed': 'フィードを選択',
|
||||
'and {{x}} others': 'および他{{x}}人'
|
||||
selfZapWarning: 'Jumble は、あなたが自分自身にザップした場合の結果について責任を負いません。自己責任で続行してください。😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,5 +495,6 @@ export default {
|
||||
'Explore Relays': '릴레이 탐색',
|
||||
'Choose a feed': '피드 선택',
|
||||
'and {{x}} others': '및 기타 {{x}}명'
|
||||
selfZapWarning: 'Jumble은 자신에게 Zap을 보낼 때 발생하는 일에 대해 책임을 지지 않습니다. 본인의 책임 하에 진행하세요. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,5 +499,6 @@ export default {
|
||||
'Explore Relays': 'Eksploruj Relay',
|
||||
'Choose a feed': 'Wybierz feed',
|
||||
'and {{x}} others': 'i {{x}} innych'
|
||||
selfZapWarning: 'Jumble nie ponosi odpowiedzialności za to, co się stanie, jeśli zappujesz samego siebie. Kontynuuj na własne ryzyko. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -496,5 +496,6 @@ export default {
|
||||
'Explore Relays': 'Explorar Relays',
|
||||
'Choose a feed': 'Escolha um feed',
|
||||
'and {{x}} others': 'e {{x}} outros'
|
||||
selfZapWarning: 'Jumble não é responsável pelo que acontece se você zap a si mesmo. Prossiga por sua conta e risco. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,5 +499,6 @@ export default {
|
||||
'Explore Relays': 'Explorar Relays',
|
||||
'Choose a feed': 'Escolha um feed',
|
||||
'and {{x}} others': 'e {{x}} outros'
|
||||
selfZapWarning: 'Jumble não é responsável pelo que acontece se você zap a si mesmo. Prossiga por sua conta e risco. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -501,5 +501,6 @@ export default {
|
||||
'Explore Relays': 'Исследовать Relay',
|
||||
'Choose a feed': 'Выберите ленту',
|
||||
'and {{x}} others': 'и {{x}} других'
|
||||
selfZapWarning: 'Jumble не несет ответственности за то, что произойдет, если вы отправите zap самому себе. Продолжайте на свой страх и риск. 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -489,5 +489,6 @@ export default {
|
||||
'Explore Relays': 'สำรวจรีเลย์',
|
||||
'Choose a feed': 'เลือกฟีด',
|
||||
'and {{x}} others': 'และอื่น ๆ {{x}} รายการ'
|
||||
selfZapWarning: 'Jumble ไม่รับผิดชอบต่อสิ่งที่เกิดขึ้นหากคุณ zap ตัวเอง ดำเนินการด้วยความเสี่ยงของคุณเอง 😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,5 +487,6 @@ export default {
|
||||
'Explore Relays': '探索服务器',
|
||||
'Choose a feed': '选择一个动态',
|
||||
'and {{x}} others': '和其他 {{x}} 人'
|
||||
selfZapWarning: 'Jumble 对您给自己打赏所发生的事情概不负责。风险自负。😉⚡',
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user