From c55914216ce5457e02f15f4441781caffaf87e67 Mon Sep 17 00:00:00 2001 From: daniel-schwartz-k Date: Tue, 5 Sep 2023 17:17:09 +0300 Subject: [PATCH 1/2] added notes2 --- Notes.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Notes.md diff --git a/Notes.md b/Notes.md new file mode 100644 index 0000000..86efb1c --- /dev/null +++ b/Notes.md @@ -0,0 +1,15 @@ +# Notes + +## Fix me + +1. When pasting from an OS copy/paste process to the decoded + the cursor jumps to end of text area + if move with keyboard and start typing every key sets cursor to the + input end. + Fixed only with mouse focus + +## Todo + +1. add Encrypted secrets option + each secret can have an additional encryption key + add input for encryption key \ No newline at end of file From d5c1abc048f0f46e468663b221701256d34b36cb Mon Sep 17 00:00:00 2001 From: daniel-schwartz-k Date: Tue, 5 Sep 2023 20:23:23 +0300 Subject: [PATCH 2/2] fix pate bug fro cursor and better starting point --- Notes.md | 9 +++------ src/components/common/textFieldCopy.tsx | 21 +++++++++++++++------ src/components/encoded/encoded.tsx | 2 +- src/components/secret/secret.tsx | 2 +- src/src/state.ts | 2 +- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Notes.md b/Notes.md index 86efb1c..dd05788 100644 --- a/Notes.md +++ b/Notes.md @@ -2,14 +2,11 @@ ## Fix me -1. When pasting from an OS copy/paste process to the decoded - the cursor jumps to end of text area - if move with keyboard and start typing every key sets cursor to the - input end. - Fixed only with mouse focus + ## Todo 1. add Encrypted secrets option each secret can have an additional encryption key - add input for encryption key \ No newline at end of file + add input for encryption key +2. add Verified Invalid text to secret \ No newline at end of file diff --git a/src/components/common/textFieldCopy.tsx b/src/components/common/textFieldCopy.tsx index 39c2096..15762e4 100644 --- a/src/components/common/textFieldCopy.tsx +++ b/src/components/common/textFieldCopy.tsx @@ -9,26 +9,35 @@ export type ITextFieldCopyProps = Omit & { export default function TextFieldCopy(props: ITextFieldCopyProps) { const { value, error, onChange, ariaLabel, ...rest } = props - const [isHovered, setIsHovered] = useState(false) + const [isActive, setIsActive] = useState(false) + + const onFocus = (e: React.FocusEvent) => { + setIsActive(true) + rest.onFocus?.(e) + } + const onBlur = (e: React.FocusEvent) => { + setIsActive(false) + rest.onBlur?.(e) + } return ( onChange(e.target.value)} - onMouseEnter={() => setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} + onFocus={onFocus} + onBlur={onBlur} sx={{ '& textarea.MuiInputBase-inputMultiline': { mr: 5 } }} inputProps={ariaLabel ? { 'aria-label': ariaLabel } : undefined} InputProps={{ - endAdornment: , + endAdornment: , }} /> ) diff --git a/src/components/encoded/encoded.tsx b/src/components/encoded/encoded.tsx index b66b71f..956ff06 100644 --- a/src/components/encoded/encoded.tsx +++ b/src/components/encoded/encoded.tsx @@ -25,7 +25,7 @@ export default function Encoded(props: IEncodedProps) { {'Encoded'} - {'Secret'} + {'Verify Signature'} diff --git a/src/src/state.ts b/src/src/state.ts index 2c6dfb0..41d3c2e 100644 --- a/src/src/state.ts +++ b/src/src/state.ts @@ -31,7 +31,7 @@ export const DefaultState = { name: 'John Doe', iat: 1516239022, }), - secret: 'YOUR SECRET HERE', + secret: 'YOUR-SECRET-HERE', isVerified: false, }