From 5d3e8a4d0c2ce2ad8f22df857ab3ce54fcfc38ac Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 3 Nov 2023 12:22:47 +0100
Subject: refactor(components): replace Toolbar with Navbar component

* remove SearchModal and SettingsModal components
* add a generic NavbarItem component (instead of the previous toolbar
items to avoid unreadable styles...)
* move FlippingLabel component logic into NavbarItem since it is only
used here
---
 src/components/atoms/forms/fields/checkbox/checkbox.tsx | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

(limited to 'src/components/atoms/forms/fields/checkbox/checkbox.tsx')

diff --git a/src/components/atoms/forms/fields/checkbox/checkbox.tsx b/src/components/atoms/forms/fields/checkbox/checkbox.tsx
index 9c175b7..2a8424e 100644
--- a/src/components/atoms/forms/fields/checkbox/checkbox.tsx
+++ b/src/components/atoms/forms/fields/checkbox/checkbox.tsx
@@ -1,14 +1,19 @@
-import type { FC } from 'react';
+import { forwardRef, type ForwardRefRenderFunction } from 'react';
 import { BooleanField, type BooleanFieldProps } from '../boolean-field';
 
 export type CheckboxProps = Omit<BooleanFieldProps, 'type'>;
 
+const CheckboxWithRef: ForwardRefRenderFunction<
+  HTMLInputElement,
+  CheckboxProps
+> = (props, ref) => (
+  // eslint-disable-next-line react/jsx-no-literals -- Type allowed
+  <BooleanField {...props} ref={ref} type="checkbox" />
+);
+
 /**
  * Checkbox component
  *
  * Render a checkbox input type.
  */
-export const Checkbox: FC<CheckboxProps> = (props) => (
-  // eslint-disable-next-line react/jsx-no-literals -- Type allowed
-  <BooleanField {...props} type="checkbox" />
-);
+export const Checkbox = forwardRef(CheckboxWithRef);
-- 
cgit v1.2.3

