Refactor MainModal and Tab components to integrate Library and Discover tabs

This commit is contained in:
alexsparkes
2025-10-29 22:56:23 +00:00
parent ac3924aaf7
commit e83afbda2c
37 changed files with 199 additions and 126 deletions

View File

@@ -4,9 +4,9 @@ import { memo } from 'react';
import Tabs from '../../../components/Elements/MainModal/backend/Tabs';
import MarketplaceTab from '../../marketplace/views/Browse';
function Marketplace({ changeTab, deepLinkData }) {
function Discover({ changeTab, deepLinkData, currentTab }) {
return (
<Tabs changeTab={(type) => changeTab(type)} current="marketplace">
<Tabs changeTab={(type) => changeTab(type)} current="discover" currentTab={currentTab}>
<div label={variables.getMessage('modals.main.marketplace.all')} name="all">
<MarketplaceTab type="all" deepLinkData={deepLinkData} />
</div>
@@ -29,4 +29,4 @@ function Marketplace({ changeTab, deepLinkData }) {
);
}
export default memo(Marketplace);
export default memo(Discover);

View File

@@ -5,9 +5,9 @@ import Tabs from 'components/Elements/MainModal/backend/Tabs';
import Added from '../../marketplace/views/Added';
import Create from '../../marketplace/views/Create';
function Addons(props) {
function Library(props) {
return (
<Tabs changeTab={(type) => props.changeTab(type)} current="addons">
<Tabs changeTab={(type) => props.changeTab(type)} current="library" currentTab={props.currentTab}>
<div label={variables.getMessage('modals.main.addons.added')} name="added">
<Added />
</div>
@@ -18,4 +18,4 @@ function Addons(props) {
);
}
export default memo(Addons);
export default memo(Library);

View File

@@ -90,7 +90,7 @@ const sections = [
function Settings(props) {
return (
<Tabs changeTab={(type) => props.changeTab(type)} current="settings">
<Tabs changeTab={(type) => props.changeTab(type)} current="settings" currentTab={props.currentTab}>
{sections.map(({ label, name, component: Component }) => (
<div key={name} label={variables.getMessage(label)} name={name}>
<Component />