2024-02-18 01:44:48 -05:00
|
|
|
// ** Icon imports
|
|
|
|
import Login from 'mdi-material-ui/Login'
|
|
|
|
import Table from 'mdi-material-ui/Table'
|
|
|
|
import CubeOutline from 'mdi-material-ui/CubeOutline'
|
|
|
|
import HomeOutline from 'mdi-material-ui/HomeOutline'
|
2024-02-18 06:59:55 -05:00
|
|
|
import SettingsApplicationsIcon from '@mui/icons-material/SettingsApplications';
|
2024-02-18 01:44:48 -05:00
|
|
|
|
|
|
|
// ** Type import
|
|
|
|
import { VerticalNavItemsType } from '../../core/layouts/types'
|
|
|
|
import { BankTransfer, PageFirst } from 'mdi-material-ui'
|
|
|
|
import { DocumentScanner, FileOpen, Settings } from '@mui/icons-material'
|
|
|
|
import { useState, useEffect } from 'react'
|
|
|
|
|
|
|
|
const navigation = (): VerticalNavItemsType => {
|
|
|
|
const [isStripeOnboarded, setIsStripeOnboarded] = useState(false);
|
|
|
|
|
|
|
|
const getData = async () => {
|
|
|
|
const onboardCheckRequest = await fetch('/api/artist/onboarded', { method: "GET" });
|
|
|
|
const onboardCheckResponse = await onboardCheckRequest.json();
|
|
|
|
setIsStripeOnboarded(onboardCheckResponse["onboarded"]);
|
|
|
|
}
|
|
|
|
useEffect(() => {
|
|
|
|
getData();
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
if(isStripeOnboarded){
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
sectionTitle: 'General'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Dashboard',
|
|
|
|
icon: HomeOutline,
|
|
|
|
path: '/dashboard'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Account Settings',
|
|
|
|
icon: Settings,
|
2024-02-18 06:59:55 -05:00
|
|
|
path: '/dashboard/settings'
|
2024-02-18 01:44:48 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
sectionTitle: 'Artist'
|
|
|
|
},
|
2024-02-18 06:59:55 -05:00
|
|
|
{
|
|
|
|
title: 'Shop Settings',
|
|
|
|
icon: SettingsApplicationsIcon,
|
|
|
|
path: '/dashboard/artist/artistsettings'
|
|
|
|
},
|
2024-02-18 01:44:48 -05:00
|
|
|
{
|
|
|
|
title: 'Payout Portal',
|
|
|
|
icon: BankTransfer,
|
|
|
|
path: '/payoutportal'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Page Settings',
|
|
|
|
icon: DocumentScanner,
|
|
|
|
path: '/dashboard/artist/pagesettings'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Preview Page',
|
|
|
|
icon: FileOpen,
|
|
|
|
path: '/artist/pagesettings'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
sectionTitle: 'General'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Dashboard',
|
|
|
|
icon: HomeOutline,
|
|
|
|
path: '/dashboard'
|
2024-02-18 06:59:55 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Account Settings',
|
|
|
|
icon: Settings,
|
|
|
|
path: '/dashboard/settings'
|
|
|
|
},
|
2024-02-18 01:44:48 -05:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default navigation
|