Skip to content

Commit

Permalink
refactor: move menu
Browse files Browse the repository at this point in the history
  • Loading branch information
vonovak committed Apr 9, 2024
1 parent 81dbbed commit fadaada
Show file tree
Hide file tree
Showing 16 changed files with 250 additions and 147 deletions.
26 changes: 25 additions & 1 deletion example/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const modules = Object.keys({

const defaultConfig = getDefaultConfig(__dirname);

module.exports = {
const config = {
...defaultConfig,

projectRoot: __dirname,
Expand All @@ -22,6 +22,28 @@ module.exports = {
// So we block them at the root, and alias them to the versions in example's node_modules
resolver: {
...defaultConfig.resolver,
// "exports": {
// ".": {
// "require": {
// "default": "./lib/commonjs/index.js"
// },
// "import": {
// "default": "./lib/module/index.js"
// },
// "react-native": "./src/index.ts"
// },
// "./menu": {
// "require": {
// "default": "./lib/commonjs/overflowMenu/vendor/index.js"
// },
// "import": {
// "default": "./lib/module/overflowMenu/vendor/index.js",
// "types": "./lib/typescript/overflowMenu/vendor/index.d.ts"
// },
// "react-native": "./src/index/menu/index.ts"
// }
// },
// unstable_enablePackageExports: true,

blockList: exclusionList(
modules.map(
Expand All @@ -36,3 +58,5 @@ module.exports = {
}, {}),
},
};
console.log({ config });
module.exports = config;
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "example",
"version": "1.0.0",
"scripts": {
"start": "expo start --dev-client",
"start": "expo start --dev-client -c",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
Expand All @@ -15,12 +15,12 @@
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"@react-navigation/stack": "^6.3.16",
"expo": "~50.0.6",
"expo": "~50.0.15",
"expo-splash-screen": "~0.26.4",
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.73.4",
"react-native": "0.73.6",
"react-native-gesture-handler": "~2.14.0",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
Expand Down
2 changes: 1 addition & 1 deletion example/src/screens/TabScreenWithButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import {
Divider,
HeaderButtons,
HiddenItem,
Item,
OverflowMenu,
} from 'react-navigation-header-buttons';
import { Divider } from 'react-navigation-header-buttons/menu';
import { MaterialHeaderButton } from '../components/MaterialHeaderButton';
import { ScreenBody } from '../components/ScreenBody';
import { Text } from 'react-native';
Expand Down
2 changes: 1 addition & 1 deletion example/src/screens/UsageDifferentFontFamilies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function UsageDifferentFontFamilies({
<Item
title="settings-ion"
IconComponent={Ionicons}
iconName="ios-settings"
iconName="settings"
onPress={() => alert('ionicons settings')}
/>
<Item
Expand Down
2 changes: 1 addition & 1 deletion example/src/screens/UsageWithIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
Item,
HiddenItem,
OverflowMenu,
Divider,
ItemProps,
HiddenItemProps,
} from 'react-navigation-header-buttons';
Expand All @@ -14,6 +13,7 @@ import { MaterialHeaderButton } from '../components/MaterialHeaderButton';
import { ScreenBody } from '../components/ScreenBody';
import { Text } from 'react-native';
import { useLayoutEffect } from 'react';
import { Divider } from 'react-navigation-header-buttons/menu';

const EditItem = ({ onPress }: Pick<ItemProps, 'onPress'>) => {
return <Item title="edit" onPress={onPress} />;
Expand Down
2 changes: 1 addition & 1 deletion example/src/screens/UsageWithOverflowComplex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { View, Text } from 'react-native';
import {
HiddenItem,
OverflowMenu,
Divider,
overflowMenuPressHandlerActionSheet,
overflowMenuPressHandlerPopupMenu,
overflowMenuPressHandlerDropdownMenu,
Expand All @@ -15,6 +14,7 @@ import {
import type { ScreenProps } from '../NavTypes';
import { Button } from '../components/PaddedButton';
import { ScreenBody } from '../components/ScreenBody';
import { Divider } from 'react-navigation-header-buttons/menu';

const ReusableItem = ({ title, disabled = false }: HiddenItemProps) => {
return (
Expand Down
Loading

0 comments on commit fadaada

Please sign in to comment.