Skip to content

Commit

Permalink
🆕 Example - Add ContextMenuViewExample26
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Sep 27, 2022
1 parent d68c263 commit a2a5b7a
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
66 changes: 66 additions & 0 deletions example/src/examples/ContextMenuViewExample26.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import * as React from 'react';

import { ContextMenuView } from 'react-native-ios-context-menu';

import type { ContextMenuExampleProps } from './SharedExampleTypes';
import { ContextMenuCard } from '../components/ContextMenuCard';


export function ContextMenuViewExample26(props: ContextMenuExampleProps) {
return (
<ContextMenuView
style={props.style}
menuConfig={{
menuTitle: 'ContextMenuViewExample26',
menuItems: [{
actionKey : 'key-01' ,
actionTitle: 'Action #1',
menuSubtitle: 'Use "IMAGE_REMOTE_URL" icon',
icon: {
type: 'IMAGE_REMOTE_URL',
imageValue: {
url: 'https://picsum.photos/id/1/100'
},
}
}, {
actionKey : 'key-02' ,
actionTitle: 'Action #2',
menuSubtitle: '"IMAGE_REMOTE_URL" + shouldLazyLoad',
icon: {
type: 'IMAGE_REMOTE_URL',
imageValue: {
url: 'https://picsum.photos/id/2/100'
},
imageLoadingConfig: {
shouldLazyLoad: true,
},
}
}, {
actionKey : 'key-03' ,
actionTitle: 'Action #3',
menuSubtitle: '"IMAGE_REMOTE_URL" + shouldLazyLoad + shouldCache',
icon: {
type: 'IMAGE_REMOTE_URL',
imageValue: {
url: 'https://picsum.photos/id/2/100'
},
imageLoadingConfig: {
shouldLazyLoad: true,
shouldCache: true,
},
}
}],
}}
>
<ContextMenuCard
index={props.index}
title={'ContextMenuViewExample26'}
subtitle={'ImageType Icons'}

description={[
`Context menu with actions that uses 'IMAGE_REMOTE_URL' icons`
]}
/>
</ContextMenuView>
);
};
2 changes: 2 additions & 0 deletions example/src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { ContextMenuViewExample22 } from '../examples/ContextMenuViewExample22';
import { ContextMenuViewExample23 } from '../examples/ContextMenuViewExample23';
import { ContextMenuViewExample24 } from '../examples/ContextMenuViewExample24';
import { ContextMenuViewExample25 } from '../examples/ContextMenuViewExample25';
import { ContextMenuViewExample26 } from '../examples/ContextMenuViewExample26';

import { ContextMenuAuxPreviewExample01 } from '../examples/ContextMenuAuxPreviewExample01';
import { ContextMenuAuxPreviewExample02 } from '../examples/ContextMenuAuxPreviewExample02';
Expand Down Expand Up @@ -99,6 +100,7 @@ const EXAMPLE_COMPONENTS = [
ContextMenuViewExample23,
ContextMenuViewExample24,
ContextMenuViewExample25,
ContextMenuViewExample26,
ContextMenuAuxPreviewExample01,
ContextMenuAuxPreviewExample02,
ContextMenuAuxPreviewExample03,
Expand Down

0 comments on commit a2a5b7a

Please sign in to comment.