mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01: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:
parent
7be1cfe9e4
commit
28bcde5191
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -210,12 +210,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 {
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ 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,
|
||||||
@ -113,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
|
||||||
|
Loading…
Reference in New Issue
Block a user