Skip to content

Commit

Permalink
fix: add use clinet to form provider (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
r1skz3ro authored Jul 16, 2024
1 parent 489a847 commit d4b63cd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/common/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { InputProps } from './Input.interface';
import { useFormContext } from 'react-hook-form';
import { generateClassNames } from '@app/utils';
import { ErrorMessage } from '@hookform/error-message';
import { CheckMarkIcon } from '@app/static/icons/AlertTriangleIcon';
import { AlertTriangleIcon } from '@app/static/icons/AlertTriangleIcon';

export const Input: FC<InputProps> = memo(({ label, name, placeholder, options = {}, ...otherProps }) => {
const { formState, register, getFieldState } = useFormContext();
Expand Down Expand Up @@ -31,7 +31,7 @@ export const Input: FC<InputProps> = memo(({ label, name, placeholder, options =
name={name}
render={({ message }) => (
<div className="flex items-center gap-x-2">
<CheckMarkIcon />
<AlertTriangleIcon />
<div className="text-sm text-red-600 first-letter:uppercase">{message}</div>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import { FC, PropsWithChildren } from 'react';
import { useForm } from 'react-hook-form';

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/static/icons/AlertTriangleIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const CheckMarkIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
export const AlertTriangleIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path
fillRule="evenodd"
Expand Down

0 comments on commit d4b63cd

Please sign in to comment.