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:
parent
37e0923bb1
commit
58fa40dd5c
10 changed files with 1083 additions and 103 deletions
|
@ -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]
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue