mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Combines the following repositories into one: https://github.com/mattermost/mattermost-server https://github.com/mattermost/mattermost-webapp https://github.com/mattermost/focalboard https://github.com/mattermost/mattermost-plugin-playbooks
28 lines
857 B
TypeScript
28 lines
857 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {useDispatch} from 'react-redux';
|
|
|
|
import {openModal} from 'actions/views/modals';
|
|
import {ModalIdentifiers} from 'utils/constants';
|
|
import TrialBenefitsModal, {Props} from 'components/trial_benefits_modal/trial_benefits_modal';
|
|
|
|
interface Options {
|
|
trialJustStarted?: boolean;
|
|
}
|
|
|
|
export default function useOpenTrialBenefitsModal(options: Options) {
|
|
const dispatch = useDispatch();
|
|
const dialogProps: Omit<Props, 'onExited'> = {};
|
|
if (options.trialJustStarted) {
|
|
dialogProps.trialJustStarted = true;
|
|
}
|
|
return () => {
|
|
return dispatch(openModal({
|
|
modalId: ModalIdentifiers.TRIAL_BENEFITS_MODAL,
|
|
dialogType: TrialBenefitsModal,
|
|
dialogProps,
|
|
}));
|
|
};
|
|
}
|