Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MMI] Added code fencing in info tab component #17910

Merged
merged 10 commits into from
Mar 31, 2023
4 changes: 2 additions & 2 deletions ui/helpers/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ _supportRequestLink =

///: BEGIN:ONLY_INCLUDE_IN(mmi)
_supportRequestLink = 'https://mmi-support.zendesk.com/hc/en-us/requests/new';
const _mmiWebSite = 'https://metamask.io/institutions/';
export const MMI_WEB_SITE = _mmiWebSite;
export const SUPPORT_LINK = 'https://mmi-support.zendesk.com/hc/en-us';
export const MMI_WEB_SITE = 'https://metamask.io/institutions/';
///: END:ONLY_INCLUDE_IN

export const SUPPORT_REQUEST_LINK = _supportRequestLink;
Expand Down
64 changes: 53 additions & 11 deletions ui/pages/settings/info-tab/info-tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import PropTypes from 'prop-types';
import Button from '../../../components/ui/button';
import { Tag } from '../../../components/component-library';

import { SUPPORT_REQUEST_LINK } from '../../../helpers/constants/common';
import {
SUPPORT_REQUEST_LINK,
///: BEGIN:ONLY_INCLUDE_IN(mmi)
MMI_WEB_SITE,
///: END:ONLY_INCLUDE_IN
} from '../../../helpers/constants/common';
import { isBeta } from '../../../helpers/utils/build-types';
import {
getNumberOfSettingsInSection,
Expand Down Expand Up @@ -47,6 +52,17 @@ export default class InfoTab extends PureComponent {

renderInfoLinks() {
const { t } = this.context;
let privacyUrl, siteUrl;

///: BEGIN:ONLY_INCLUDE_IN(mmi)
privacyUrl = 'https://consensys.net/codefi/about/privacy-policy/';
siteUrl = MMI_WEB_SITE;
///: END:ONLY_INCLUDE_IN

///: BEGIN:ONLY_INCLUDE_IN(main,beta,flask)
privacyUrl = 'https://metamask.io/privacy.html';
siteUrl = 'https://metamask.io/';
///: END:ONLY_INCLUDE_IN

return (
<div className="settings-page__content-item settings-page__content-item--without-height">
Expand All @@ -56,7 +72,7 @@ export default class InfoTab extends PureComponent {
<div ref={this.settingsRefs[2]} className="info-tab__link-item">
<Button
type="link"
href="https://metamask.io/privacy.html"
href={privacyUrl}
target="_blank"
rel="noopener noreferrer"
className="info-tab__link-text"
Expand Down Expand Up @@ -129,7 +145,7 @@ export default class InfoTab extends PureComponent {
<div ref={this.settingsRefs[6]} className="info-tab__link-item">
<Button
type="link"
href="https://metamask.io/"
href={siteUrl}
target="_blank"
rel="noopener noreferrer"
className="info-tab__link-text"
Expand Down Expand Up @@ -173,6 +189,17 @@ export default class InfoTab extends PureComponent {
<div className="settings-page__body">
<div className="settings-page__content-row">
<div className="settings-page__content-item settings-page__content-item--without-height">
{
///: BEGIN:ONLY_INCLUDE_IN(mmi)
<div className="info-tab__logo-wrapper">
<img
src="images/info-logo.png"
className="info-tab__logo"
alt=""
/>
</div>
///: END:ONLY_INCLUDE_IN
}
<div className="info-tab__item">
<div
ref={this.settingsRefs[0]}
Expand All @@ -185,18 +212,33 @@ export default class InfoTab extends PureComponent {
</div>
</div>
<div className="info-tab__item">
<div className="info-tab__about">{t('builtAroundTheWorld')}</div>
<div className="info-tab__about">
{
///: BEGIN:ONLY_INCLUDE_IN(main,beta,flask)
t('builtAroundTheWorld')
///: END:ONLY_INCLUDE_IN
}
{
///: BEGIN:ONLY_INCLUDE_IN(mmi)
t('mmiBuiltAroundTheWorld')
///: END:ONLY_INCLUDE_IN
}
</div>
</div>
</div>
{this.renderInfoLinks()}
</div>
<div className="info-tab__logo-wrapper">
<img
src="./images/logo/metamask-fox.svg"
className="info-tab__logo"
alt="MetaMask Logo"
/>
</div>
{
///: BEGIN:ONLY_INCLUDE_IN(main,beta,flask)
<div className="info-tab__logo-wrapper">
<img
src="./images/logo/metamask-fox.svg"
className="info-tab__logo"
alt="MetaMask Logo"
/>
</div>
///: END:ONLY_INCLUDE_IN
}
</div>
);
}
Expand Down