-
Notifications
You must be signed in to change notification settings - Fork 4
Test/v2 spinner #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test/v2 spinner #78
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
|
||
| export interface SpinnerProps extends NativeFicusProps<'ActivityIndicator'> {} | ||
|
|
||
| export const Spinner = ficus('ActivityIndicator'); // something wrong with ficus making color return undefined but size still working correctly |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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' />;
| export const Spinner2 = (props: SpinnerProps) => { | ||
| return <ActivityIndicator {...props} />; // using normal ActivityIndicator instead of ficus until found out why color isnt working |
There was a problem hiding this comment.
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 workingUsage:
<Spinner color="red.500" /> // should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesnt work
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
};