wip
This commit is contained in:
@@ -357,20 +357,33 @@ export function LeagueScoringSection({
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const patternPanel = (
|
||||
<ScoringPatternSection
|
||||
scoring={form.scoring}
|
||||
presets={presets}
|
||||
readOnly={readOnly}
|
||||
onChangePatternId={!readOnly && onChange ? handleSelectPreset : undefined}
|
||||
onToggleCustomScoring={disabled ? undefined : handleToggleCustomScoring}
|
||||
/>
|
||||
);
|
||||
|
||||
const championshipsPanel = (
|
||||
<ChampionshipsSection form={form} onChange={onChange} readOnly={readOnly} />
|
||||
);
|
||||
const patternProps: ScoringPatternSectionProps = {
|
||||
scoring: form.scoring,
|
||||
presets,
|
||||
readOnly: !!readOnly,
|
||||
};
|
||||
|
||||
if (!readOnly && onChange) {
|
||||
patternProps.onChangePatternId = handleSelectPreset;
|
||||
}
|
||||
|
||||
if (!disabled) {
|
||||
patternProps.onToggleCustomScoring = handleToggleCustomScoring;
|
||||
}
|
||||
|
||||
const patternPanel = <ScoringPatternSection {...patternProps} />;
|
||||
|
||||
const championshipsProps: ChampionshipsSectionProps = {
|
||||
form,
|
||||
readOnly: !!readOnly,
|
||||
};
|
||||
|
||||
if (onChange) {
|
||||
championshipsProps.onChange = onChange;
|
||||
}
|
||||
|
||||
const championshipsPanel = <ChampionshipsSection {...championshipsProps} />;
|
||||
|
||||
if (patternOnly) {
|
||||
return <div>{patternPanel}</div>;
|
||||
|
||||
Reference in New Issue
Block a user