forked from ukrbublik/react-awesome-query-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.jsx
More file actions
24 lines (19 loc) · 678 Bytes
/
utils.jsx
File metadata and controls
24 lines (19 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import React from "react";
const Col = ({children, ...props}) => (<div {...props}>{children}</div>);
const dummyFn = () => {};
const DragIcon = () => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="gray" width="18px" height="18px">
<path d="M0 0h24v24H0V0z" fill="none"/>
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/>
</svg>
);
const WithConfirmFn = (Cmp) => (
props => {
const {useConfirm} = props.config.settings;
const confirmFn = useConfirm ? useConfirm.call(props.config.ctx, props.config.ctx) : null;
return <Cmp {...props} confirmFn={confirmFn} />;
}
);
export {
Col, dummyFn, DragIcon, WithConfirmFn
};