Skip to content

Commit 56bc8d7

Browse files
committed
fix: input- icon component
1 parent 18c6efb commit 56bc8d7

File tree

2 files changed

+5
-667
lines changed

2 files changed

+5
-667
lines changed

example/storybook-nativewind/src/components-example/nativewind/Input/index.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import { createInput } from '@gluestack-ui/input';
3-
import { AsForwarder } from '@gluestack-style/react';
43
import { View, Pressable, TextInput, Platform } from 'react-native';
54
import {
65
tva,
@@ -18,7 +17,7 @@ const UIInput = createInput({
1817
Platform.OS === 'web'
1918
? withStyleContext(View)
2019
: withStyleContextAndStates(View),
21-
Icon: AsForwarder,
20+
Icon: View,
2221
Slot: Pressable,
2322
Input: Platform.OS === 'web' ? TextInput : withStates(TextInput),
2423
});
@@ -48,7 +47,7 @@ const inputStyle = tva({
4847
});
4948

5049
const inputIconStyle = tva({
51-
base: 'stroke-2 stroke-typography-400',
50+
base: 'text-typography-400 fill-none',
5251
parentVariants: {
5352
size: {
5453
'2xs': 'h-3 w-3',
@@ -98,7 +97,7 @@ cssInterop(UIInput.Input, { className: 'style' });
9897

9998
type IInputProps = React.ComponentProps<typeof UIInput> &
10099
VariantProps<typeof inputStyle>;
101-
100+
//@ts-ignore
102101
const Input = React.forwardRef(
103102
(
104103
{
@@ -120,17 +119,11 @@ const Input = React.forwardRef(
120119
}
121120
);
122121

123-
type IInputIconProps = React.ComponentProps<typeof UIInput.Icon> &
124-
VariantProps<typeof inputIconStyle>;
122+
type IInputIconProps = React.ComponentProps<typeof UIInput.Icon> & { as: any };
125123

126124
const InputIcon = React.forwardRef(
127125
(
128-
{
129-
className,
130-
as: AsComp,
131-
fill = 'none',
132-
...props
133-
}: { className?: any } & IInputIconProps,
126+
{ className, as: AsComp, ...props }: { className?: any } & IInputIconProps,
134127
ref
135128
) => {
136129
const { size: parentSize } = useStyleContext();
@@ -140,7 +133,6 @@ const InputIcon = React.forwardRef(
140133
<AsComp
141134
ref={ref}
142135
{...props}
143-
fill={fill}
144136
className={inputIconStyle({
145137
parentVariants: {
146138
size: parentSize,
@@ -154,7 +146,6 @@ const InputIcon = React.forwardRef(
154146
<UIInput.Icon
155147
ref={ref}
156148
{...props}
157-
fill={fill}
158149
className={inputIconStyle({
159150
parentVariants: {
160151
size: parentSize,

0 commit comments

Comments
 (0)