Skip to content

Commit

Permalink
Remove the expansion of the textarea (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarneo authored Oct 1, 2021
1 parent 4eac2b3 commit dff2729
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
7 changes: 1 addition & 6 deletions src/client/components/form/style.module.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
.textarea {
width: 100%;
height: 100px;
height: 200px;
border-radius: var(--border-radius);
background-color: var(--color-background);
border: 1px solid #eee;
margin-bottom: var(--margin-basic);
padding: 10px;
transition: height 0.1s;
}

.compress {
Expand All @@ -17,10 +16,6 @@
border: var(--margin-basic) solid #eee;
}

.isActive {
height: 200px;
}

.select,
.input {
width: 100%;
Expand Down
3 changes: 1 addition & 2 deletions src/client/components/form/textarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import React from 'react';
import cc from 'classcat';
import style from './style.module.css';

const Textarea = ({ compress, thickBorder, isActive, children, ...rest }) => (
const Textarea = ({ compress, thickBorder, children, ...rest }) => (
<textarea
className={cc({
[style.textarea]: true,
[style.compress]: compress,
[style.thick]: thickBorder,
[style.isActive]: isActive,
})}
spellCheck="false"
autoComplete="off"
Expand Down
8 changes: 0 additions & 8 deletions src/client/routes/home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { createSecret, burnSecret } from '../../api/secret';

const Home = () => {
const [text, setText] = useState('');
const [isTextActive, setIsTextActive] = useState(false);
const [file, setFile] = useState('');
const [ttl, setTTL] = useState(14400);
const [password, setPassword] = useState('');
Expand Down Expand Up @@ -50,10 +49,6 @@ const Home = () => {
setText(event.target.value);
};

const onTextareaActive = () => {
setIsTextActive(!isTextActive);
};

const onFileChange = (event) => {
// Support multi upload at a later stage
const [file] = event.target.files;
Expand Down Expand Up @@ -153,9 +148,6 @@ const Home = () => {
value={text}
readOnly={inputReadOnly}
thickBorder={inputReadOnly}
onFocus={onTextareaActive}
onBlur={onTextareaActive}
isActive={isTextActive}
/>

{!isLoggedIn && (
Expand Down

0 comments on commit dff2729

Please sign in to comment.