1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-21 17:37:01 +01:00

[MMI] Fix element UI in MMI (#20176)

* Added support for dark mode in metafox logo and removed unused compliance images

* Fixed text elements with wrong alignment and color

* Changed needHelp in mmi

* Updated code

* Improved code

* Updated copies

* Changed logic to fix code fences issues

* Renamed component
This commit is contained in:
Albert Olivé 2023-07-26 11:51:11 +02:00 committed by GitHub
parent d262acb3a4
commit 9797d9a634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 118 additions and 31 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

View File

@ -1,6 +0,0 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M12.36 6L12.76 8H18V14H14.64L14.24 12H7V6H12.36ZM14 4H5V21H7V14H12.6L13 16H20V6H14.4L14 4Z"
fill="black"
/>
</svg>

Before

Width:  |  Height:  |  Size: 231 B

View File

@ -44,6 +44,7 @@ import {
getTestNetworkBackgroundColor, getTestNetworkBackgroundColor,
///: BEGIN:ONLY_INCLUDE_IN(build-mmi) ///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
getSelectedAddress, getSelectedAddress,
getTheme,
///: END:ONLY_INCLUDE_IN ///: END:ONLY_INCLUDE_IN
} from '../../../selectors'; } from '../../../selectors';
import { GlobalMenu, ProductTour, AccountPicker } from '..'; import { GlobalMenu, ProductTour, AccountPicker } from '..';
@ -79,6 +80,7 @@ export const AppHeader = ({ location }) => {
const custodianIcon = useSelector((state) => const custodianIcon = useSelector((state) =>
getCustodianIconForAddress(state, selectedAddress), getCustodianIconForAddress(state, selectedAddress),
); );
const theme = useSelector((state) => getTheme(state));
///: END:ONLY_INCLUDE_IN ///: END:ONLY_INCLUDE_IN
// Used for account picker // Used for account picker
@ -171,6 +173,7 @@ export const AppHeader = ({ location }) => {
///: BEGIN:ONLY_INCLUDE_IN(build-mmi) ///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
custodyImgSrc={custodianIcon} custodyImgSrc={custodianIcon}
isUnlocked={isUnlocked} isUnlocked={isUnlocked}
theme={theme}
///: END:ONLY_INCLUDE_IN ///: END:ONLY_INCLUDE_IN
/> />
</Box> </Box>

File diff suppressed because one or more lines are too long

View File

@ -16,6 +16,7 @@ export default class MetaFoxLogo extends PureComponent {
///: BEGIN:ONLY_INCLUDE_IN(build-mmi) ///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
custodyImgSrc: PropTypes.string, custodyImgSrc: PropTypes.string,
isUnlocked: PropTypes.bool, isUnlocked: PropTypes.bool,
theme: PropTypes.string,
///: END:ONLY_INCLUDE_IN ///: END:ONLY_INCLUDE_IN
}; };
@ -50,6 +51,7 @@ export default class MetaFoxLogo extends PureComponent {
///: BEGIN:ONLY_INCLUDE_IN(build-mmi) ///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
custodyImgSrc, custodyImgSrc,
isUnlocked, isUnlocked,
theme,
///: END:ONLY_INCLUDE_IN ///: END:ONLY_INCLUDE_IN
} = this.props; } = this.props;
const iconProps = unsetIconHeight ? {} : { height: 42, width: 42 }; const iconProps = unsetIconHeight ? {} : { height: 42, width: 42 };
@ -62,6 +64,9 @@ export default class MetaFoxLogo extends PureComponent {
let renderHorizontalLogo = () => ( let renderHorizontalLogo = () => (
<MetaFoxHorizontalLogo <MetaFoxHorizontalLogo
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
theme={theme}
///: END:ONLY_INCLUDE_IN
className={classnames({ className={classnames({
'app-header__metafox-logo--horizontal': !isOnboarding, 'app-header__metafox-logo--horizontal': !isOnboarding,
'onboarding-app-header__metafox-logo--horizontal': isOnboarding, 'onboarding-app-header__metafox-logo--horizontal': isOnboarding,

View File

@ -81,6 +81,9 @@ import BetaHomeFooter from './beta/beta-home-footer.component';
///: BEGIN:ONLY_INCLUDE_IN(build-flask) ///: BEGIN:ONLY_INCLUDE_IN(build-flask)
import FlaskHomeFooter from './flask/flask-home-footer.component'; import FlaskHomeFooter from './flask/flask-home-footer.component';
///: END:ONLY_INCLUDE_IN ///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
import InstitutionalHomeFooter from './institutional/institutional-home-footer';
///: END:ONLY_INCLUDE_IN
function shouldCloseNotificationPopup({ function shouldCloseNotificationPopup({
isNotification, isNotification,
@ -897,7 +900,7 @@ export default class Home extends PureComponent {
</Tab> </Tab>
</Tabs> </Tabs>
{ {
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-mmi) ///: BEGIN:ONLY_INCLUDE_IN(build-main)
<ButtonLink <ButtonLink
size={Size.MD} size={Size.MD}
startIconName={IconName.MessageQuestion} startIconName={IconName.MessageQuestion}
@ -930,6 +933,13 @@ export default class Home extends PureComponent {
</ButtonLink> </ButtonLink>
///: END:ONLY_INCLUDE_IN ///: END:ONLY_INCLUDE_IN
} }
{
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
<InstitutionalHomeFooter
activitySupportDisplayStyle={activitySupportDisplayStyle}
/>
///: END:ONLY_INCLUDE_IN
}
</Box> </Box>
<div className="home__support"> <div className="home__support">
{ {

View File

@ -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;

View File

@ -50,16 +50,17 @@ export default function InstitutionalEntityDonePage(props) {
marginTop={4} marginTop={4}
marginBottom={4} marginBottom={4}
color={TextColor.textDefault} color={TextColor.textDefault}
textAlign={TextAlign.Left}
> >
{state.title} {state.title}
</Text> </Text>
<Text <Text
as="p" as="p"
color={TextColor.textAlternative} color={TextColor.textDefault}
marginTop={2} marginTop={2}
marginBottom={5} marginBottom={5}
variant={TypographyVariant.headingSm} variant={TypographyVariant.headingSm}
textAlign={TextAlign.Center} textAlign={TextAlign.Left}
> >
{state.description} {state.description}
</Text> </Text>

View File

@ -155,6 +155,12 @@ export default class UnlockPage extends Component {
const { t } = this.context; const { t } = this.context;
const { onRestore } = this.props; 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 ( return (
<div className="unlock-page__container"> <div className="unlock-page__container">
<div className="unlock-page" data-testid="unlock-page"> <div className="unlock-page" data-testid="unlock-page">
@ -222,7 +228,7 @@ export default class UnlockPage extends Component {
); );
}} }}
> >
{t('needHelpLinkText')} {needHelpText}
</a>, </a>,
])} ])}
</div> </div>