fix(ui) - save funnel from sessions
This commit is contained in:
parent
665e1952c7
commit
235093cf53
1 changed files with 17 additions and 3 deletions
|
|
@ -1,14 +1,24 @@
|
|||
import React, { useState } from 'react';
|
||||
import { IconButton } from 'UI';
|
||||
import FunnelSaveModal from 'App/components/Funnels/FunnelSaveModal';
|
||||
|
||||
export default function SaveFunnelButton() {
|
||||
import { connect } from 'react-redux';
|
||||
import { init } from 'Duck/funnels';
|
||||
interface Props {
|
||||
filter: any
|
||||
init: (instance: any) => void
|
||||
}
|
||||
function SaveFunnelButton(props: Props) {
|
||||
const [showModal, setshowModal] = useState(false)
|
||||
|
||||
const handleClick = () => {
|
||||
props.init({ filter: props.filter })
|
||||
setshowModal(true)
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<IconButton
|
||||
className="mr-2"
|
||||
onClick={() => setshowModal(true)} primaryText label="SAVE FUNNEL" icon="funnel"
|
||||
onClick={handleClick} primaryText label="SAVE FUNNEL" icon="funnel"
|
||||
/>
|
||||
|
||||
<FunnelSaveModal
|
||||
|
|
@ -18,3 +28,7 @@ export default function SaveFunnelButton() {
|
|||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(state => ({
|
||||
filter: state.getIn(['search', 'instance']),
|
||||
}), { init })(SaveFunnelButton);
|
||||
Loading…
Add table
Reference in a new issue