Skip to content

Conversation

@Zero6d
Copy link

@Zero6d Zero6d commented Feb 26, 2025

export const Spinner = ficus('ActivityIndicator'); // something wrong with ficus making color return undefined but size still working correctly
// color return undefined can be check in spinner.spec.tsx
export const Spinner2 = (props: SpinnerProps) => {
return <ActivityIndicator {...props} />; // using normal ActivityIndicator instead of ficus until found out why color isnt working
};

@vercel
Copy link

vercel bot commented Feb 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-ficus-ui ❌ Failed (Inspect) Feb 26, 2025 10:56am


export interface SpinnerProps extends NativeFicusProps<'ActivityIndicator'> {}

export const Spinner = ficus('ActivityIndicator'); // something wrong with ficus making color return undefined but size still working correctly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is because ActivityIndicator has a color prop and it conflicts with the color prop from Ficus

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but i think it need to fix inside factory file
since using directly like this below still not work for color but size still work
<ficus.ActivityIndicator color='red' size='large' />;
<ficus.ActivityIndicator color='#000000' size='large' />;
<ficus.ActivityIndicator color='rgba(0,0,0,1)' size='large' />;

Comment on lines 9 to 10
export const Spinner2 = (props: SpinnerProps) => {
return <ActivityIndicator {...props} />; // using normal ActivityIndicator instead of ficus until found out why color isnt working
Copy link
Member

@ntatoud ntatoud Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to export getThemeColor from the style-system and use it here to resolve theme colors.

To improve but to give you an idea:

import {transforms} from '@ficus-ui/style-system'
/** ... */
export const Spinner2 = (props: SpinnerProps) => {
  const { theme } = useTheme();
  const color = transforms.getThemeColor(theme.colors, props.color);
  return <ActivityIndicator {...props} />; // using normal ActivityIndicator instead of ficus until found out why color isnt working

Usage:

<Spinner color="red.500" /> // should work

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesnt work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants