Skip to content

Commit 56b0791

Browse files
committed
Refactor ModalInput component to use forwardRef in index.tsx
1 parent 89f5090 commit 56b0791

File tree

1 file changed

+8
-4
lines changed
  • src/Components/Inputs/Tiptap/Components/ModalInput

1 file changed

+8
-4
lines changed

src/Components/Inputs/Tiptap/Components/ModalInput/index.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
import { FC, ForwardedRef, forwardRef } from "react";
1+
import { forwardRef } from "react";
22

33
import InputError from "../../../Common/InputError";
44
import Input from "../../../Input";
55
import { IModalInputProps } from "./types";
66

7-
export const ModalInput: FC<IModalInputProps> = forwardRef(
8-
(props, ref: ForwardedRef<HTMLDivElement>) => {
7+
export const ModalInput = forwardRef<HTMLDivElement, IModalInputProps>(
8+
(props, ref) => {
99
const { position, value = "", error, onChange, children } = props;
1010
const { x, y } = position;
1111

1212
return (
13-
<div className='fixed yl-z-50' style={{ left: x, top: y + 10 }} ref={ref}>
13+
<div
14+
className='yl-fixed yl-z-50'
15+
style={{ left: x, top: y + 10 }}
16+
ref={ref}
17+
>
1418
<div className='yl-bg-primary-background-color yl-shadow-md'>
1519
<div className='yl-flex yl-items-center yl-gap-1'>
1620
<Input name='url' type='text' value={value} onChange={onChange} />

0 commit comments

Comments
 (0)