Skip to content

Commit fb0ab4c

Browse files
author
Sqoia Dev Agent
committed
fix: wizard steps now properly switch instead of stacking
Replaced three sibling conditional renders with a single container using ternary expressions (step===1 ? ... : step===2 ? ... : ...). Added key={'step-'+step} to force React to unmount/remount when switching steps, ensuring previous step's form is fully hidden. Previous step content no longer appears below the current step.
1 parent a15e661 commit fb0ab4c

1 file changed

Lines changed: 38 additions & 33 deletions

File tree

src/slurmledger.js

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6020,44 +6020,48 @@ function SetupWizard({ onComplete }) {
60206020
),
60216021
React.createElement('div', { style: { flexShrink: 0 } }, progressBar),
60226022

6023-
// Step content — scrollable area
6024-
// Step 1: Institution Profile
6025-
step === 1 && React.createElement(
6023+
// Step content — single scrollable container that switches content by step
6024+
React.createElement(
60266025
'div',
6027-
{ style: { overflowY: 'auto', flex: 1, paddingRight: '0.5em' } },
6028-
React.createElement(InstitutionProfile, null),
6029-
React.createElement(
6030-
'div',
6031-
{ style: { marginTop: '1.5em', display: 'flex', justifyContent: 'flex-end' } },
6026+
{ key: 'step-' + step, style: { overflowY: 'auto', flex: 1, paddingRight: '0.5em' } },
6027+
6028+
// Step 1: Institution Profile
6029+
step === 1 ? React.createElement(
6030+
React.Fragment,
6031+
null,
6032+
React.createElement(InstitutionProfile, null),
60326033
React.createElement(
6033-
'button',
6034-
{ onClick: () => setStep(2) },
6035-
'Next: Set Billing Rates \u2192'
6034+
'div',
6035+
{ style: { marginTop: '1.5em', display: 'flex', justifyContent: 'flex-end' } },
6036+
React.createElement(
6037+
'button',
6038+
{ onClick: () => setStep(2) },
6039+
'Next: Set Billing Rates \u2192'
6040+
)
60366041
)
6037-
)
6038-
),
6042+
) :
60396043

6040-
// Step 2: Rate Configuration (embedded Rates tab, rates sub-tab only)
6041-
step === 2 && React.createElement(
6042-
'div',
6043-
{ style: { overflowY: 'auto', flex: 1, paddingRight: '0.5em' } },
6044-
React.createElement(Rates, { onRatesUpdated: () => {}, username: '', userRole: 'admin' }),
6045-
React.createElement(
6046-
'div',
6047-
{ style: { marginTop: '1.5em', display: 'flex', justifyContent: 'space-between' } },
6048-
React.createElement('button', { onClick: () => setStep(1) }, '\u2190 Back'),
6044+
// Step 2: Rate Configuration
6045+
step === 2 ? React.createElement(
6046+
React.Fragment,
6047+
null,
6048+
React.createElement(Rates, { onRatesUpdated: () => {}, username: '', userRole: 'admin' }),
60496049
React.createElement(
6050-
'button',
6051-
{ onClick: () => { setStep(3); testDbConnection(); } },
6052-
'Next: Test Connection \u2192'
6050+
'div',
6051+
{ style: { marginTop: '1.5em', display: 'flex', justifyContent: 'space-between' } },
6052+
React.createElement('button', { onClick: () => setStep(1) }, '\u2190 Back'),
6053+
React.createElement(
6054+
'button',
6055+
{ onClick: () => { setStep(3); testDbConnection(); } },
6056+
'Next: Test Connection \u2192'
6057+
)
60536058
)
6054-
)
6055-
),
6059+
) :
60566060

6057-
// Step 3: Database connection test
6058-
step === 3 && React.createElement(
6059-
'div',
6060-
{ style: { overflowY: 'auto', flex: 1, paddingRight: '0.5em' } },
6061+
// Step 3: Database connection test
6062+
React.createElement(
6063+
React.Fragment,
6064+
null,
60616065
React.createElement('h3', null, 'Test Database Connection'),
60626066
React.createElement(
60636067
'p',
@@ -6127,8 +6131,9 @@ function SetupWizard({ onComplete }) {
61276131
)
61286132
)
61296133
)
6130-
)
6131-
);
6134+
) // close Step 3 Fragment
6135+
) // close scrollable wrapper div
6136+
); // close SetupWizard outer div
61326137
}
61336138

61346139
function App() {

0 commit comments

Comments
 (0)