MCPcopy Create free account
hub / github.com/PatoSala/react-native-blocks / pickCover

Function pickCover

packages/blocks/src/PageBlock.tsx:52–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 const placeholder = "New page";
51
52 const pickCover = async () => {
53 let result = await ImagePicker.launchImageLibraryAsync({
54 mediaTypes: ['images'],
55 allowsEditing: false,
56 quality: 1,
57 });
58
59 if (!result.canceled) {
60 setPageCover(result.assets[0].uri);
61
62 const updatedBlock = updateBlockData(blocks[blockId], {
63 format: {
64 page_cover: result.assets[0].uri
65 /* page_cover_position */
66 }
67 });
68
69 updateBlock(updatedBlock);
70 }
71 }
72
73 const pickIcon = async () => {
74 let result = await ImagePicker.launchImageLibraryAsync({

Callers

nothing calls this directly

Calls 2

updateBlockDataFunction · 0.90
updateBlockFunction · 0.85

Tested by

no test coverage detected