This commit is contained in:
louiscklaw
2025-05-30 01:13:54 +08:00
parent 9f5367e35c
commit 98bc3fe3ce
4 changed files with 12 additions and 38 deletions

View File

@@ -5,17 +5,13 @@ import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent'; import DialogContent from '@mui/material/DialogContent';
import type { ConfirmDialogProps } from './types'; import type { ConfirmDialogProps } from './types';
import { useTranslation } from 'react-i18next';
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
export function ConfirmDialog({ export function ConfirmDialog({ open, title, action, content, onClose, ...other }: ConfirmDialogProps) {
open, const { t } = useTranslation();
title,
action,
content,
onClose,
...other
}: ConfirmDialogProps) {
return ( return (
<Dialog fullWidth maxWidth="xs" open={open} onClose={onClose} {...other}> <Dialog fullWidth maxWidth="xs" open={open} onClose={onClose} {...other}>
<DialogTitle sx={{ pb: 2 }}>{title}</DialogTitle> <DialogTitle sx={{ pb: 2 }}>{title}</DialogTitle>
@@ -26,7 +22,7 @@ export function ConfirmDialog({
{action} {action}
<Button variant="outlined" color="inherit" onClick={onClose}> <Button variant="outlined" color="inherit" onClick={onClose}>
Cancel {t('Cancel')}
</Button> </Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>

View File

@@ -11,24 +11,20 @@ import { megaMenuClasses } from '../styles';
import { NavUl, NavLi } from './nav-elements'; import { NavUl, NavLi } from './nav-elements';
import type { NavSubItemProps, NavSubListProps } from '../types'; import type { NavSubItemProps, NavSubListProps } from '../types';
import { useTranslation } from 'react-i18next';
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
export function NavSubList({ data, slotProps, ...other }: NavSubListProps) { export function NavSubList({ data, slotProps, ...other }: NavSubListProps) {
const pathname = usePathname(); const pathname = usePathname();
const { t } = useTranslation();
return ( return (
<> <>
{data?.map((list) => ( {data?.map((list) => (
<NavLi key={list?.subheader ?? list.items[0].title} {...other}> <NavLi key={list?.subheader ?? list.items[0].title} {...other}>
{list?.subheader && ( {list?.subheader && (
<Typography <Typography noWrap component="div" variant="subtitle2" className={megaMenuClasses.subheader} sx={{ mb: 1, ...slotProps?.subheader }}>
noWrap
component="div"
variant="subtitle2"
className={megaMenuClasses.subheader}
sx={{ mb: 1, ...slotProps?.subheader }}
>
{list.subheader} {list.subheader}
</Typography> </Typography>
)} )}

View File

@@ -13,16 +13,8 @@ import { Iconify, iconifyClasses } from '../../iconify';
export type NavSubheaderProps = ListSubheaderProps & { open?: boolean }; export type NavSubheaderProps = ListSubheaderProps & { open?: boolean };
export const NavSubheader = styled(({ open, children, className, ...other }: NavSubheaderProps) => ( export const NavSubheader = styled(({ open, children, className, ...other }: NavSubheaderProps) => (
<ListSubheader <ListSubheader disableSticky component="div" {...other} className={mergeClasses([navSectionClasses.subheader, className])}>
disableSticky <Iconify width={16} icon={open ? 'eva:arrow-ios-downward-fill' : 'eva:arrow-ios-forward-fill'} />
component="div"
{...other}
className={mergeClasses([navSectionClasses.subheader, className])}
>
<Iconify
width={16}
icon={open ? 'eva:arrow-ios-downward-fill' : 'eva:arrow-ios-forward-fill'}
/>
{children} {children}
</ListSubheader> </ListSubheader>
))(({ theme }) => ({ ))(({ theme }) => ({

View File

@@ -27,10 +27,7 @@ export function NavSectionHorizontal({
const cssVars = { ...navSectionCssVars.horizontal(theme), ...overridesVars }; const cssVars = { ...navSectionCssVars.horizontal(theme), ...overridesVars };
return ( return (
<Scrollbar <Scrollbar sx={{ height: 1 }} slotProps={{ contentSx: { height: 1, display: 'flex', alignItems: 'center' } }}>
sx={{ height: 1 }}
slotProps={{ contentSx: { height: 1, display: 'flex', alignItems: 'center' } }}
>
<Nav <Nav
className={mergeClasses([navSectionClasses.horizontal, className])} className={mergeClasses([navSectionClasses.horizontal, className])}
sx={[ sx={[
@@ -66,14 +63,7 @@ export function NavSectionHorizontal({
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
function Group({ function Group({ items, render, cssVars, slotProps, checkPermissions, enabledRootRedirect }: NavGroupProps) {
items,
render,
cssVars,
slotProps,
checkPermissions,
enabledRootRedirect,
}: NavGroupProps) {
return ( return (
<NavLi> <NavLi>
<NavUl sx={{ flexDirection: 'row', gap: 'var(--nav-item-gap)' }}> <NavUl sx={{ flexDirection: 'row', gap: 'var(--nav-item-gap)' }}>