Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(header-overflow): fix #32

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions packages/fields/src/Forms/MultiStepWizard/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ import { PartialFormConfig } from '@tutim/types';
export const Header = ({ config }: { config: PartialFormConfig }) => {
const { activeStep, goToStep } = useWizard();
if (!config.wizard) return null;
const isVertical = config.wizard.orientation === 'vertical';
const styling = isVertical
? { overflow: 'auto', height: '100%', minWidth: '100px', maxWidth: '250px', padding: '10px' }
: { overflow: 'auto', width: '100%', height: '80px', padding: '10px' };

return (
<Stepper
nonLinear
activeStep={activeStep}
orientation={config.wizard.orientation}
id="wizard-header"
sx={{ height: '60px' }}
>
<Stepper nonLinear activeStep={activeStep} orientation={config.wizard.orientation} id="wizard-header" sx={styling}>
{Object.values(config.wizard.steps).map(({ label }, index) => (
<Step key={label}>
<StepButton color="inherit" onClick={() => goToStep(index)}>
<StepButton
color="inherit"
style={{ maxWidth: '300px', textOverflow: 'clip' }}
onClick={() => goToStep(index)}
>
{label}
</StepButton>
</Step>
Expand Down