mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
add eslint-plugin-prettier
This commit is contained in:
parent
0e4d2bf44d
commit
ba0604ab9d
69 changed files with 419 additions and 249 deletions
|
@ -7,12 +7,13 @@ export const useFormatWrapper = (onChange: (val: string) => void) => {
|
|||
target: HTMLTextAreaElement,
|
||||
|
||||
prefix = '',
|
||||
suffix = ''
|
||||
) => event => {
|
||||
event.preventDefault();
|
||||
wrapTextInsideInput(target, prefix, suffix, onChange);
|
||||
},
|
||||
[onChange]
|
||||
suffix = '',
|
||||
) =>
|
||||
(event) => {
|
||||
event.preventDefault();
|
||||
wrapTextInsideInput(target, prefix, suffix, onChange);
|
||||
},
|
||||
[onChange],
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -21,7 +22,7 @@ export const wrapTextInsideInput = (
|
|||
target: HTMLTextAreaElement,
|
||||
prefix: string,
|
||||
suffix: string,
|
||||
onChange: (val: string) => void
|
||||
onChange: (val: string) => void,
|
||||
) => {
|
||||
if (!target) return;
|
||||
|
||||
|
@ -34,7 +35,7 @@ export const wrapTextInsideInput = (
|
|||
onChange(
|
||||
target.value.substring(0, start) +
|
||||
replacement +
|
||||
target.value.substring(end, target.value.length)
|
||||
target.value.substring(end, target.value.length),
|
||||
);
|
||||
|
||||
target.focus();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue