All files / src/components/ui/form NoteField.tsx

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

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                                                                                                                                           
import React, { FC } from "react";
import l10n from "shared/lib/lang/l10n";
import styled from "styled-components";
 
const Wrapper = styled.div`
  position: relative;
  width: 100%;
`;
 
const ContentSize = styled.div`
  border: 1px solid transparent;
  box-sizing: border-box;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 11px;
  font-stretch: 100%;
  font-style: normal;
  font-variant-caps: normal;
  font-variant-east-asian: normal;
  font-variant-ligatures: normal;
  font-variant-numeric: normal;
  font-weight: 400;
  letter-spacing: normal;
  line-height: normal;
  overflow-wrap: break-word;
  padding: 10px;
  text-rendering: auto;
  user-select: none;
  white-space: pre-wrap;
  word-spacing: 0px;
  min-height: 48px;
  opacity: 0;
`;
 
export const Textarea = styled.textarea`
  position: absolute;
  top: 0;
  left: 0;
  background-color: #bef0f3;
  border: 1px solid #61bae4;
  border-radius: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
  padding: 10px;
  margin-bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 11px;
  resize: none;
  overflow: hidden;
 
  &:focus {
    box-shadow: 0 0 0px 2px #2686b3 !important;
  }
`;
 
type NoteFieldProps = React.ComponentProps<typeof Textarea>;
 
export const NoteField: FC<NoteFieldProps> = (props) => {
  return (
    <Wrapper>
      <ContentSize>{props.value} </ContentSize>
      <Textarea placeholder={`${l10n("FIELD_NOTES")}...`} {...props} />
    </Wrapper>
  );
};