Skip to content

Commit

Permalink
Merge pull request #2791 from Emurgo/Ahmed/send-page-pt2-updated
Browse files Browse the repository at this point in the history
Wallet send page revamp part 2
  • Loading branch information
vsubhuman committed Jun 21, 2022
2 parents eb55726 + e3e65e0 commit 7a5ad34
Show file tree
Hide file tree
Showing 26 changed files with 1,876 additions and 36 deletions.
34 changes: 34 additions & 0 deletions packages/yoroi-extension/app/assets/images/nft-no.inline.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions packages/yoroi-extension/app/assets/images/plus.inline.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions packages/yoroi-extension/app/assets/images/qr-code.inline.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 19 additions & 1 deletion packages/yoroi-extension/app/components/common/TextField.js
@@ -1,12 +1,13 @@
/* eslint-disable no-nested-ternary */
// @flow
import React from 'react';
import type { ElementRef, Node } from 'react';
import { IconButton, InputAdornment, TextField as TextFieldBase, useTheme } from '@mui/material';
import { ReactComponent as ErrorIcon } from '../../assets/images/forms/error.inline.svg';
import { ReactComponent as DoneIcon } from '../../assets/images/forms/done.inline.svg';
import { ReactComponent as EyeIcon } from '../../assets/images/forms/password-eye-close.inline.svg';
import { ReactComponent as CloseEyeIcon } from '../../assets/images/forms/password-eye.inline.svg';
import React from 'react';
import { ReactComponent as QRLogo } from '../../assets/images/qr-code.inline.svg';

type Props = {|
error?: boolean | string,
Expand All @@ -23,6 +24,7 @@ type Props = {|
inputRef?: ?{| current: null | ElementRef<'input'> |},
revamp?: boolean,
placeholder?: string,
QRHandler?: Function,
|};

function TextField({
Expand All @@ -40,6 +42,7 @@ function TextField({
autoFocus,
revamp,
placeholder,
QRHandler,
...props
}: Props): Node {
const theme = useTheme();
Expand Down Expand Up @@ -90,6 +93,20 @@ function TextField({
{showPassword ? <EyeIcon /> : <CloseEyeIcon />}
</IconButton>
</InputAdornment>
) : QRHandler ? (
<InputAdornment
position="end"
sx={{ minWidth: '52px', display: 'flex', justifyContent: 'flex-end' }}
>
{Boolean(error) === true ? <ErrorIcon /> : done === true ? <DoneIcon /> : null}
<IconButton
aria-label="QR Code Scanner"
onClick={QRHandler}
edge="end"
>
<QRLogo />
</IconButton>
</InputAdornment>
) : (
<InputAdornment position="end">
{Boolean(error) === true ? <ErrorIcon /> : done === true ? <DoneIcon /> : null}
Expand All @@ -116,6 +133,7 @@ TextField.defaultProps = {
autoFocus: false,
revamp: false,
placeholder: undefined,
QRHandler: null,
};

export default TextField;

0 comments on commit 7a5ad34

Please sign in to comment.