From 4774e8b51fca8bf939a7cdc6a714572f3d2352f2 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Tue, 2 Sep 2025 11:03:38 +0800 Subject: [PATCH 1/3] Fixed children prop use of any --- fwt/components/Column/Column.tsx | 2 +- fwt/components/Footer/Footer.tsx | 2 +- fwt/components/HTML/HTML.tsx | 2 +- fwt/components/Navbar/Navbar.tsx | 2 +- fwt/components/Row/Row.tsx | 6 ++---- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/fwt/components/Column/Column.tsx b/fwt/components/Column/Column.tsx index 9e84a11..3dd4d24 100644 --- a/fwt/components/Column/Column.tsx +++ b/fwt/components/Column/Column.tsx @@ -1,7 +1,7 @@ import './Column.sass' interface Props { - children: any + children: HTMLElement content: 'top' | 'center' | 'right' | 'split' | 'spaced' gap?: number } diff --git a/fwt/components/Footer/Footer.tsx b/fwt/components/Footer/Footer.tsx index ca71e92..658839c 100644 --- a/fwt/components/Footer/Footer.tsx +++ b/fwt/components/Footer/Footer.tsx @@ -1,7 +1,7 @@ import './Footer.sass' interface Props { - children: any + children: HTMLElement } export default (props: Props) => { diff --git a/fwt/components/HTML/HTML.tsx b/fwt/components/HTML/HTML.tsx index b5ead9e..3fd7566 100644 --- a/fwt/components/HTML/HTML.tsx +++ b/fwt/components/HTML/HTML.tsx @@ -4,7 +4,7 @@ interface Props { title: string name: string description: string - children: any + children: HTMLElement font?: string } diff --git a/fwt/components/Navbar/Navbar.tsx b/fwt/components/Navbar/Navbar.tsx index 81f39c4..3b0c688 100644 --- a/fwt/components/Navbar/Navbar.tsx +++ b/fwt/components/Navbar/Navbar.tsx @@ -4,7 +4,7 @@ import Row from '../Row/Row' interface Props { transparent?: boolean - children: any + children: HTMLElement } export default (props: Props) => { diff --git a/fwt/components/Row/Row.tsx b/fwt/components/Row/Row.tsx index f5d1b97..e899e9a 100644 --- a/fwt/components/Row/Row.tsx +++ b/fwt/components/Row/Row.tsx @@ -2,7 +2,7 @@ import './Row.sass' import { Show } from 'solid-js' interface Props { - children: any + children: HTMLElement content: 'left' | 'center' | 'right' | 'split' | 'spaced' | 'even' gap?: number } @@ -17,9 +17,7 @@ export default (props: Props) => { -
- {props.children} -
+
{props.children}
) From 69818aaf6dc8a590df4084f366307cf54b25873d Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Tue, 2 Sep 2025 11:03:51 +0800 Subject: [PATCH 2/3] Added input component --- fwt/components/Input/Input.sass | 3 +++ fwt/components/Input/Input.tsx | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 fwt/components/Input/Input.sass create mode 100644 fwt/components/Input/Input.tsx diff --git a/fwt/components/Input/Input.sass b/fwt/components/Input/Input.sass new file mode 100644 index 0000000..fc8e6cf --- /dev/null +++ b/fwt/components/Input/Input.sass @@ -0,0 +1,3 @@ +.input + font-size: 1rem + padding: 0.5rem 1rem diff --git a/fwt/components/Input/Input.tsx b/fwt/components/Input/Input.tsx new file mode 100644 index 0000000..c0f7c97 --- /dev/null +++ b/fwt/components/Input/Input.tsx @@ -0,0 +1,27 @@ +import './Input.sass' +import { createSignal } from 'solid-js' + +interface Props { + placeholder?: string + value?: string + onChange?: (value: string) => void +} + +export default (props: Props) => { + const [inputValue, setInputValue] = createSignal(props.value || '') + + const handleChange = (event: Event) => { + const target = event.target as HTMLInputElement + const newValue = target.value + setInputValue(newValue) + if (props.onChange) { + props.onChange(newValue) + } + } + + return ( + <> + + + ) +} From 7a9cd4b4bf86d056cbc5ebfadbb2f785848034c8 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Tue, 2 Sep 2025 11:17:55 +0800 Subject: [PATCH 3/3] Changed HTMLElement to JSXElement --- fwt/components/Column/Column.tsx | 3 ++- fwt/components/Footer/Footer.tsx | 3 ++- fwt/components/Row/Row.tsx | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fwt/components/Column/Column.tsx b/fwt/components/Column/Column.tsx index 3dd4d24..27e0e05 100644 --- a/fwt/components/Column/Column.tsx +++ b/fwt/components/Column/Column.tsx @@ -1,7 +1,8 @@ +import type { JSXElement } from 'solid-js' import './Column.sass' interface Props { - children: HTMLElement + children: JSXElement content: 'top' | 'center' | 'right' | 'split' | 'spaced' gap?: number } diff --git a/fwt/components/Footer/Footer.tsx b/fwt/components/Footer/Footer.tsx index 658839c..b5fe510 100644 --- a/fwt/components/Footer/Footer.tsx +++ b/fwt/components/Footer/Footer.tsx @@ -1,7 +1,8 @@ import './Footer.sass' +import type { JSXElement } from 'solid-js' interface Props { - children: HTMLElement + children: JSXElement } export default (props: Props) => { diff --git a/fwt/components/Row/Row.tsx b/fwt/components/Row/Row.tsx index e899e9a..0e3176b 100644 --- a/fwt/components/Row/Row.tsx +++ b/fwt/components/Row/Row.tsx @@ -1,8 +1,8 @@ import './Row.sass' -import { Show } from 'solid-js' +import { Show, type JSXElement } from 'solid-js' interface Props { - children: HTMLElement + children: JSXElement content: 'left' | 'center' | 'right' | 'split' | 'spaced' | 'even' gap?: number }