Skip to main content

usePopups

import {
Button,
createStyles,
PopupBase,
usePopups,
useStyles,
View,
} from '@lad-tech/mobydick-core';

export const PopupBaseWidget = () => {
const [styles] = useStyles(styleFn);
const {openPopup, closePopup, closeAllPopups} = usePopups();

return (
<View style={styles.container}>
<Button
text={'PopupBase'}
onPress={() =>
openPopup({
Content: props => <PopupBase {...props} />,
})
}
/>
</View>
);
};

const styleFn = createStyles(({spaces}) => ({
container: {
gap: spaces.Space8,
},
}));

Return

popups

TYPE
Array<IPopup>

Array of all popups opened

openPopup

TYPE
(popup: IOpenPopupParams) => string

Function which open popup

closePopup

TYPE
(id: IPopupId) => void

Function which close popup by id

closeAllPopups

TYPE
() => void

Function which close all popup