15088: Saves account link data in session storage and logs out
[arvados-workbench2.git] / src / views / link-account-panel / link-account-panel.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { RootState } from '~/store/store';
6 import { Dispatch } from 'redux';
7 import { connect } from 'react-redux';
8 import { saveAccountLinkData } from '~/store/link-account-panel/link-account-panel-actions';
9 import { LinkAccountType } from '~/models/link-account';
10 import {
11     LinkAccountPanelRoot,
12     LinkAccountPanelRootDataProps,
13     LinkAccountPanelRootActionProps
14 } from '~/views/link-account-panel/link-account-panel-root';
15
16 const mapStateToProps = (state: RootState): LinkAccountPanelRootDataProps => {
17     return {
18         user: state.auth.user
19     };
20 };
21
22 const mapDispatchToProps = (dispatch: Dispatch): LinkAccountPanelRootActionProps => ({
23     saveAccountLinkData: (type: LinkAccountType) => dispatch<any>(saveAccountLinkData(type))
24 });
25
26 export const LinkAccountPanel = connect(mapStateToProps, mapDispatchToProps)(LinkAccountPanelRoot);