SidePanel düzenlemesi
This commit is contained in:
parent
0b24c9ed6e
commit
57dc9811a7
10 changed files with 299 additions and 500 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,5 @@
|
||||||
.menu-item {
|
.menu-item {
|
||||||
@apply cursor-pointer font-semibold px-2 rounded-md flex items-center w-full whitespace-nowrap gap-x-2;
|
@apply cursor-pointer font-medium rounded-md flex items-center w-full whitespace-nowrap gap-x-1 px-2;
|
||||||
|
|
||||||
&.menu-item-light {
|
&.menu-item-light {
|
||||||
@apply text-gray-600;
|
@apply text-gray-600;
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-collapse-item {
|
.menu-collapse-item {
|
||||||
@apply cursor-pointer select-none font-semibold px-3 h-8 rounded-md flex items-center justify-between;
|
@apply cursor-pointer select-none font-semibold px-2 h-8 rounded-md flex items-center justify-between;
|
||||||
|
|
||||||
&.menu-collapse-item-light {
|
&.menu-collapse-item-light {
|
||||||
@apply text-gray-600 hover:text-gray-900 hover:bg-gray-100;
|
@apply text-gray-600 hover:text-gray-900 hover:bg-gray-100;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.side-nav-content {
|
.side-nav-content {
|
||||||
height: calc(100vh - theme("spacing.16"));
|
height: calc(100vh - theme('spacing.24'));
|
||||||
@apply overflow-y-auto;
|
@apply overflow-y-auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ const HeaderActionsEnd = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AiAssistant />
|
<AiAssistant />
|
||||||
<LanguageSelector />
|
|
||||||
<Notification />
|
<Notification />
|
||||||
<SidePanel />
|
<LanguageSelector />
|
||||||
|
<SidePanel className="hidden" />
|
||||||
<UserDropdown hoverable={false} />
|
<UserDropdown hoverable={false} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@ const HeaderActionsEnd = () => {
|
||||||
<>
|
<>
|
||||||
<AiAssistant />
|
<AiAssistant />
|
||||||
<Search />
|
<Search />
|
||||||
<LanguageSelector />
|
|
||||||
<Notification />
|
<Notification />
|
||||||
<SidePanel />
|
<LanguageSelector />
|
||||||
|
<SidePanel className="hidden" />
|
||||||
<UserDropdown hoverable={false} />
|
<UserDropdown hoverable={false} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ const HeaderActionsEnd = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AiAssistant />
|
<AiAssistant />
|
||||||
<LanguageSelector />
|
|
||||||
<Notification />
|
<Notification />
|
||||||
<SidePanel />
|
<LanguageSelector />
|
||||||
|
<SidePanel className="hidden" />
|
||||||
<UserDropdown hoverable={false} />
|
<UserDropdown hoverable={false} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ const HeaderActionsEnd = () => {
|
||||||
<Search />
|
<Search />
|
||||||
<AiAssistant />
|
<AiAssistant />
|
||||||
<Notification />
|
<Notification />
|
||||||
<SidePanel />
|
|
||||||
<LanguageSelector />
|
<LanguageSelector />
|
||||||
|
<SidePanel className="hidden" />
|
||||||
<UserDropdown hoverable={false} />
|
<UserDropdown hoverable={false} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ const HeaderActionsEnd = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AiAssistant />
|
<AiAssistant />
|
||||||
<LanguageSelector />
|
|
||||||
<Notification />
|
<Notification />
|
||||||
<SidePanel />
|
<LanguageSelector />
|
||||||
|
<SidePanel className="hidden" />
|
||||||
<UserDropdown hoverable={false} />
|
<UserDropdown hoverable={false} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,14 @@
|
||||||
import type { CommonProps } from '@/@types/common'
|
import type { CommonProps } from '@/@types/common'
|
||||||
import Dropdown from '@/components/ui/Dropdown'
|
import Dropdown from '@/components/ui/Dropdown'
|
||||||
import { ROUTES_ENUM } from '@/routes/route.constant'
|
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||||
import { useStoreState } from '@/store'
|
import { useStoreActions, useStoreState } from '@/store'
|
||||||
import withHeaderItem from '@/utils/hoc/withHeaderItem'
|
import withHeaderItem from '@/utils/hoc/withHeaderItem'
|
||||||
import useAuth from '@/utils/hooks/useAuth'
|
import useAuth from '@/utils/hooks/useAuth'
|
||||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
import { FaChartLine } from 'react-icons/fa'
|
|
||||||
import { FaSignOutAlt, FaUser } from 'react-icons/fa'
|
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { Avatar } from '../ui'
|
import { Avatar } from '../ui'
|
||||||
import { FcNext, FcNfcSign, FcPodiumWithSpeaker, FcVoicePresentation } from 'react-icons/fc'
|
import { FcEngineering, FcNext, FcNfcSign, FcVoicePresentation } from 'react-icons/fc'
|
||||||
|
|
||||||
type DropdownList = {
|
type DropdownList = {
|
||||||
label: string
|
label: string
|
||||||
|
|
@ -19,6 +17,7 @@ type DropdownList = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const _UserDropdown = ({ className }: CommonProps) => {
|
const _UserDropdown = ({ className }: CommonProps) => {
|
||||||
|
const { setPanelExpand } = useStoreActions((actions) => actions.theme)
|
||||||
const { userName, name, email, avatar } = useStoreState((state) => state.auth.user)
|
const { userName, name, email, avatar } = useStoreState((state) => state.auth.user)
|
||||||
const tenant = useStoreState((state) => state.abpConfig.config?.currentTenant)
|
const tenant = useStoreState((state) => state.abpConfig.config?.currentTenant)
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
|
|
@ -35,6 +34,11 @@ const _UserDropdown = ({ className }: CommonProps) => {
|
||||||
path: ROUTES_ENUM.protected.admin.activityLog,
|
path: ROUTES_ENUM.protected.admin.activityLog,
|
||||||
icon: <FcNfcSign />,
|
icon: <FcNfcSign />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: translate('::SidePanel.Title'),
|
||||||
|
path: ROUTES_ENUM.protected.admin.activityLog,
|
||||||
|
icon: <FcEngineering />,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const UserAvatar = (
|
const UserAvatar = (
|
||||||
|
|
@ -60,16 +64,38 @@ const _UserDropdown = ({ className }: CommonProps) => {
|
||||||
</div>
|
</div>
|
||||||
</Dropdown.Item>
|
</Dropdown.Item>
|
||||||
<Dropdown.Item variant="divider" />
|
<Dropdown.Item variant="divider" />
|
||||||
{dropdownItemList.map((item) => (
|
{dropdownItemList.map((item) => {
|
||||||
<Dropdown.Item key={item.label} eventKey={item.label} className="mb-1 px-0">
|
const isSidePanel = item.label === translate('::SidePanel.Title')
|
||||||
<Link className="flex h-full w-full px-2" to={item.path}>
|
return (
|
||||||
<span className="flex gap-2 items-center w-full">
|
<Dropdown.Item
|
||||||
|
key={item.label}
|
||||||
|
eventKey={item.label}
|
||||||
|
className="mb-1 px-0"
|
||||||
|
onClick={() => {
|
||||||
|
if (isSidePanel) {
|
||||||
|
setPanelExpand(true) // 👈 sadece SidePanel için
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{isSidePanel ? (
|
||||||
|
// SidePanel aç
|
||||||
|
<span className="flex h-full w-full px-2 gap-2 items-center">
|
||||||
<span className="text-xl opacity-50">{item.icon}</span>
|
<span className="text-xl opacity-50">{item.icon}</span>
|
||||||
<span>{item.label}</span>
|
<span>{item.label}</span>
|
||||||
</span>
|
</span>
|
||||||
|
) : (
|
||||||
|
// Normal link navigasyonu
|
||||||
|
<>
|
||||||
|
<Link className="flex h-full w-full px-2 gap-2 items-center" to={item.path}>
|
||||||
|
<span className="text-xl opacity-50">{item.icon}</span>
|
||||||
|
<span>{item.label}</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Dropdown.Item>
|
</Dropdown.Item>
|
||||||
))}
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
{/* <Dropdown.Item variant="divider" /> */}
|
{/* <Dropdown.Item variant="divider" /> */}
|
||||||
<Dropdown.Item eventKey="Sign Out" className="mb-1 px-2" onClick={signOut}>
|
<Dropdown.Item eventKey="Sign Out" className="mb-1 px-2" onClick={signOut}>
|
||||||
<span className="text-xl opacity-50">
|
<span className="text-xl opacity-50">
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ export const NAV_MODE_DARK = 'dark'
|
||||||
export const NAV_MODE_THEMED = 'themed'
|
export const NAV_MODE_THEMED = 'themed'
|
||||||
export const NAV_MODE_TRANSPARENT = 'transparent'
|
export const NAV_MODE_TRANSPARENT = 'transparent'
|
||||||
|
|
||||||
export const SIDE_NAV_WIDTH = 330
|
export const SIDE_NAV_WIDTH = 275
|
||||||
export const SIDE_NAV_COLLAPSED_WIDTH = 80
|
export const SIDE_NAV_COLLAPSED_WIDTH = 80
|
||||||
export const SPLITTED_SIDE_NAV_MINI_WIDTH = 80
|
export const SPLITTED_SIDE_NAV_MINI_WIDTH = 80
|
||||||
export const SPLITTED_SIDE_NAV_SECONDARY_WIDTH = 250
|
export const SPLITTED_SIDE_NAV_SECONDARY_WIDTH = 250
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue