Optima: Nav: mobile App name support

This commit is contained in:
Enrico Ros
2025-05-13 03:28:09 -07:00
parent e503335026
commit aa9dc1a06f
3 changed files with 4 additions and 3 deletions
+1
View File
@@ -44,6 +44,7 @@ interface ItemBase {
export interface NavItemApp extends ItemBase {
type: 'app',
mobileName?: string,
route: string,
landingRoute?: string, // specify a different route than the nextjs page router route, to land to
barTitle?: string, // set to override the name as the bar title (unless custom bar content is used)
+1 -1
View File
@@ -35,7 +35,7 @@ export function MobileNav(props: {
return (
<MobileNavIcon
key={'n-m-' + app.route.slice(1)}
aria-label={app.name}
aria-label={app.mobileName || app.name}
variant={isActive ? 'solid' : undefined}
onClick={() => Router.push(app.landingRoute || app.route)}
className={`${mobileNavItemClasses.typeApp} ${isActive ? mobileNavItemClasses.active : ''}`}
@@ -56,14 +56,14 @@ export function MobileNavItems(props: { currentApp?: NavItemApp }) {
const isActive = app === props.currentApp;
return (
<Button
key={'app-' + app.name}
key={'app-' + (app.mobileName || app.name)}
size='sm'
variant={isActive ? 'solid' : undefined}
onClick={() => Router.push(app.landingRoute || app.route)}
sx={{ flexDirection: 'column', gap: 0, minWidth: 80, py: 1 }}
startDecorator={(isActive && app.iconActive) ? <app.iconActive /> : <app.icon />}
>
{app.name}
{app.mobileName || app.name}
</Button>
);
})}