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

Function pickIcon

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

Source from the content-addressed store, hash-verified

71 }
72
73 const pickIcon = async () => {
74 let result = await ImagePicker.launchImageLibraryAsync({
75 mediaTypes: ['images'],
76 allowsEditing: true,
77 quality: 1,
78 aspect: [4, 3]
79 });
80
81 if (!result.canceled) {
82 setPageIcon(result.assets[0].uri);
83 /* setAspectRatio(result.assets[0].width / result.assets[0].height); */
84 setShowEmojiSelector(false);
85
86 const updatedBlock = updateBlockData(blocks[blockId], {
87 format: {
88 page_icon: result.assets[0].uri,
89 ...blocks[blockId]?.format
90 }
91 });
92
93 updateBlock(updatedBlock);
94 }
95 };
96
97 const handleEmojiSelect = (emoji: string) => {
98 setPageIcon(emoji);

Callers 1

PageBlockFunction · 0.85

Calls 2

updateBlockDataFunction · 0.90
updateBlockFunction · 0.85

Tested by

no test coverage detected