Skip to content

Commit

Permalink
Add thick border to readonly textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarneo committed Jun 13, 2021
1 parent 843c77a commit e83607b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,6 @@ dist
# TernJS port file
.tern-port

build/
build/

hemmelig.yaml
4 changes: 4 additions & 0 deletions src/client/components/form/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
height: 75px;
}

.thick {
border: 7px solid #eee;
}

.select,
.input {
width: 100%;
Expand Down
8 changes: 6 additions & 2 deletions src/client/components/form/textarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import { h } from 'preact';
import cc from 'classcat';
import style from './style.css';

const Textarea = ({ compress, children, ...rest }) => (
const Textarea = ({ compress, thickBorder, children, ...rest }) => (
<textarea
class={cc({ [style.textarea]: true, [style.compress]: compress })}
class={cc({
[style.textarea]: true,
[style.compress]: compress,
[style.thick]: thickBorder,
})}
spellcheck="false"
autocomplete="off"
data-gramm_editor="false"
Expand Down
1 change: 1 addition & 0 deletions src/client/routes/home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const Home = () => {
onChange={onChangeHandler}
value={text}
readonly={!!secretId}
thickBorder={!!secretId}
/>

<Select value={ttl} onChange={onSelectChange}>
Expand Down
2 changes: 1 addition & 1 deletion src/client/routes/secret/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const Secret = ({ secretId }) => {
<Info>We will only show the secret once.</Info>

{isSecretOpen && (
<Textarea class={style.textarea} readonly>
<Textarea class={style.textarea} thickBorder={true} readonly>
{secret}
</Textarea>
)}
Expand Down

0 comments on commit e83607b

Please sign in to comment.