@@ -24,7 +24,7 @@ import ConfirmationDialog from "../widgets/ConfirmationDialog";
2424import NotFound from "../widgets/NotFound" ;
2525import { fontFamilies } from "../helpers" ;
2626import { RootStackParamList } from "../RootStackParamList" ;
27- import { canShare , shareItem } from "../import-export" ;
27+ import { canExport , exportItem , canShare , shareItem } from "../import-export" ;
2828
2929type NavigationProp = StackNavigationProp < RootStackParamList , "NoteEdit" > ;
3030
@@ -88,6 +88,7 @@ export default function NoteEditScreen(props: PropsType) {
8888 onEdit = { ( ) => navigation . navigate ( "NoteProps" , { colUid, itemUid } ) }
8989 onDelete = { ( ) => setNoteDeleteDialogShow ( true ) }
9090 onShare = { onShare }
91+ onExport = { ( ) => onShare ( false ) }
9192 changed = { changed }
9293 />
9394 ) ,
@@ -171,13 +172,17 @@ export default function NoteEditScreen(props: PropsType) {
171172 } ) ) ;
172173 }
173174
174- function onShare ( ) {
175+ function onShare ( share = true ) {
175176 ( async ( ) => {
176177 const colMgr = etebase . getCollectionManager ( ) ;
177178 const col = colMgr . cacheLoad ( cacheCollections . get ( colUid ) ! . cache ) ;
178179 const itemMgr = colMgr . getItemManager ( col ) ;
179180 const item = itemMgr . cacheLoad ( cacheItem ! . cache ) ;
180- await shareItem ( item ) ;
181+ if ( share ) {
182+ await shareItem ( item ) ;
183+ } else {
184+ await exportItem ( item ) ;
185+ }
181186 } ) ( ) ;
182187 }
183188
@@ -246,9 +251,10 @@ interface RightActionViewProps {
246251 onSave : ( ) => void ;
247252 onDelete : ( ) => void ;
248253 onShare : ( ) => void ;
254+ onExport : ( ) => void ;
249255}
250256
251- function RightAction ( { viewMode, setViewMode, onSave, onEdit, onDelete, onShare, changed } : RightActionViewProps ) {
257+ function RightAction ( { viewMode, setViewMode, onSave, onEdit, onDelete, onShare, onExport , changed } : RightActionViewProps ) {
252258 const [ showMenu , setShowMenu ] = React . useState ( false ) ;
253259
254260 return (
@@ -290,6 +296,14 @@ function RightAction({ viewMode, setViewMode, onSave, onEdit, onDelete, onShare,
290296 } }
291297 />
292298 ) : null }
299+ { ( canExport ( ) ) ? (
300+ < Menu . Item icon = "export" title = "Export"
301+ onPress = { ( ) => {
302+ setShowMenu ( false ) ;
303+ onExport ( ) ;
304+ } }
305+ />
306+ ) : null }
293307 </ Menu >
294308 </ View >
295309 ) ;
0 commit comments