1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

added nextjs and fixed problems for it

This commit is contained in:
Fedor Katurov 2022-01-07 19:01:27 +07:00
parent 37e0923bb1
commit 58fa40dd5c
10 changed files with 1083 additions and 103 deletions

View file

@ -1,18 +1,18 @@
import { useCallback } from "react";
import { useCallback } from 'react';
/** wraps text inside textarea with tags */
export const useFormatWrapper = (
target: HTMLTextAreaElement,
onChange: (val: string) => void,
prefix = '',
suffix = ''
) => {
export const useFormatWrapper = (onChange: (val: string) => void) => {
return useCallback(
event => {
(
target: HTMLTextAreaElement,
prefix = '',
suffix = ''
) => event => {
event.preventDefault();
wrapTextInsideInput(target, prefix, suffix, onChange);
},
[target, onChange, prefix, suffix]
[onChange]
);
};