move apps menu

This commit is contained in:
SrGooglo 2024-09-12 00:19:40 +00:00
parent 880f36a113
commit dcf7124f20
4 changed files with 60 additions and 43 deletions

View File

@ -0,0 +1,39 @@
import React from "react"
import "./index.less"
const AppMenu = (props) => {
// TODO: Fetch from app core
const installedApps = []
return <div className="apps-menu">
<h1>Apps</h1>
{
installedApps.map((item) => {
return <div
key={item.key}
className="apps-menu-item"
onClick={() => {
if (item.location) {
app.location.push(item.location)
}
props.close()
}}
>
<h3>{item.icon && createIconRender(item.icon)} {item.label}</h3>
</div>
})
}
{
installedApps.length === 0 && <Empty
description="No apps installed"
image={Empty.PRESENTED_IMAGE_SIMPLE}
/>
}
</div>
}
export default AppMenu

View File

@ -0,0 +1,13 @@
.apps-menu {
display: flex;
flex-direction: column;
gap: 10px;
.apps-menu-item {
display: flex;
flex-direction: row;
gap: 10px;
}
}

View File

@ -63,7 +63,6 @@ const UserShareBadge = (props) => {
user.badges?.length > 0 && <UserBadges user_id={user._id} />
}
</div>
</div>
}

View File

@ -13,43 +13,9 @@ import sidebarItems from "@config/sidebar"
import "./index.less"
const AppDrawer = (props) => {
// TODO: Fetch from app core
const installedApps = []
return <div className="app-drawer">
<h1>Apps</h1>
{
installedApps.map((item) => {
return <div
key={item.key}
className="app-drawer_item"
onClick={() => {
if (item.location) {
app.location.push(item.location)
}
props.close()
}}
>
<h3>{item.icon && createIconRender(item.icon)} {item.label}</h3>
</div>
})
}
{
installedApps.length === 0 && <Empty
description="No apps installed"
image={Empty.PRESENTED_IMAGE_SIMPLE}
/>
}
</div>
}
const onClickHandlers = {
apps: () => {
app.layout.drawer.open("apps", AppDrawer)
app.controls.openAppsMenu()
},
addons: () => {
window.app.location.push("/addons")
@ -123,13 +89,13 @@ const BottomMenuDefaultItems = [
</Translation>,
icon: <Icons.Bell />,
},
{
key: "apps",
label: <Translation>
{(t) => t("Apps")}
</Translation>,
icon: <Icons.MdApps />,
},
// {
// key: "apps",
// label: <Translation>
// {(t) => t("Apps")}
// </Translation>,
// icon: <Icons.MdApps />,
// },
{
key: "settings",
label: <Translation>