feat(ui) - support link
This commit is contained in:
parent
43f669e1f7
commit
507f1acb41
3 changed files with 25 additions and 2 deletions
|
|
@ -16,12 +16,13 @@ import { withStore } from 'App/mstore';
|
|||
|
||||
import APIClient from './api_client';
|
||||
import * as routes from './routes';
|
||||
import { OB_DEFAULT_TAB } from 'App/routes';
|
||||
import { OB_DEFAULT_TAB, isRoute } from 'App/routes';
|
||||
import Signup from './components/Signup/Signup';
|
||||
import { fetchTenants } from 'Duck/user';
|
||||
import { setSessionPath } from 'Duck/sessions';
|
||||
import { ModalProvider } from './components/Modal';
|
||||
import { GLOBAL_DESTINATION_PATH } from 'App/constants/storageKeys';
|
||||
import SupportCallout from 'Shared/SupportCallout';
|
||||
|
||||
const Login = lazy(() => import('Components/Login/Login'));
|
||||
const ForgotPassword = lazy(() => import('Components/ForgotPassword/ForgotPassword'));
|
||||
|
|
@ -103,6 +104,7 @@ const ONBOARDING_REDIRECT_PATH = routes.onboarding(OB_DEFAULT_TAB);
|
|||
tenants: state.getIn(['user', 'tenants']),
|
||||
existingTenant: state.getIn(['user', 'authDetails', 'tenants']),
|
||||
onboarding: state.getIn(['user', 'onboarding']),
|
||||
isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee' || state.getIn(['user', 'authDetails', 'edition']) === 'ee',
|
||||
};
|
||||
},
|
||||
{
|
||||
|
|
@ -171,9 +173,10 @@ class Router extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { isLoggedIn, jwt, siteId, sites, loading, changePassword, location, existingTenant, onboarding } = this.props;
|
||||
const { isLoggedIn, jwt, siteId, sites, loading, changePassword, location, existingTenant, onboarding, isEnterprise } = this.props;
|
||||
const siteIdList = sites.map(({ id }) => id).toJS();
|
||||
const hideHeader = (location.pathname && location.pathname.includes('/session/')) || location.pathname.includes('/assist/');
|
||||
const isPlayer = isRoute(SESSION_PATH, location.pathname);
|
||||
|
||||
return isLoggedIn ? (
|
||||
<ModalProvider>
|
||||
|
|
@ -230,6 +233,7 @@ class Router extends React.Component {
|
|||
</Switch>
|
||||
</Suspense>
|
||||
</Loader>
|
||||
{!isEnterprise && !isPlayer && <SupportCallout /> }
|
||||
</ModalProvider>
|
||||
) : (
|
||||
<Suspense fallback={<Loader loading={true} className="flex-1" />}>
|
||||
|
|
@ -239,6 +243,7 @@ class Router extends React.Component {
|
|||
{!existingTenant && <Route exact strict path={SIGNUP_PATH} component={Signup} />}
|
||||
<Redirect to={LOGIN_PATH} />
|
||||
</Switch>
|
||||
{!isEnterprise && <SupportCallout /> }
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
import React from 'react';
|
||||
import SlackIcon from '../../../svg/integrations/slack.svg';
|
||||
import { Popup } from 'UI';
|
||||
|
||||
function SupportCallout() {
|
||||
return (
|
||||
<Popup content="" delay={0}>
|
||||
<a href="https://slack.openreplay.com" target="_blank">
|
||||
<div className="w-12 h-12 rounded-full bg-white border absolute z-50 cursor-pointer p-2 shadow right-0 bottom-0 m-4 hover:shadow-lg">
|
||||
<img src={SlackIcon} />
|
||||
</div>
|
||||
</a>
|
||||
</Popup>
|
||||
);
|
||||
}
|
||||
|
||||
export default SupportCallout;
|
||||
1
frontend/app/components/shared/SupportCallout/index.ts
Normal file
1
frontend/app/components/shared/SupportCallout/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export { default } from './SupportCallout';
|
||||
Loading…
Add table
Reference in a new issue