MCPcopy Create free account
hub / github.com/Lobos/react-ui / removeModal

Function removeModal

src/Modal.js:67–92  ·  view source on GitHub ↗
(topic, id)

Source from the content-addressed store, hash-verified

65 }
66
67 removeModal (topic, id) {
68 let props;
69 if (!id) {
70 props = modals.pop();
71 } else {
72 modals.forEach((m, i) => {
73 if (m.id === id) {
74 props = modals.splice(i, 1);
75 }
76 });
77 }
78
79 if (!props) {
80 return;
81 }
82
83 if (props.onClose) {
84 props.onClose();
85 }
86 this.setState({ modals, increase: false });
87
88 if (modals.length === 0) {
89 document.body.style.height = '';
90 document.body.style.overflow = '';
91 }
92 }
93
94 close () {
95 PubSub.publish(REMOVE_MODAL);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…