@@ -11,7 +11,9 @@ import PrivyConfigSection from "./PrivyConfigSection";
1111import BlockchainConfigSection from "./BlockchainConfigSection" ;
1212import LanguageSupportSection from "./LanguageSupportSection" ;
1313import NavigationMenuSection from "./NavigationMenuSection" ;
14+ import ServiceDisclaimerSection from "./ServiceDisclaimerSection" ;
1415import ProgressTracker from "./ProgressTracker" ;
16+ import { DexSectionProps } from "../hooks/useDexForm" ;
1517
1618export interface DexSectionConfig {
1719 id : number ;
@@ -22,103 +24,8 @@ export interface DexSectionConfig {
2224 // eslint-disable-next-line @typescript-eslint/no-explicit-any
2325 component : React . ComponentType < any > ;
2426 // eslint-disable-next-line @typescript-eslint/no-explicit-any
25- getProps : ( allProps : DexSectionAllProps ) => any ;
26- getValidationTest ?: ( allProps : DexSectionAllProps ) => boolean ;
27- }
28-
29- export interface DexSectionAllProps {
30- // Broker Details
31- brokerName : string ;
32- handleInputChange : (
33- field : string
34- ) => ( e : React . ChangeEvent < HTMLInputElement > ) => void ;
35- brokerNameValidator : ( value : string ) => string | null ;
36-
37- // Branding
38- primaryLogo : Blob | null ;
39- secondaryLogo : Blob | null ;
40- favicon : Blob | null ;
41- handleImageChange : ( field : string ) => ( blob : Blob | null ) => void ;
42-
43- // Theme
44- currentTheme : string | null ;
45- defaultTheme : string ;
46- showThemeEditor : boolean ;
47- viewCssCode : boolean ;
48- activeThemeTab : "colors" | "fonts" | "rounded" | "spacing" | "tradingview" ;
49- themePrompt : string ;
50- isGeneratingTheme : boolean ;
51- themeApplied : boolean ;
52- tradingViewColorConfig : string | null ;
53- toggleThemeEditor : ( ) => void ;
54- handleResetTheme : ( ) => void ;
55- handleResetToDefault : ( ) => void ;
56- handleThemeEditorChange : ( value : string ) => void ;
57- setViewCssCode : ( value : boolean ) => void ;
58- ThemeTabButton : React . FC < {
59- tab : "colors" | "fonts" | "rounded" | "spacing" | "tradingview" ;
60- label : string ;
61- } > ;
62- updateCssColor : ( variableName : string , newColorHex : string ) => void ;
63- updateCssValue : ( variableName : string , newValue : string ) => void ;
64- handleGenerateTheme : ( ) => void ;
65- setTradingViewColorConfig : ( config : string | null ) => void ;
66-
67- // PnL Posters
68- pnlPosters : ( Blob | null ) [ ] ;
69- handlePnLPosterChange : ( posters : ( Blob | null ) [ ] ) => void ;
70-
71- // Social Links
72- telegramLink : string ;
73- discordLink : string ;
74- xLink : string ;
75- urlValidator : ( value : string ) => string | null ;
76-
77- // SEO
78- seoSiteName : string ;
79- seoSiteDescription : string ;
80- seoSiteLanguage : string ;
81- seoSiteLocale : string ;
82- seoTwitterHandle : string ;
83- seoThemeColor : string ;
84- seoKeywords : string ;
85-
86- // Reown
87- walletConnectProjectId : string ;
88-
89- // Privy
90- privyAppId : string ;
91- privyTermsOfUse : string ;
92- enableAbstractWallet : boolean ;
93- onEnableAbstractWalletChange : ( value : boolean ) => void ;
94- disableEvmWallets : boolean ;
95- disableSolanaWallets : boolean ;
96- onDisableEvmWalletsChange : ( value : boolean ) => void ;
97- onDisableSolanaWalletsChange : ( value : boolean ) => void ;
98- privyLoginMethods : string [ ] ;
99- onPrivyLoginMethodsChange : ( methods : string [ ] ) => void ;
100-
101- // Blockchain
102- chainIds : number [ ] ;
103- onChainIdsChange : ( chainIds : number [ ] ) => void ;
104- defaultChain ?: number ;
105- onDefaultChainChange ?: ( chainId : number | undefined ) => void ;
106- disableMainnet : boolean ;
107- disableTestnet : boolean ;
108- onDisableMainnetChange : ( value : boolean ) => void ;
109- onDisableTestnetChange : ( value : boolean ) => void ;
110-
111- // Language Support
112- availableLanguages : string [ ] ;
113- onAvailableLanguagesChange : ( languages : string [ ] ) => void ;
114-
115- // Navigation Menus
116- enabledMenus : string ;
117- setEnabledMenus : ( menus : string ) => void ;
118- customMenus : string ;
119- setCustomMenus : ( menus : string ) => void ;
120- enableCampaigns : boolean ;
121- setEnableCampaigns : ( value : boolean ) => void ;
27+ getProps : ( sectionProps : DexSectionProps ) => any ;
28+ getValidationTest ?: ( sectionProps : DexSectionProps ) => boolean ;
12229}
12330
12431export const DEX_SECTIONS : DexSectionConfig [ ] = [
@@ -325,12 +232,26 @@ export const DEX_SECTIONS: DexSectionConfig[] = [
325232 setEnableCampaigns : props . setEnableCampaigns ,
326233 } ) ,
327234 } ,
235+ {
236+ id : 12 ,
237+ key : "serviceDisclaimer" ,
238+ title : "Service Disclaimer" ,
239+ description :
240+ "Enable a one-time disclaimer dialog that informs users about the platform's use of Orderly Network's infrastructure. This is optional and can help set proper expectations for users." ,
241+ isOptional : true ,
242+ component : ServiceDisclaimerSection ,
243+ getProps : props => ( {
244+ enableServiceDisclaimerDialog : props . enableServiceDisclaimerDialog ,
245+ onEnableServiceDisclaimerDialogChange :
246+ props . onEnableServiceDisclaimerDialogChange ,
247+ } ) ,
248+ } ,
328249] ;
329250
330251interface DexSectionRendererProps {
331252 mode : "accordion" | "direct" ;
332253 sections : DexSectionConfig [ ] ;
333- allProps : DexSectionAllProps ;
254+ sectionProps : DexSectionProps ;
334255 currentStep ?: number ;
335256 completedSteps ?: Record < number , boolean > ;
336257 setCurrentStep ?: ( step : number ) => void ;
@@ -344,7 +265,7 @@ interface DexSectionRendererProps {
344265const DexSectionRenderer : React . FC < DexSectionRendererProps > = ( {
345266 mode,
346267 sections,
347- allProps ,
268+ sectionProps ,
348269 currentStep,
349270 completedSteps,
350271 setCurrentStep,
@@ -397,7 +318,7 @@ const DexSectionRenderer: React.FC<DexSectionRendererProps> = ({
397318 const renderSection = ( section : DexSectionConfig , index : number ) => {
398319 const Component = section . component ;
399320 const componentProps = {
400- ...section . getProps ( allProps ) ,
321+ ...section . getProps ( sectionProps ) ,
401322 idPrefix : mode === "accordion" ? "" : idPrefix ,
402323 } ;
403324
@@ -436,7 +357,7 @@ const DexSectionRenderer: React.FC<DexSectionRendererProps> = ({
436357 onNextInternal = { ( ) => handleNextStep ( section . id ) }
437358 isStepContentValidTest = {
438359 section . getValidationTest
439- ? section . getValidationTest ( allProps )
360+ ? section . getValidationTest ( sectionProps )
440361 : true
441362 }
442363 isActive = { currentStep === section . id }
0 commit comments