support render tab footer

This commit is contained in:
SrGooglo 2023-07-12 17:14:38 +00:00
parent 0f852e909b
commit 964821a97a

View File

@ -76,7 +76,9 @@ export default class SettingTab extends React.Component {
if (this.props.withGroups) {
const group = composeGroupsFromSettingsTab(this.tab.settings)
return Object.entries(group).map(([groupKey, settings], index) => {
return <>
{
Object.entries(group).map(([groupKey, settings], index) => {
const fromDecoratorIcon = groupsDecorators[groupKey]?.icon
const fromDecoratorTitle = groupsDecorators[groupKey]?.title
@ -106,7 +108,17 @@ export default class SettingTab extends React.Component {
})
}
return this.tab.settings.map((setting, index) => {
{
this.tab.footer && React.createElement(this.tab.footer, {
ctx: this.state.processedCtx
})
}
</>
}
return <>
{
this.tab.settings.map((setting, index) => {
return <SettingItemComponent
key={index}
setting={setting}
@ -114,4 +126,12 @@ export default class SettingTab extends React.Component {
/>
})
}
{
this.tab.footer && React.createElement(this.tab.footer, {
ctx: this.state.processedCtx
})
}
</>
}
}