-
-
-
-
- {parentName ? (
+
+
+
+ {parentName
+ ? (
<>
-
+
-
{parentName}{suri || ''}
-
-
{displayedName}
+
+ {parentName}{suri || ''}
+
+
+ {displayedName}
>
- ) : (
- {displayedName}
+ )
+ : (
+
+ {displayedName}
+
+ )
+ }
+
+
{formatted || ''}
+ {chain?.genesisHash && (
+
+ {chain.name}
+
)}
-
- {formatted || ''}
- {chain?.genesisHash && {chain.name} }
-
-
-
-
-
- {actions && (
- <>
-
- {showActionsMenu
- ?
- :
- }
-
- {showActionsMenu && (
-
- {actions}
-
- )}
- >
- )}
-
- {children}
+
+
+
+
+
+ {actions && (
+ <>
+
+ {showActionsMenu
+ ?
+ :
+ }
+
+ {showActionsMenu && (
+
+ {actions}
+
+ )}
+ >
+ )}
+ {children}
);
}
-const CopyAddress = styled.div`
- display: flex;
- justify-content: space-between;
-
- & ${Svg} {
- width: 14px;
- height: 14px;
- margin-right: 10px;
- background: ${({ theme }: ThemeProps): string => theme.accountDotsIconColor};
- &:hover {
- background: ${({ theme }: ThemeProps): string => theme.labelColor};
- cursor: pointer;
- }
- }
-`;
-
-const AccountInfoRow = styled.div`
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- align-items: center;
- height: 72px;
- border-radius: 4px;
-`;
-
-const Info = styled.div`
- width: 100%;
-`;
-
-const Name = styled.div`
- overflow: hidden;
- text-overflow: ellipsis;
- width: 300px;
- margin: 2px 0;
- font-weight: 600;
- font-size: 16px;
- line-height: 22px;
-`;
-
-const DisplacedName = styled(Name)`
- padding-top: 10px;
-`;
-
const FullAddress = styled.div`
width: 270px;
overflow: hidden;
@@ -248,47 +224,15 @@ const Settings = styled.div`
Settings.displayName = 'Details';
-const ActionsIcon = styled(Svg).attrs(() => ({
- src: details
-}))`
+const ActionsIcon = styled(Svg).attrs(() => ({ src: details }))`
background: ${({ theme }: ThemeProps): string => theme.accountDotsIconColor};
`;
-const ActiveActionsIcon = styled(Svg).attrs(() => ({
- src: details
-}))`
+const ActiveActionsIcon = styled(Svg).attrs(() => ({ src: details }))`
background: ${({ theme }: ThemeProps): string => theme.primaryColor};
`;
-const Banner = styled.div`
- border-radius: 0 0 8px 8px;
- color: white;
- font-size: 12px;
- line-height: 16px;
- position: absolute;
- top: 0;
-`;
-
-const ChainBanner = styled(Banner)`
- padding: 0.1rem 0.5rem;
- right: 40px;
- background: ${({ theme }: ThemeProps): string => theme.primaryColor};
-`;
-
-const ParentName = styled.div`
- padding: 0.25rem 0 0 0.8rem;
- font-weight: 600;
- font-size: 10px;
- line-height: 14px;
- color: ${({ theme }: ThemeProps): string => theme.labelColor};
- text-overflow: ellipsis;
- overflow: hidden;
- width: 270px;
-`;
-
-const ArrowLabel = styled(Svg).attrs(() => ({
- src: parentArrow
-}))`
+const ArrowLabel = styled(Svg).attrs(() => ({ src: parentArrow }))`
position: absolute;
top: 5px;
width: 9px;
@@ -296,22 +240,51 @@ const ArrowLabel = styled(Svg).attrs(() => ({
background: ${({ theme }: ThemeProps): string => theme.labelColor};
`;
-const MovableMenu = styled(Menu) <{ isMoved: boolean }>`
+const MovableMenu = styled(Menu)<{ isMoved: boolean }>`
${({ isMoved }): string => isMoved ? 'bottom: 50px' : ''};
`;
-export default styled(Address)`
+export default styled(Address)(({ theme }: ThemeProps) => `
position: relative;
margin-bottom: 8px;
- & > div {
- background: ${({ theme }: ThemeProps): string => theme.accountBackground};
- border: 1px solid ${({ theme }: ThemeProps): string => theme.boxBorderColor};
- box-sizing: border-box;
- border-radius: 4px;
+ background: ${theme.accountBackground};
+ border: 1px solid ${theme.boxBorderColor};
+ box-sizing: border-box;
+ border-radius: 4px;
+
+ .banner {
+ border-radius: 0 0 8px 8px;
+ color: white;
+ font-size: 12px;
+ line-height: 16px;
+ position: absolute;
+ top: 0;
+
+ &.chain {
+ background: ${theme.primaryColor};
+ padding: 0.1rem 0.5rem;
+ right: 40px;
+ }
}
- & ${Identicon} {
+ .copyAddress {
+ display: flex;
+ justify-content: space-between;
+
+ & ${Svg} {
+ width: 14px;
+ height: 14px;
+ margin-right: 10px;
+ background: ${theme.accountDotsIconColor};
+ &:hover {
+ background: ${theme.labelColor};
+ cursor: pointer;
+ }
+ }
+ }
+
+ .identityIcon {
margin-left: 25px;
margin-right: 10px;
@@ -320,4 +293,42 @@ export default styled(Address)`
height: 50px;
}
}
-`;
+
+ .info {
+ width: 100%;
+ }
+
+ .infoRow {
+ display: flex;
+ flex-direction: row;
+ justify-content: flex-start;
+ align-items: center;
+ height: 72px;
+ border-radius: 4px;
+ }
+
+ .name {
+ font-size: 16px;
+ font-weight: 600;
+ line-height: 22px;
+ margin: 2px 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ width: 300px;
+
+ &.displaced {
+ padding-top: 10px;
+ }
+ }
+
+ .parentName {
+ color: ${theme.labelColor};
+ font-size: 10px;
+ font-weight: 600;
+ line-height: 14px;
+ overflow: hidden;
+ padding: 0.25rem 0 0 0.8rem;
+ text-overflow: ellipsis;
+ width: 270px;
+ }
+`);
diff --git a/packages/extension-ui/src/components/BackButton.tsx b/packages/extension-ui/src/components/BackButton.tsx
index 22a3e977..436517d0 100644
--- a/packages/extension-ui/src/components/BackButton.tsx
+++ b/packages/extension-ui/src/components/BackButton.tsx
@@ -29,9 +29,7 @@ const SmallButton = styled(Button)`
background: ${({ theme }: ThemeProps): string => theme.backButtonBackground};
`;
-const ArrowLeft = styled(Svg).attrs(() => ({
- src: arrowLeft
-}))`
+const ArrowLeft = styled(Svg).attrs(() => ({ src: arrowLeft }))`
width: 12px;
height: 12px;
display: block;
diff --git a/packages/extension-ui/src/components/Box.tsx b/packages/extension-ui/src/components/Box.tsx
index 03cdc283..0b5f2644 100644
--- a/packages/extension-ui/src/components/Box.tsx
+++ b/packages/extension-ui/src/components/Box.tsx
@@ -22,20 +22,20 @@ function Box ({ banner, children, className }: Props): React.ReactElement
);
}
-export default styled(Box)`
- background: ${({ theme }: ThemeProps): string => theme.readonlyInputBackground};
+export default styled(Box)(({ theme }: ThemeProps) => `
+ background: ${theme.readonlyInputBackground};
border: none;
- border-radius: ${({ theme }: ThemeProps): string => theme.borderRadius};
- color: ${({ theme }: ThemeProps): string => theme.textColor};
- font-family: ${({ theme }: ThemeProps): string => theme.fontFamily};
- font-size: ${({ theme }: ThemeProps): string => theme.fontSize};
- margin: ${({ theme }: ThemeProps): string => theme.boxMargin};
- padding: ${({ theme }: ThemeProps): string => theme.boxPadding};
+ border-radius: ${theme.borderRadius};
+ color: ${theme.textColor};
+ font-family: ${theme.fontFamily};
+ font-size: ${theme.fontSize};
+ margin: ${theme.boxMargin};
+ padding: ${theme.boxPadding};
position: relative;
.banner {
background: darkorange;
- border-radius: 0 ${({ theme }: ThemeProps): string => theme.borderRadius} 0 ${({ theme }: ThemeProps): string => theme.borderRadius};
+ border-radius: 0 ${theme.borderRadius} 0 ${theme.borderRadius};
color: white;
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
@@ -43,4 +43,4 @@ export default styled(Box)`
right: 0;
top: 0;
}
-`;
+`);
diff --git a/packages/extension-ui/src/components/Button.tsx b/packages/extension-ui/src/components/Button.tsx
index 1335dd70..eb829fd9 100644
--- a/packages/extension-ui/src/components/Button.tsx
+++ b/packages/extension-ui/src/components/Button.tsx
@@ -40,20 +40,20 @@ function Button ({ children, className, isDisabled, onClick, to }: Props): React
);
}
-export default styled(Button)`
+export default styled(Button)(({ isDanger, theme }: Props) => `
display: block;
width: 100%;
- height: ${({ isDanger }: Props): string => isDanger ? '40px' : '48px'};
+ height: ${isDanger ? '40px' : '48px'};
box-sizing: border-box;
border: none;
- border-radius: ${({ theme }: Props): string => theme.borderRadius};
- color: ${({ theme }: Props): string => theme.buttonTextColor};
+ border-radius: ${theme.borderRadius};
+ color: ${theme.buttonTextColor};
font-size: 15px;
font-weight: 800;
line-height: 20px;
padding: 0 1rem;
text-align: center;
- background: ${({ isDanger, theme }: Props): string => isDanger ? theme.buttonBackgroundDanger : theme.buttonBackground};
+ background: ${isDanger ? theme.buttonBackgroundDanger : theme.buttonBackground};
cursor: pointer;
&:disabled {
@@ -62,6 +62,6 @@ export default styled(Button)`
}
&:not(:disabled):hover {
- background: ${({ isDanger, theme }: Props): string => isDanger ? theme.buttonBackgroundDangerHover : theme.buttonBackgroundHover};
+ background: ${isDanger ? theme.buttonBackgroundDangerHover : theme.buttonBackgroundHover};
}
-`;
+`);
diff --git a/packages/extension-ui/src/components/ButtonArea.tsx b/packages/extension-ui/src/components/ButtonArea.tsx
index 64291c2f..47a7488a 100644
--- a/packages/extension-ui/src/components/ButtonArea.tsx
+++ b/packages/extension-ui/src/components/ButtonArea.tsx
@@ -7,11 +7,11 @@ import { ThemeProps } from '../types';
import styled from 'styled-components';
import Button from './Button';
-export default styled.div`
+export default styled.div(({ theme }: ThemeProps) => `
display: flex;
flex-direction: row;
- background: ${({ theme }: ThemeProps): string => theme.highlightedAreaBackground};
- border-top: 1px solid ${({ theme }: ThemeProps): string => theme.inputBorderColor};
+ background: ${theme.highlightedAreaBackground};
+ border-top: 1px solid ${theme.inputBorderColor};
padding: 12px 24px;
&&& {
@@ -22,4 +22,4 @@ export default styled.div`
& > ${Button}:not(:last-of-type) {
margin-right: 8px;
}
-`;
+`);
diff --git a/packages/extension-ui/src/components/Checkbox.tsx b/packages/extension-ui/src/components/Checkbox.tsx
index d707b913..d2eb8038 100644
--- a/packages/extension-ui/src/components/Checkbox.tsx
+++ b/packages/extension-ui/src/components/Checkbox.tsx
@@ -31,8 +31,8 @@ function Checkbox ({ checked, className, label, onChange }: Props): React.ReactE
);
}
-export default styled(Checkbox)`
- margin: ${({ theme }: ThemeProps): string => theme.boxMargin};
+export default styled(Checkbox)(({ theme }: ThemeProps) => `
+ margin: ${theme.boxMargin};
label {
display: block;
@@ -41,9 +41,9 @@ export default styled(Checkbox)`
user-select: none;
padding-left: 24px;
padding-top: 1px;
- color: ${({ theme }: ThemeProps): string => theme.subTextColor};
- font-size: ${({ theme }: ThemeProps): string => theme.fontSize};
- line-height: ${({ theme }: ThemeProps): string => theme.lineHeight};
+ color: ${theme.subTextColor};
+ font-size: ${theme.fontSize};
+ line-height: ${theme.lineHeight};
& input {
position: absolute;
@@ -59,10 +59,10 @@ export default styled(Checkbox)`
left: 0;
height: 16px;
width: 16px;
- border-radius: ${({ theme }: ThemeProps): string => theme.borderRadius};
- background-color: ${({ theme }: ThemeProps): string => theme.readonlyInputBackground};
- border: 1px solid ${({ theme }: ThemeProps): string => theme.inputBorderColor};
- border: 1px solid ${({ theme }: ThemeProps): string => theme.inputBorderColor};
+ border-radius: ${theme.borderRadius};
+ background-color: ${theme.readonlyInputBackground};
+ border: 1px solid ${theme.inputBorderColor};
+ border: 1px solid ${theme.inputBorderColor};
&:after {
content: '';
display: none;
@@ -73,16 +73,16 @@ export default styled(Checkbox)`
top: 2px;
mask: url(${Checkmark});
mask-size: cover;
- background: ${({ theme }: ThemeProps): string => theme.primaryColor};
+ background: ${theme.primaryColor};
}
}
&:hover input ~ span {
- background-color: ${({ theme }: ThemeProps): string => theme.inputBackground};
+ background-color: ${theme.inputBackground};
}
input:checked ~ span:after {
display: block;
}
}
-`;
+`);
diff --git a/packages/extension-ui/src/components/Dropdown.tsx b/packages/extension-ui/src/components/Dropdown.tsx
index ebea6bb2..e2aaec75 100644
--- a/packages/extension-ui/src/components/Dropdown.tsx
+++ b/packages/extension-ui/src/components/Dropdown.tsx
@@ -59,23 +59,23 @@ function Dropdown ({ className, defaultValue, isFocussed, label, onBlur, onChang
);
}
-export default styled(Dropdown)`
+export default React.memo(styled(Dropdown)(({ isError, theme }: Props) => `
position: relative;
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
- background: ${({ theme }: Props): string => theme.readonlyInputBackground};
- border-color: ${({ isError, theme }: Props): string => isError ? theme.errorBorderColor : theme.inputBorderColor};
- border-radius: ${({ theme }: ThemeProps): string => theme.borderRadius};
+ background: ${theme.readonlyInputBackground};
+ border-color: ${isError ? theme.errorBorderColor : theme.inputBorderColor};
+ border-radius: ${theme.borderRadius};
border-style: solid;
border-width: 1px;
box-sizing: border-box;
- color: ${({ isError, theme }: Props): string => isError ? theme.errorBorderColor : theme.textColor};
+ color: ${isError ? theme.errorBorderColor : theme.textColor};
display: block;
- font-family: ${({ theme }: Props): string => theme.fontFamily};
- font-size: ${({ theme }: Props): string => theme.fontSize};
+ font-family: ${theme.fontFamily};
+ font-size: ${theme.fontSize};
font-weight: 600;
padding: 0.5rem 0.75rem;
width: 100%;
@@ -98,4 +98,4 @@ export default styled(Dropdown)`
background: url(${arrow}) center no-repeat;
pointer-events: none;
}
-`;
+`));
diff --git a/packages/extension-ui/src/components/Icon.tsx b/packages/extension-ui/src/components/Icon.tsx
index 000714e5..95f19657 100644
--- a/packages/extension-ui/src/components/Icon.tsx
+++ b/packages/extension-ui/src/components/Icon.tsx
@@ -22,13 +22,10 @@ function Icon ({ className = '', icon, onClick }: Props): React.ReactElement `
background: white;
border-radius: 50%;
box-sizing: border-box;
- cursor: ${({ onClick }): string =>
- onClick
- ? 'pointer'
- : 'inherit'};
+ cursor: ${onClick ? 'pointer' : 'inherit'};
text-align: center;
-`;
+`);
diff --git a/packages/extension-ui/src/components/Identicon.tsx b/packages/extension-ui/src/components/Identicon.tsx
index 147832cb..7ef2b8d5 100644
--- a/packages/extension-ui/src/components/Identicon.tsx
+++ b/packages/extension-ui/src/components/Identicon.tsx
@@ -31,13 +31,13 @@ function Identicon ({ className, iconTheme, onCopy, prefix, value }: Props): Rea
);
}
-export default styled(Identicon)`
+export default styled(Identicon)(({ theme }: ThemeProps) => `
display: flex;
justify-content: center;
.container:before {
box-shadow: none;
- background: ${({ theme }: ThemeProps): string => theme.identiconBackground};
+ background: ${theme.identiconBackground};
}
svg {
@@ -45,4 +45,4 @@ export default styled(Identicon)`
display: none;
}
}
-`;
+`);
diff --git a/packages/extension-ui/src/components/Label.tsx b/packages/extension-ui/src/components/Label.tsx
index edf46090..43333f91 100644
--- a/packages/extension-ui/src/components/Label.tsx
+++ b/packages/extension-ui/src/components/Label.tsx
@@ -22,8 +22,8 @@ function Label ({ children, className, label }: Props): React.ReactElement theme.textColor};
+export default styled(Label)(({ theme }: ThemeProps) => `
+ color: ${theme.textColor};
label {
font-size: 10px;
@@ -34,4 +34,4 @@ export default styled(Label)`
margin-bottom: 12px;
text-transform: uppercase;
}
-`;
+`);
diff --git a/packages/extension-ui/src/components/List.tsx b/packages/extension-ui/src/components/List.tsx
index d2f87730..3ca7d271 100644
--- a/packages/extension-ui/src/components/List.tsx
+++ b/packages/extension-ui/src/components/List.tsx
@@ -6,7 +6,7 @@ import { ThemeProps } from '../types';
import styled from 'styled-components';
-export default styled.ul`
+export default styled.ul(({ theme }: ThemeProps) => `
list-style: none;
padding-inline-start: 10px;
padding-inline-end: 10px;
@@ -19,10 +19,10 @@ export default styled.ul`
li::before {
content: '\\2022';
- color: ${({ theme }: ThemeProps): string => theme.primaryColor};
+ color: ${theme.primaryColor};
font-size: 30px;
font-weight: bold;
margin-right: 10px;
vertical-align: -20%;
}
-`;
+`);
diff --git a/packages/extension-ui/src/components/Menu.tsx b/packages/extension-ui/src/components/Menu.tsx
index f11f1234..62e0b76c 100644
--- a/packages/extension-ui/src/components/Menu.tsx
+++ b/packages/extension-ui/src/components/Menu.tsx
@@ -24,15 +24,15 @@ function Menu ({ children, className, reference }: Props): React.ReactElement `
position: absolute;
right: 0;
margin-top: 90px;
padding: 16px 0;
- background: ${({ theme }: ThemeProps): string => theme.popupBackground};
+ background: ${theme.popupBackground};
border-radius: 4px;
- border: 1px solid ${({ theme }: ThemeProps): string => theme.boxBorderColor};
+ border: 1px solid ${theme.boxBorderColor};
box-sizing: border-box;
- box-shadow: 0 0 32px ${({ theme }: ThemeProps): string => theme.boxShadow};
+ box-shadow: 0 0 32px ${theme.boxShadow};
z-index: 1;
-`;
+`);
diff --git a/packages/extension-ui/src/components/MnemonicSeed.tsx b/packages/extension-ui/src/components/MnemonicSeed.tsx
index 8e8f0576..ef0b8a03 100644
--- a/packages/extension-ui/src/components/MnemonicSeed.tsx
+++ b/packages/extension-ui/src/components/MnemonicSeed.tsx
@@ -20,14 +20,14 @@ function MnemonicSeed ({ className, onCopy, seed }: Props): React.ReactElement
-
+
);
}
@@ -47,15 +47,15 @@ const MnemonicText = styled(TextAreaWithLabel).attrs(() => ({
}
`;
-const ButtonsRow = styled.div`
- display: flex;
- flex-direction: row;
-
- ${ActionText} {
- margin-right: 32px;
- }
-`;
-
export default styled(MnemonicSeed)`
margin-top: 21px;
+
+ .buttonsRow {
+ display: flex;
+ flex-direction: row;
+
+ ${ActionText} {
+ margin-right: 32px;
+ }
+ }
`;
diff --git a/packages/extension-ui/src/components/NextStepButton.tsx b/packages/extension-ui/src/components/NextStepButton.tsx
index 8d89db2e..a4e08832 100644
--- a/packages/extension-ui/src/components/NextStepButton.tsx
+++ b/packages/extension-ui/src/components/NextStepButton.tsx
@@ -22,9 +22,7 @@ export default function NextStepButton ({ children, ...props }: Props): React.Re
);
}
-const ArrowRight = styled(Svg).attrs(() => ({
- src: arrowLeft
-}))`
+const ArrowRight = styled(Svg).attrs(() => ({ src: arrowLeft }))`
float: right;
width: 12px;
height: 12px;
diff --git a/packages/extension-ui/src/components/Switch.tsx b/packages/extension-ui/src/components/Switch.tsx
index 8e0f3861..72bd6f54 100644
--- a/packages/extension-ui/src/components/Switch.tsx
+++ b/packages/extension-ui/src/components/Switch.tsx
@@ -25,55 +25,20 @@ function Switch ({ checked, checkedLabel, className, onChange, uncheckedLabel }: