mirror of
https://github.com/dergigi/boris.git
synced 2025-12-18 23:24:22 +01:00
refactor: move zap splits to dedicated settings section
- Created new ZapSettings component as separate section - Moved zap split slider from ReadingDisplaySettings - Placed at end of settings page as requested - Updated description to mention multiple authors support
This commit is contained in:
@@ -6,6 +6,7 @@ import { loadFont } from '../utils/fontLoader'
|
||||
import ReadingDisplaySettings from './Settings/ReadingDisplaySettings'
|
||||
import LayoutNavigationSettings from './Settings/LayoutNavigationSettings'
|
||||
import StartupPreferencesSettings from './Settings/StartupPreferencesSettings'
|
||||
import ZapSettings from './Settings/ZapSettings'
|
||||
|
||||
const DEFAULT_SETTINGS: UserSettings = {
|
||||
collapseOnArticleOpen: true,
|
||||
@@ -97,6 +98,7 @@ const Settings: React.FC<SettingsProps> = ({ settings, onSave, onClose }) => {
|
||||
<ReadingDisplaySettings settings={localSettings} onUpdate={handleUpdate} />
|
||||
<LayoutNavigationSettings settings={localSettings} onUpdate={handleUpdate} />
|
||||
<StartupPreferencesSettings settings={localSettings} onUpdate={handleUpdate} />
|
||||
<ZapSettings settings={localSettings} onUpdate={handleUpdate} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -107,27 +107,6 @@ const ReadingDisplaySettings: React.FC<ReadingDisplaySettingsProps> = ({ setting
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="setting-group">
|
||||
<label className="setting-label">Zap Split for Highlights</label>
|
||||
<div className="zap-split-container">
|
||||
<div className="zap-split-labels">
|
||||
<span className="zap-split-label">You: {settings.zapSplitPercentage ?? 50}%</span>
|
||||
<span className="zap-split-label">Author: {100 - (settings.zapSplitPercentage ?? 50)}%</span>
|
||||
</div>
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="100"
|
||||
value={settings.zapSplitPercentage ?? 50}
|
||||
onChange={(e) => onUpdate({ zapSplitPercentage: parseInt(e.target.value) })}
|
||||
className="zap-split-slider"
|
||||
/>
|
||||
<div className="zap-split-description">
|
||||
When highlighting nostr-native content, zaps will be split between you and the author.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="setting-preview">
|
||||
<div className="preview-label">Preview</div>
|
||||
<div
|
||||
|
||||
40
src/components/Settings/ZapSettings.tsx
Normal file
40
src/components/Settings/ZapSettings.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import React from 'react'
|
||||
import { UserSettings } from '../../services/settingsService'
|
||||
|
||||
interface ZapSettingsProps {
|
||||
settings: UserSettings
|
||||
onUpdate: (updates: Partial<UserSettings>) => void
|
||||
}
|
||||
|
||||
const ZapSettings: React.FC<ZapSettingsProps> = ({ settings, onUpdate }) => {
|
||||
return (
|
||||
<div className="settings-section">
|
||||
<h3 className="section-title">Zap Splits</h3>
|
||||
|
||||
<div className="setting-group">
|
||||
<label className="setting-label">Split Percentage for Highlights</label>
|
||||
<div className="zap-split-container">
|
||||
<div className="zap-split-labels">
|
||||
<span className="zap-split-label">You: {settings.zapSplitPercentage ?? 50}%</span>
|
||||
<span className="zap-split-label">Author(s): {100 - (settings.zapSplitPercentage ?? 50)}%</span>
|
||||
</div>
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="100"
|
||||
value={settings.zapSplitPercentage ?? 50}
|
||||
onChange={(e) => onUpdate({ zapSplitPercentage: parseInt(e.target.value) })}
|
||||
className="zap-split-slider"
|
||||
/>
|
||||
<div className="zap-split-description">
|
||||
When you highlight nostr-native content, zaps will be split between you (curator) and the author(s).
|
||||
If the content has multiple authors, their share is divided proportionally.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ZapSettings
|
||||
|
||||
Reference in New Issue
Block a user