mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
move apps menu
This commit is contained in:
parent
880f36a113
commit
dcf7124f20
39
packages/app/src/components/AppMenu/index.jsx
Normal file
39
packages/app/src/components/AppMenu/index.jsx
Normal 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
|
13
packages/app/src/components/AppMenu/index.less
Normal file
13
packages/app/src/components/AppMenu/index.less
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
.apps-menu {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
gap: 10px;
|
||||||
|
|
||||||
|
.apps-menu-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
}
|
@ -63,7 +63,6 @@ const UserShareBadge = (props) => {
|
|||||||
user.badges?.length > 0 && <UserBadges user_id={user._id} />
|
user.badges?.length > 0 && <UserBadges user_id={user._id} />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,43 +13,9 @@ import sidebarItems from "@config/sidebar"
|
|||||||
|
|
||||||
import "./index.less"
|
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 = {
|
const onClickHandlers = {
|
||||||
apps: () => {
|
apps: () => {
|
||||||
app.layout.drawer.open("apps", AppDrawer)
|
app.controls.openAppsMenu()
|
||||||
},
|
},
|
||||||
addons: () => {
|
addons: () => {
|
||||||
window.app.location.push("/addons")
|
window.app.location.push("/addons")
|
||||||
@ -123,13 +89,13 @@ const BottomMenuDefaultItems = [
|
|||||||
</Translation>,
|
</Translation>,
|
||||||
icon: <Icons.Bell />,
|
icon: <Icons.Bell />,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
key: "apps",
|
// key: "apps",
|
||||||
label: <Translation>
|
// label: <Translation>
|
||||||
{(t) => t("Apps")}
|
// {(t) => t("Apps")}
|
||||||
</Translation>,
|
// </Translation>,
|
||||||
icon: <Icons.MdApps />,
|
// icon: <Icons.MdApps />,
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
key: "settings",
|
key: "settings",
|
||||||
label: <Translation>
|
label: <Translation>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user