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] Fix element UI in MMI #20176

Merged
merged 9 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions app/build-types/mmi/images/compliance-logo-small.svg

This file was deleted.

Binary file removed app/build-types/mmi/images/compliance-logo.png
Binary file not shown.
6 changes: 0 additions & 6 deletions app/build-types/mmi/images/icons/compliance.svg

This file was deleted.

3 changes: 3 additions & 0 deletions ui/components/multichain/app-header/app-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
getTestNetworkBackgroundColor,
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
getSelectedAddress,
getTheme,
///: END:ONLY_INCLUDE_IN
} from '../../../selectors';
import { GlobalMenu, ProductTour, AccountPicker } from '..';
Expand Down Expand Up @@ -79,6 +80,7 @@ export const AppHeader = ({ location }) => {
const custodianIcon = useSelector((state) =>
getCustodianIconForAddress(state, selectedAddress),
);
const theme = useSelector((state) => getTheme(state));
///: END:ONLY_INCLUDE_IN

// Used for account picker
Expand Down Expand Up @@ -171,6 +173,7 @@ export const AppHeader = ({ location }) => {
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
custodyImgSrc={custodianIcon}
isUnlocked={isUnlocked}
theme={theme}
///: END:ONLY_INCLUDE_IN
/>
</Box>
Expand Down
42 changes: 30 additions & 12 deletions ui/components/ui/metafox-logo/horizontal-logo.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions ui/components/ui/metafox-logo/metafox-logo.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default class MetaFoxLogo extends PureComponent {
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
custodyImgSrc: PropTypes.string,
isUnlocked: PropTypes.bool,
theme: PropTypes.string,
///: END:ONLY_INCLUDE_IN
};

Expand Down Expand Up @@ -50,6 +51,7 @@ export default class MetaFoxLogo extends PureComponent {
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
custodyImgSrc,
isUnlocked,
theme,
///: END:ONLY_INCLUDE_IN
} = this.props;
const iconProps = unsetIconHeight ? {} : { height: 42, width: 42 };
Expand All @@ -62,6 +64,9 @@ export default class MetaFoxLogo extends PureComponent {

let renderHorizontalLogo = () => (
<MetaFoxHorizontalLogo
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
theme={theme}
///: END:ONLY_INCLUDE_IN
className={classnames({
'app-header__metafox-logo--horizontal': !isOnboarding,
'onboarding-app-header__metafox-logo--horizontal': isOnboarding,
Expand Down
12 changes: 11 additions & 1 deletion ui/pages/home/home.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ import BetaHomeFooter from './beta/beta-home-footer.component';
///: BEGIN:ONLY_INCLUDE_IN(build-flask)
import FlaskHomeFooter from './flask/flask-home-footer.component';
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
import InstitutionalHomeFooter from './institutional/institutional-home-footer';
///: END:ONLY_INCLUDE_IN

function shouldCloseNotificationPopup({
isNotification,
Expand Down Expand Up @@ -897,7 +900,7 @@ export default class Home extends PureComponent {
</Tab>
</Tabs>
{
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-mmi)
///: BEGIN:ONLY_INCLUDE_IN(build-main)
<ButtonLink
size={Size.MD}
startIconName={IconName.MessageQuestion}
Expand Down Expand Up @@ -930,6 +933,13 @@ export default class Home extends PureComponent {
</ButtonLink>
///: END:ONLY_INCLUDE_IN
}
{
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
<InstitutionalHomeFooter
activitySupportDisplayStyle={activitySupportDisplayStyle}
/>
///: END:ONLY_INCLUDE_IN
}
</Box>
<div className="home__support">
{
Expand Down
59 changes: 59 additions & 0 deletions ui/pages/home/institutional/institutional-home-footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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.string,
marginBottom: PropTypes.string,
marginTop: PropTypes.string,
}).isRequired,
};

export default InstitutionalHomeFooter;
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ export default function InstitutionalEntityDonePage(props) {
marginTop={4}
marginBottom={4}
color={TextColor.textDefault}
textAlign={TextAlign.Left}
>
{state.title}
</Text>
<Text
as="p"
color={TextColor.textAlternative}
color={TextColor.textDefault}
marginTop={2}
marginBottom={5}
variant={TypographyVariant.headingSm}
textAlign={TextAlign.Center}
textAlign={TextAlign.Left}
>
{state.description}
</Text>
Expand Down
8 changes: 7 additions & 1 deletion ui/pages/unlock-page/unlock-page.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ export default class UnlockPage extends Component {
const { t } = this.context;
const { onRestore } = this.props;

let needHelpText = t('appNameMmi');

///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
needHelpText = t('needHelpLinkText');
///: END:ONLY_INCLUDE_IN

return (
<div className="unlock-page__container">
<div className="unlock-page" data-testid="unlock-page">
Expand Down Expand Up @@ -222,7 +228,7 @@ export default class UnlockPage extends Component {
);
}}
>
{t('needHelpLinkText')}
{needHelpText}
</a>,
])}
</div>
Expand Down
Loading