managarten/apps-archived/memoro/apps/mobile/components/ui/NativeMenu.tsx
Till-JS 61d181fbc2 chore: archive inactive projects to apps-archived/
Move inactive projects out of active workspace:
- bauntown (community website)
- maerchenzauber (AI story generation)
- memoro (voice memo app)
- news (news aggregation)
- nutriphi (nutrition tracking)
- reader (reading app)
- uload (URL shortener)
- wisekeep (AI wisdom extraction)

Update CLAUDE.md documentation:
- Add presi to active projects
- Document archived projects section
- Update workspace configuration

Archived apps can be re-activated by moving back to apps/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 07:03:59 +01:00

77 lines
1.6 KiB
TypeScript

import React, { type FC, type ReactNode } from 'react';
// TODO: Migrate to @expo/ui ContextMenu
import { MenuView } from '~/components/ui/MenuViewPlaceholder';
import type { MenuActionConfig } from '~/config/menuActions';
import { buildMenuActions } from '~/utils/menuBuilder';
export interface NativeMenuProps {
/**
* Die Menu Actions die angezeigt werden sollen
*/
actions: MenuActionConfig[];
/**
* Callback wenn eine Action ausgewählt wird
*/
onAction: (actionId: string) => void;
/**
* Die Komponente die das Menu triggert
*/
children: ReactNode;
/**
* Ob das Menu ein Context Menu ist (Long Press) oder Dropdown (Tap)
* @default false (Dropdown)
*/
isContextMenu?: boolean;
/**
* Optional: Titel des Menus (nur iOS)
*/
title?: string;
/**
* Optional: Callbacks für Menu Events
*/
onOpenMenu?: () => void;
onCloseMenu?: () => void;
/**
* Optional: Theme Variant (nur iOS)
*/
themeVariant?: 'light' | 'dark';
}
/**
* Wrapper-Komponente für @react-native-menu/menu
* Vereinfacht die Verwendung von nativen Menus im Projekt
*/
export const NativeMenu: FC<NativeMenuProps> = ({
actions,
onAction,
children,
isContextMenu = false,
title,
onOpenMenu,
onCloseMenu,
themeVariant,
}) => {
const menuActions = buildMenuActions(actions);
return (
<MenuView
title={title}
actions={menuActions}
onPressAction={({ nativeEvent }) => {
onAction(nativeEvent.event);
}}
onOpenMenu={onOpenMenu}
onCloseMenu={onCloseMenu}
shouldOpenOnLongPress={isContextMenu}
themeVariant={themeVariant}
>
{children}
</MenuView>
);
};