mirror of
https://github.com/mue/mue.git
synced 2026-07-17 14:04:09 +02:00
Refactor MainModal and Tab components to integrate Library and Discover tabs
This commit is contained in:
@@ -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);
|
||||
@@ -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);
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user