mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
UX: Multichain: Restore Flask support link and text (#19198)
* UX: Multichain: Restore Flask support link and text * Update test
This commit is contained in:
parent
51f6a29461
commit
7d7d09e469
@ -22,6 +22,9 @@ import { Menu, MenuItem } from '../../ui/menu';
|
|||||||
import { getEnvironmentType } from '../../../../app/scripts/lib/util';
|
import { getEnvironmentType } from '../../../../app/scripts/lib/util';
|
||||||
import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../shared/constants/app';
|
import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../shared/constants/app';
|
||||||
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
|
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
|
||||||
|
///: BEGIN:ONLY_INCLUDE_IN(build-beta,build-flask)
|
||||||
|
import { SUPPORT_REQUEST_LINK } from '../../../helpers/constants/common';
|
||||||
|
///: END:ONLY_INCLUDE_IN
|
||||||
|
|
||||||
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
||||||
import {
|
import {
|
||||||
@ -59,6 +62,13 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
|
|||||||
const unreadNotificationsCount = useSelector(getUnreadNotificationsCount);
|
const unreadNotificationsCount = useSelector(getUnreadNotificationsCount);
|
||||||
///: END:ONLY_INCLUDE_IN
|
///: END:ONLY_INCLUDE_IN
|
||||||
|
|
||||||
|
let supportText = t('support');
|
||||||
|
let supportLink = SUPPORT_LINK;
|
||||||
|
///: BEGIN:ONLY_INCLUDE_IN(build-beta,build-flask)
|
||||||
|
supportText = t('needHelpSubmitTicket');
|
||||||
|
supportLink = SUPPORT_REQUEST_LINK;
|
||||||
|
///: END:ONLY_INCLUDE_IN
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Menu anchorElement={anchorElement} onHide={closeMenu}>
|
<Menu anchorElement={anchorElement} onHide={closeMenu}>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
@ -165,13 +175,13 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
|
|||||||
<MenuItem
|
<MenuItem
|
||||||
iconName={IconName.MessageQuestion}
|
iconName={IconName.MessageQuestion}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
global.platform.openTab({ url: SUPPORT_LINK });
|
global.platform.openTab({ url: supportLink });
|
||||||
trackEvent(
|
trackEvent(
|
||||||
{
|
{
|
||||||
category: MetaMetricsEventCategory.Home,
|
category: MetaMetricsEventCategory.Home,
|
||||||
event: MetaMetricsEventName.SupportLinkClicked,
|
event: MetaMetricsEventName.SupportLinkClicked,
|
||||||
properties: {
|
properties: {
|
||||||
url: SUPPORT_LINK,
|
url: supportLink,
|
||||||
location: 'Global Menu',
|
location: 'Global Menu',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -185,7 +195,7 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
|
|||||||
}}
|
}}
|
||||||
data-testid="global-menu-support"
|
data-testid="global-menu-support"
|
||||||
>
|
>
|
||||||
{t('support')}
|
{supportText}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
iconName={IconName.Setting}
|
iconName={IconName.Setting}
|
||||||
|
@ -2,7 +2,6 @@ import React from 'react';
|
|||||||
import { renderWithProvider, fireEvent, waitFor } from '../../../../test/jest';
|
import { renderWithProvider, fireEvent, waitFor } from '../../../../test/jest';
|
||||||
import configureStore from '../../../store/store';
|
import configureStore from '../../../store/store';
|
||||||
import mockState from '../../../../test/data/mock-state.json';
|
import mockState from '../../../../test/data/mock-state.json';
|
||||||
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
|
|
||||||
import { GlobalMenu } from '.';
|
import { GlobalMenu } from '.';
|
||||||
|
|
||||||
const render = () => {
|
const render = () => {
|
||||||
@ -49,9 +48,7 @@ describe('AccountListItem', () => {
|
|||||||
const { getByTestId } = render();
|
const { getByTestId } = render();
|
||||||
fireEvent.click(getByTestId('global-menu-support'));
|
fireEvent.click(getByTestId('global-menu-support'));
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(global.platform.openTab).toHaveBeenCalledWith({
|
expect(global.platform.openTab).toHaveBeenCalled();
|
||||||
url: SUPPORT_LINK,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user