mg-library 1.0.736 → 1.0.737
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.js +12 -2
- package/package.json +1 -1
package/components.js
CHANGED
|
@@ -213,15 +213,25 @@ export function MGButton({
|
|
|
213
213
|
export function MGPopover(props) {
|
|
214
214
|
const { title, icon, language, callback } = props;
|
|
215
215
|
const [open, setOpen] = useState(false);
|
|
216
|
+
|
|
216
217
|
const handleConfirm = async () => {
|
|
217
218
|
try { await callback?.(); } finally { setOpen(false); }
|
|
218
219
|
};
|
|
220
|
+
|
|
219
221
|
return (
|
|
220
222
|
<Popover
|
|
221
223
|
isOpen={open}
|
|
222
|
-
|
|
224
|
+
onClose={() => setOpen(false)}
|
|
223
225
|
trigger={(triggerProps) => (
|
|
224
|
-
<Button
|
|
226
|
+
<Button
|
|
227
|
+
{...triggerProps}
|
|
228
|
+
action="primary"
|
|
229
|
+
variant="solid"
|
|
230
|
+
onPress={(e) => {
|
|
231
|
+
triggerProps?.onPress?.(e);
|
|
232
|
+
setOpen(true);
|
|
233
|
+
}}
|
|
234
|
+
>
|
|
225
235
|
{icon ? <Icon as={MaterialCommunityIcons} name={icon} mr="$2" color="$white" /> : null}
|
|
226
236
|
<ButtonText>{title}</ButtonText>
|
|
227
237
|
</Button>
|