Skip to content

Commit b2f3491

Browse files
committed
💫 Update: Ex - Add Test08Screen
1 parent ffe6328 commit b2f3491

File tree

4 files changed

+99
-0
lines changed

4 files changed

+99
-0
lines changed

example/src/constants/ExampleCardItems.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ export const EXAMPLE_ITEMS: Array<ExampleItem> = (() => {
389389
type: 'screen',
390390
...ROUTE_MAP.test07Screen,
391391
},
392+
{
393+
type: 'screen',
394+
...ROUTE_MAP.test08Screen,
395+
},
392396
];
393397

394398
// if (SHARED_ENV.enableReactNavigation) {

example/src/constants/RouteItems.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Test04Screen } from "../screens/Test04Screen";
88
import { Test05Screen } from "../screens/Test05Screen";
99
import { Test06Screen } from "../screens/Test06Screen";
1010
import { Test07Screen } from "../screens/Test07Screen";
11+
import { Test08Screen } from "../screens/Test08Screen";
1112

1213
import type { RouteKey } from "./RouteKeys";
1314

@@ -50,6 +51,10 @@ export const ROUTE_ITEMS: Array<RouteEntry> = [
5051
routeKey: 'test07Screen',
5152
component: Test07Screen,
5253
},
54+
{
55+
routeKey: 'test08Screen',
56+
component: Test08Screen,
57+
},
5358
{
5459
routeKey: 'contextMenuTest01',
5560
component: ContextMenuViewTest01Screen,

example/src/constants/RouteKeys.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const ROUTE_KEYS = {
99
test05Screen: 'test05Screen',
1010
test06Screen: 'test06Screen',
1111
test07Screen: 'test07Screen',
12+
test08Screen: 'test08Screen',
1213
};
1314

1415
export type RouteKey = keyof (typeof ROUTE_KEYS);

example/src/screens/Test08Screen.tsx

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import * as React from 'react';
2+
import { StyleSheet, Text, View, ScrollView } from 'react-native';
3+
4+
import { ContextMenuView } from 'react-native-ios-context-menu';
5+
6+
// Repro for:
7+
// https://github.com/dominicstop/react-native-ios-context-menu/issues/102#issuecomment-2465444845
8+
9+
function FlickerExample({ children }: { children: React.ReactElement }) {
10+
return (
11+
<ContextMenuView
12+
style={styles.messageContainer}
13+
previewConfig={{
14+
previewType: "CUSTOM",
15+
backgroundColor: 'rgba(0,0,0,0)',
16+
borderRadius: 10,
17+
}}
18+
renderPreview={() =>
19+
<View style={styles.previewContainer}>
20+
{children}
21+
</View>
22+
}
23+
menuConfig={{
24+
menuTitle: "BasicUsageExample01",
25+
menuItems: [
26+
{
27+
actionKey: "key-01",
28+
actionTitle: "Action #1",
29+
},
30+
{
31+
actionKey: "key-02",
32+
actionTitle: "Action #2",
33+
},
34+
{
35+
actionKey: "key-03",
36+
actionTitle: "Action #3",
37+
},
38+
],
39+
}}
40+
>
41+
{children}
42+
</ContextMenuView>
43+
);
44+
}
45+
export const Test08Screen = () => {
46+
return (
47+
<ScrollView
48+
style={styles.rootContainer}
49+
contentContainerStyle={styles.rootContainerContent}
50+
>
51+
<FlickerExample>
52+
<Text style={styles.messageText}>
53+
{'Hello'}
54+
</Text>
55+
</FlickerExample>
56+
</ScrollView>
57+
);
58+
};
59+
60+
const styles = StyleSheet.create({
61+
rootContainer: {
62+
flex: 1,
63+
backgroundColor: 'white',
64+
},
65+
rootContainerContent: {
66+
alignItems: 'flex-end',
67+
justifyContent: 'flex-end',
68+
paddingHorizontal: 12,
69+
paddingTop: 12,
70+
paddingBottom: 24,
71+
},
72+
messageContainer: {
73+
flex: 0,
74+
backgroundColor: 'pink',
75+
borderRadius: 10,
76+
overflow: 'hidden',
77+
paddingHorizontal: 10,
78+
paddingVertical: 10,
79+
marginBottom: 12,
80+
},
81+
previewContainer: {
82+
alignItems: 'center',
83+
justifyContent: 'center',
84+
padding: 32,
85+
},
86+
messageText: {
87+
fontSize: 16,
88+
},
89+
});

0 commit comments

Comments
 (0)