-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
71 additions
and
65 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
features/rewards/components/address-input/address-input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { FC } from 'react'; | ||
import { Input, Loader, Identicon } from '@lidofinance/lido-ui'; | ||
import CopyAddressUrl from 'features/rewards/components/CopyAddressUrl'; | ||
import { isValidAnyAddress } from 'features/rewards/utils'; | ||
|
||
import { AddressInputProps } from './types'; | ||
|
||
export const AddressInput: FC<AddressInputProps> = (props) => { | ||
const { | ||
inputValue, | ||
isAddressResolving, | ||
handleInputChange, | ||
address, | ||
addressError, | ||
} = props; | ||
|
||
return ( | ||
<Input | ||
fullwidth | ||
value={inputValue} | ||
onChange={(e) => handleInputChange(e.target.value)} | ||
placeholder="Ethereum address" | ||
leftDecorator={ | ||
isAddressResolving ? ( | ||
<Loader size="small" /> | ||
) : address ? ( | ||
<Identicon data-testid="addressIcon" address={address} /> | ||
) : null | ||
} | ||
rightDecorator={address ? <CopyAddressUrl address={inputValue} /> : null} | ||
spellCheck="false" | ||
error={ | ||
(inputValue.length > 0 && !isValidAnyAddress(inputValue)) || | ||
addressError | ||
} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './address-input'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export type AddressInputProps = { | ||
inputValue: string; | ||
isAddressResolving: boolean; | ||
handleInputChange: (value: string) => void; | ||
address: string; | ||
addressError: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,11 @@ | ||
import styled, { css } from 'styled-components'; | ||
import styled from 'styled-components'; | ||
import { WalletCardStyle } from 'shared/wallet/card/styles'; | ||
import { AddressBadge } from 'shared/wallet/components/address-badge/address-badge'; | ||
|
||
export const WalletStyle = styled(WalletCardStyle)` | ||
background: linear-gradient( | ||
52.01deg, | ||
#37394a 0%, | ||
#363749 0.01%, | ||
#40504f 100% | ||
); | ||
background: linear-gradient(61.64deg, #413e58 17.53%, #30363f 100%); | ||
padding: 0 0 24px 0; | ||
`; | ||
|
||
export const WalletContentStyle = styled.div` | ||
padding: ${({ theme }) => theme.spaceMap.xxl}px; | ||
`; | ||
|
||
export const WalletContentRowStyle = styled.div` | ||
display: flex; | ||
flex-wrap: nowrap; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: space-between; | ||
color: var(--lido-color-text); | ||
`; | ||
|
||
export const WalletContentAddressBadgeStyle = styled(AddressBadge)` | ||
background: #00000033; | ||
cursor: pointer; | ||
`; | ||
|
||
export const ConnectWalletStyle = styled(WalletCardStyle)` | ||
padding: 27px 27px 47px 27px; | ||
text-align: center; | ||
${({ theme }) => | ||
theme.name === 'dark' | ||
? css` | ||
color: var(--lido-color-text); | ||
background: linear-gradient(48.34deg, #46464f -5.55%, #3b3b47 100%); | ||
` | ||
: css` | ||
color: var(--lido-color-secondary); | ||
background: linear-gradient(48.34deg, #d2ddff -5.55%, #e6e6e6 100%); | ||
`} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters