mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
Merge remote-tracking branch 'origin/dev' into fix/make-left-menu-sticky
This commit is contained in:
commit
9c41df22da
34 changed files with 3514 additions and 2599 deletions
|
|
@ -12,7 +12,7 @@ import AdminAuthorization from '@components/Security/AdminAuthorization'
|
|||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||
import { getUriWithOrg, getUriWithoutOrg } from '@services/config/config'
|
||||
|
||||
function LeftMenu() {
|
||||
function DashLeftMenu() {
|
||||
const org = useOrg() as any
|
||||
const session = useLHSession() as any
|
||||
const [loading, setLoading] = React.useState(true)
|
||||
|
|
@ -176,4 +176,4 @@ function LeftMenu() {
|
|||
)
|
||||
}
|
||||
|
||||
export default LeftMenu
|
||||
export default DashLeftMenu
|
||||
69
apps/web/components/Dashboard/UI/DashMobileMenu.tsx
Normal file
69
apps/web/components/Dashboard/UI/DashMobileMenu.tsx
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
'use client'
|
||||
import { useOrg } from '@components/Contexts/OrgContext'
|
||||
import { signOut } from 'next-auth/react'
|
||||
import { Backpack, BookCopy, Home, LogOut, School, Settings, Users } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import React from 'react'
|
||||
import AdminAuthorization from '@components/Security/AdminAuthorization'
|
||||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||
import { getUriWithOrg, getUriWithoutOrg } from '@services/config/config'
|
||||
import ToolTip from '@components/StyledElements/Tooltip/Tooltip'
|
||||
|
||||
function DashMobileMenu() {
|
||||
const org = useOrg() as any
|
||||
const session = useLHSession() as any
|
||||
|
||||
async function logOutUI() {
|
||||
const res = await signOut({ redirect: true, callbackUrl: getUriWithoutOrg('/login?orgslug=' + org.slug) })
|
||||
if (res) {
|
||||
getUriWithOrg(org.slug, '/')
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="fixed bottom-0 left-0 right-0 bg-black/90 backdrop-blur-lg text-white shadow-xl">
|
||||
<div className="flex justify-around items-center h-16 px-2">
|
||||
<AdminAuthorization authorizationMode="component">
|
||||
<ToolTip content={'Home'} slateBlack sideOffset={8} side="top">
|
||||
<Link href={`/`} className="flex flex-col items-center p-2">
|
||||
<Home size={20} />
|
||||
<span className="text-xs mt-1">Home</span>
|
||||
</Link>
|
||||
</ToolTip>
|
||||
<ToolTip content={'Courses'} slateBlack sideOffset={8} side="top">
|
||||
<Link href={`/dash/courses`} className="flex flex-col items-center p-2">
|
||||
<BookCopy size={20} />
|
||||
<span className="text-xs mt-1">Courses</span>
|
||||
</Link>
|
||||
</ToolTip>
|
||||
<ToolTip content={'Assignments'} slateBlack sideOffset={8} side="top">
|
||||
<Link href={`/dash/assignments`} className="flex flex-col items-center p-2">
|
||||
<Backpack size={20} />
|
||||
<span className="text-xs mt-1">Assignments</span>
|
||||
</Link>
|
||||
</ToolTip>
|
||||
<ToolTip content={'Users'} slateBlack sideOffset={8} side="top">
|
||||
<Link href={`/dash/users/settings/users`} className="flex flex-col items-center p-2">
|
||||
<Users size={20} />
|
||||
<span className="text-xs mt-1">Users</span>
|
||||
</Link>
|
||||
</ToolTip>
|
||||
<ToolTip content={'Organization'} slateBlack sideOffset={8} side="top">
|
||||
<Link href={`/dash/org/settings/general`} className="flex flex-col items-center p-2">
|
||||
<School size={20} />
|
||||
<span className="text-xs mt-1">Org</span>
|
||||
</Link>
|
||||
</ToolTip>
|
||||
</AdminAuthorization>
|
||||
<ToolTip content={session.data.user.username + "'s Settings"} slateBlack sideOffset={8} side="top">
|
||||
<Link href={'/dash/user-account/settings/general'} className="flex flex-col items-center p-2">
|
||||
<Settings size={20} />
|
||||
<span className="text-xs mt-1">Settings</span>
|
||||
</Link>
|
||||
</ToolTip>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default DashMobileMenu
|
||||
Loading…
Add table
Add a link
Reference in a new issue