@@ -12,11 +12,14 @@ import { NetworkSection } from '@app/components/relay-settings/sections/NetworkS
1212import { KindsSection } from '@app/components/relay-settings/sections/KindsSection' ;
1313import { MediaSection } from '@app/components/relay-settings/sections/MediaSection' ;
1414import { ModerationSection } from '@app/components/relay-settings/sections/ModerationSection' ;
15+ import { CollapsibleSection } from '@app/components/relay-settings/shared/CollapsibleSection/CollapsibleSection' ;
16+ import { BaseSwitch } from '@app/components/common/BaseSwitch/BaseSwitch' ;
1517import { useTranslation } from 'react-i18next' ;
1618
1719interface DesktopLayoutProps {
18- mode : string ;
19- onModeChange : ( checked : boolean ) => void ;
20+ allowUnregisteredKinds : boolean ;
21+ registeredKinds : number [ ] ;
22+ onAllowUnregisteredKindsChange : ( allowed : boolean ) => void ;
2023 onSaveClick : ( ) => void ;
2124 loadings : boolean [ ] ;
2225 // Network section props
@@ -65,8 +68,9 @@ interface DesktopLayoutProps {
6568}
6669
6770export const DesktopLayout : React . FC < DesktopLayoutProps > = ( {
68- mode,
69- onModeChange,
71+ allowUnregisteredKinds,
72+ registeredKinds,
73+ onAllowUnregisteredKindsChange,
7074 onSaveClick,
7175 loadings,
7276 // Network props
@@ -120,28 +124,46 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ({
120124 </ BaseRow >
121125
122126 < BaseCol xs = { 24 } >
123- < S . SwitchContainer
124- style = { {
125- width : '11rem' ,
126- display : 'grid' ,
127- paddingTop : '3rem' ,
128- gap : '.5rem' ,
129- gridTemplateColumns : '1fr 3fr' ,
130- marginBottom : '1.5rem' ,
131- } }
132- >
133- < S . LabelSpan > { t ( 'common.serverSetting' ) } </ S . LabelSpan >
134- < S . LargeSwitch
135- className = "modeSwitch"
136- checkedChildren = "Whitelist"
137- unCheckedChildren = "Blacklist"
138- checked = { mode === 'whitelist' }
139- onChange = { onModeChange }
140- />
141- </ S . SwitchContainer >
127+ < CollapsibleSection header = "Allow Unregistered Kind Numbers" >
128+ < S . Card >
129+ < BaseCol span = { 24 } >
130+ < div style = { { display : 'flex' , alignItems : 'flex-start' , justifyContent : 'space-between' } } >
131+ < div style = { { flex : 1 , marginRight : '2rem' } } >
132+ < h4 style = { { margin : '0 0 0.5rem 0' , fontSize : '1rem' , fontWeight : 500 } } >
133+ { t ( 'common.allowUnregisteredKinds' ) }
134+ </ h4 >
135+ < p style = { { margin : 0 , fontSize : '0.9rem' , color : '#c5d3e0' } } >
136+ Enable this to allow events with kind numbers that don't have specific handlers in the relay.
137+ </ p >
138+ { allowUnregisteredKinds && (
139+ < div style = { {
140+ marginTop : '1rem' ,
141+ padding : '0.75rem 1rem' ,
142+ backgroundColor : 'rgba(255, 77, 79, 0.1)' ,
143+ borderRadius : '4px' ,
144+ border : '1px solid rgba(255, 77, 79, 0.3)'
145+ } } >
146+ < span style = { { color : '#ff4d4f' , fontSize : '0.9rem' , display : 'flex' , alignItems : 'center' , gap : '0.5rem' } } >
147+ < span style = { { fontSize : '1.2rem' } } > ⚠️</ span >
148+ { t ( 'common.allowUnregisteredKindsWarning' ) }
149+ </ span >
150+ </ div >
151+ ) }
152+ </ div >
153+ < BaseSwitch
154+ checkedChildren = "ON"
155+ unCheckedChildren = "OFF"
156+ checked = { allowUnregisteredKinds }
157+ onChange = { onAllowUnregisteredKindsChange }
158+ />
159+ </ div >
160+ </ BaseCol >
161+ </ S . Card >
162+ </ CollapsibleSection >
142163
143164 < KindsSection
144- mode = { mode }
165+ allowUnregisteredKinds = { allowUnregisteredKinds }
166+ registeredKinds = { registeredKinds }
145167 isKindsActive = { isKindsActive }
146168 selectedKinds = { selectedKinds }
147169 dynamicKinds = { dynamicKinds }
@@ -154,7 +176,6 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ({
154176 />
155177
156178 < MediaSection
157- mode = { mode }
158179 photos = { photos }
159180 videos = { videos }
160181 audio = { audio }
0 commit comments