1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/pages/home/institutional/institutional-home-footer.js
Albert Olivé 486ade85f3
[MMI] Fixed connect mmi button several issues (#20455)
* fixed connect mmi button several issues

* Fixed snapshot

* Improved multiple things

* running yarn dedupe

* Update LavaMoat policies

* For some reason, this.mmiConfigurationController.store.mmiConfiguration?.portfolio sometimes is undefined, added [] if null.
Moved the || {} outside the find method

* minor improvements

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-08-17 14:50:40 +02:00

60 lines
1.9 KiB
JavaScript

import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
import { useI18nContext } from '../../../hooks/useI18nContext';
import {
MetaMetricsContextProp,
MetaMetricsEventCategory,
MetaMetricsEventName,
} from '../../../../shared/constants/metametrics';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import { ButtonLink, IconName } from '../../../components/component-library';
import { Display, Size } from '../../../helpers/constants/design-system';
const InstitutionalHomeFooter = ({ activitySupportDisplayStyle }) => {
const t = useI18nContext();
const trackEvent = useContext(MetaMetricsContext);
return (
<ButtonLink
size={Size.MD}
startIconName={IconName.MessageQuestion}
data-testid="need-help-link"
href={SUPPORT_LINK}
display={Display.Flex}
justifyContent={activitySupportDisplayStyle.justifyContent}
paddingLeft={activitySupportDisplayStyle.paddingLeft}
marginBottom={activitySupportDisplayStyle.marginBottom}
marginTop={activitySupportDisplayStyle.marginTop}
onClick={() => {
trackEvent(
{
category: MetaMetricsEventCategory.Home,
event: MetaMetricsEventName.SupportLinkClicked,
properties: {
url: SUPPORT_LINK,
},
},
{
contextPropsIntoEventProperties: [MetaMetricsContextProp.PageTitle],
},
);
}}
externalLink
>
{`${t('appNameMmi')} ${t('support').toLowerCase()}`}
</ButtonLink>
);
};
InstitutionalHomeFooter.propTypes = {
activitySupportDisplayStyle: PropTypes.shape({
justifyContent: PropTypes.string.isRequired,
paddingLeft: PropTypes.number,
marginBottom: PropTypes.number,
marginTop: PropTypes.number,
}).isRequired,
};
export default InstitutionalHomeFooter;