From b85f9b79c345fc27a279769276e17fab756198ce Mon Sep 17 00:00:00 2001 From: Gigi Date: Wed, 15 Oct 2025 19:26:10 +0200 Subject: [PATCH] feat: add zaps.svg illustration to Zap Splits section with responsive layout --- src/components/Settings/ZapSettings.tsx | 214 +++++++++++++----------- 1 file changed, 114 insertions(+), 100 deletions(-) diff --git a/src/components/Settings/ZapSettings.tsx b/src/components/Settings/ZapSettings.tsx index e6b4d752..b229d494 100644 --- a/src/components/Settings/ZapSettings.tsx +++ b/src/components/Settings/ZapSettings.tsx @@ -1,5 +1,6 @@ import React from 'react' import { UserSettings } from '../../services/settingsService' +import { useIsMobile } from '../../hooks/useMediaQuery' interface ZapSettingsProps { settings: UserSettings @@ -7,6 +8,7 @@ interface ZapSettingsProps { } const ZapSettings: React.FC = ({ settings, onUpdate }) => { + const isMobile = useIsMobile() const highlighterWeight = settings.zapSplitHighlighterWeight ?? 50 const borisWeight = settings.zapSplitBorisWeight ?? 2.1 const authorWeight = settings.zapSplitAuthorWeight ?? 50 @@ -42,111 +44,123 @@ const ZapSettings: React.FC = ({ settings, onUpdate }) => {

Zap Splits

-
- -
- - - - -
-
- -
- -
-
- Weight: {highlighterWeight} - ({highlighterPercentage.toFixed(1)}%) +
+
+
+ +
+ + + + +
- onUpdate({ zapSplitHighlighterWeight: parseInt(e.target.value) })} - className="zap-split-slider" - list="highlighter-ticks" - /> - - - -
-
- -
- -
-
- Weight: {authorWeight} - ({authorPercentage.toFixed(1)}%) + +
+ +
+
+ Weight: {highlighterWeight} + ({highlighterPercentage.toFixed(1)}%) +
+ onUpdate({ zapSplitHighlighterWeight: parseInt(e.target.value) })} + className="zap-split-slider" + list="highlighter-ticks" + /> + + + +
- onUpdate({ zapSplitAuthorWeight: parseInt(e.target.value) })} - className="zap-split-slider" - list="author-ticks" - /> - - - -
-
-
- -
-
- Weight: {borisWeight.toFixed(1)} - ({borisPercentage.toFixed(1)}%) +
+ +
+
+ Weight: {authorWeight} + ({authorPercentage.toFixed(1)}%) +
+ onUpdate({ zapSplitAuthorWeight: parseInt(e.target.value) })} + className="zap-split-slider" + list="author-ticks" + /> + + + +
- onUpdate({ zapSplitBorisWeight: parseFloat(e.target.value) })} - className="zap-split-slider" - list="boris-ticks" - /> - - - -
-
-

- Weights determine zap splits when highlighting nostr-native content. - If the content has multiple authors, their share is divided proportionally. -

+
+ +
+
+ Weight: {borisWeight.toFixed(1)} + ({borisPercentage.toFixed(1)}%) +
+ onUpdate({ zapSplitBorisWeight: parseFloat(e.target.value) })} + className="zap-split-slider" + list="boris-ticks" + /> + + + +
+
+ +

+ Weights determine zap splits when highlighting nostr-native content. + If the content has multiple authors, their share is divided proportionally. +

+
+ + {!isMobile && ( + Zap Splits + )} +
) }