diff --git a/apps/aelis-client/src/components/ui/button.showcase.tsx b/apps/aelis-client/src/components/ui/button.showcase.tsx
index de21a2f..d4fe563 100644
--- a/apps/aelis-client/src/components/ui/button.showcase.tsx
+++ b/apps/aelis-client/src/components/ui/button.showcase.tsx
@@ -1,4 +1,3 @@
-import Feather from "@expo/vector-icons/Feather"
import { View } from "react-native"
import tw from "twrnc"
@@ -15,22 +14,22 @@ function ButtonShowcase() {
}
+ leadingIcon={}
/>
}
- trailingIcon={}
+ leadingIcon={}
+ trailingIcon={}
/>
diff --git a/apps/aelis-client/src/components/ui/button.tsx b/apps/aelis-client/src/components/ui/button.tsx
index c1f4f15..58f4a68 100644
--- a/apps/aelis-client/src/components/ui/button.tsx
+++ b/apps/aelis-client/src/components/ui/button.tsx
@@ -1,8 +1,19 @@
+import Feather from "@expo/vector-icons/Feather"
import { type PressableProps, Pressable, View } from "react-native"
import tw from "twrnc"
import { SansSerifText } from "./sans-serif-text"
+type FeatherIconName = React.ComponentProps["name"]
+
+type ButtonIconProps = {
+ name: FeatherIconName
+}
+
+function ButtonIcon({ name }: ButtonIconProps) {
+ return
+}
+
type ButtonProps = Omit & {
label: string
leadingIcon?: React.ReactNode
@@ -12,7 +23,7 @@ type ButtonProps = Omit & {
export function Button({ style, label, leadingIcon, trailingIcon, ...props }: ButtonProps) {
const hasIcons = leadingIcon != null || trailingIcon != null
- const textElement = {label}
+ const textElement = {label}
return (
@@ -28,3 +39,5 @@ export function Button({ style, label, leadingIcon, trailingIcon, ...props }: Bu
)
}
+
+Button.Icon = ButtonIcon
diff --git a/apps/aelis-client/src/json-render/registry.tsx b/apps/aelis-client/src/json-render/registry.tsx
index 41a9f98..3cf0778 100644
--- a/apps/aelis-client/src/json-render/registry.tsx
+++ b/apps/aelis-client/src/json-render/registry.tsx
@@ -1,4 +1,3 @@
-import Feather from "@expo/vector-icons/Feather"
import { defineRegistry } from "@json-render/react-native"
import { View } from "react-native"
import tw from "twrnc"
@@ -11,10 +10,7 @@ import { SerifText } from "@/components/ui/serif-text"
import { catalog } from "./catalog"
-function featherIcon(name: string | null | undefined) {
- if (!name) return undefined
- return ["name"]} size={18} color="#e7e5e4" />
-}
+type ButtonIconName = React.ComponentProps["name"]
export const { registry } = defineRegistry(catalog, {
components: {
@@ -22,8 +18,8 @@ export const { registry } = defineRegistry(catalog, {
Button: ({ props, emit }) => (
: undefined}
+ trailingIcon={props.trailingIcon ? : undefined}
onPress={() => emit("press")}
/>
),