1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Fix Settings Header Back Button and update "Add Contacts" position (#14103)

* Settings: use IconCaretLeft
- fix missing icon and fix icon position

* IconCaretLeft: fix onClick handler

* Settings: fix Add Contacts btn position

* Settings: update back btn paddings
- shrink padding a little because IconCaretLeft adds more width
This commit is contained in:
Ariella Vu 2022-03-23 13:23:48 -03:00 committed by Dan Miller
parent 07bcf1ca0a
commit 73b3881348
4 changed files with 21 additions and 16 deletions

View File

@ -6,6 +6,7 @@ const IconCaretLeft = ({
color = 'currentColor', color = 'currentColor',
ariaLabel, ariaLabel,
className, className,
onClick,
}) => ( }) => (
<svg <svg
width={size} width={size}
@ -13,6 +14,7 @@ const IconCaretLeft = ({
fill={color} fill={color}
className={className} className={className}
aria-label={ariaLabel} aria-label={ariaLabel}
onClick={onClick}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512" viewBox="0 0 512 512"
> >
@ -33,6 +35,10 @@ IconCaretLeft.propTypes = {
* An additional className to assign the Icon * An additional className to assign the Icon
*/ */
className: PropTypes.string, className: PropTypes.string,
/**
* The onClick handler
*/
onClick: PropTypes.func,
/** /**
* The aria-label of the icon for accessibility purposes * The aria-label of the icon for accessibility purposes
*/ */

View File

@ -222,12 +222,12 @@
.address-book-add-button { .address-book-add-button {
&__button { &__button {
position: absolute; position: absolute;
top: 85px; top: 80px;
right: 16px; right: 16px;
width: auto; width: auto;
@media screen and (max-width: $break-small) { @media screen and (max-width: $break-small) {
top: 16px; top: 8px;
right: 60px; right: 60px;
&--hidden { &--hidden {

View File

@ -193,17 +193,11 @@
@media screen and (max-width: $break-small) { @media screen and (max-width: $break-small) {
display: block; display: block;
background-image: url('/images/caret-left-black.svg'); margin-right: 8px;
width: 18px;
height: 18px;
opacity: 0.5;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
margin-right: 16px;
cursor: pointer; cursor: pointer;
[dir='rtl'] & { [dir='rtl'] & {
margin: 0 0 0 8px;
transform: rotate(180deg); transform: rotate(180deg);
} }
} }

View File

@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
import { Switch, Route, matchPath } from 'react-router-dom'; import { Switch, Route, matchPath } from 'react-router-dom';
import classnames from 'classnames'; import classnames from 'classnames';
import TabBar from '../../components/app/tab-bar'; import TabBar from '../../components/app/tab-bar';
import IconCaretLeft from '../../components/ui/icon/icon-caret-left';
import { import {
ALERTS_ROUTE, ALERTS_ROUTE,
ADVANCED_ROUTE, ADVANCED_ROUTE,
@ -112,13 +114,16 @@ class SettingsPage extends PureComponent {
})} })}
> >
<div className="settings-page__header"> <div className="settings-page__header">
<div className="settings-page__header__title-container">
{currentPath !== SETTINGS_ROUTE && ( {currentPath !== SETTINGS_ROUTE && (
<div <IconCaretLeft
className="settings-page__back-button" className="settings-page__back-button"
color="var(--color-icon-default)"
size={32}
onClick={() => history.push(backRoute)} onClick={() => history.push(backRoute)}
/> />
)} )}
<div className="settings-page__header__title-container">
{this.renderTitle()} {this.renderTitle()}
<div <div