All files / src/components Transfer.tsx

100% Statements 9/9
100% Branches 0/0
100% Functions 1/1
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115                        1x                 1x                                     1x             1x             1x         1x                         1x 2x   2x                                                                              
import React from 'react';
import Modal from '@material-ui/core/Modal';
import Fade from '@material-ui/core/Fade';
import Input from '@material-ui/core/Input';
import { makeStyles } from '@material-ui/core/styles';
import styled from 'styled-components';
 
interface TransferProps {
  handleClose: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
  isOpen: boolean;
}
 
const useStyles = makeStyles({
  wrapper: {
    display: 'flex',
    justifyContent: 'center',
    textAlign: 'center',
    alignItems: 'center',
  },
});
 
const TransferStyled = styled.div`
  display: flex;
 
  flex-direction: row;
 
  outline: none;
  min-width: 35%;
  height: 70%;
  padding-top: 40px;
  background: #006b96;
  box-shadow: 0px 0px 0px 4px #006b96;
  border: 4px solid #ffc400;
  margin: 0 auto;
  border-top-left-radius: 5px;
  border-bottom-right-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3ch;
`;
 
const TransferGiveStyled = styled.div`
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
`;
 
const TransferReceiveStyled = styled.div`
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
`;
 
const TransferTextStyled = styled.div`
  font-size: 30px;
  margin-bottom: 10px;
`;
 
const TransferInputStyled = styled.div`
  width: 250px;
  height: 25px;
  padding: 10px;
  font-size: 24px;
  transition-duration: 0.3s;
  input::placeholder {
    color: black;
    font-weight: bold;
    text-align: center;
  }
`;
 
export const Transfer = ({ handleClose, isOpen }: TransferProps) => {
  const classes = useStyles();
 
  return (
    <div>
      <Modal
        className={classes.wrapper}
        open={isOpen}
        onClose={handleClose}
        aria-labelledby="simple-modal-title"
        aria-describedby="simple-modal-description"
      >
        <Fade in={isOpen}>
          <TransferStyled>
            <TransferGiveStyled>
              <TransferTextStyled>Oddam</TransferTextStyled>
              <TransferInputStyled>
                {' '}
                <Input
                  placeholder="Wyszukaj..."
                  inputProps={{ 'aria-label': 'description' }}
                  className="top-bar__input-field"
                />
              </TransferInputStyled>
            </TransferGiveStyled>
            <TransferReceiveStyled>
              <TransferTextStyled>PrzyjmÄ™</TransferTextStyled>
              <TransferInputStyled>
                {' '}
                <Input
                  placeholder="Wyszukaj..."
                  inputProps={{ 'aria-label': 'description' }}
                  className="top-bar__input-field"
                />
              </TransferInputStyled>
            </TransferReceiveStyled>
          </TransferStyled>
        </Fade>
      </Modal>
    </div>
  );
};