-
Notifications
You must be signed in to change notification settings - Fork 958
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
[feature request] A loading state and animation for buttons #564
Comments
We could do it with ActivityIndicator component, but eva design system rules does not allow to add anything other than string in buttons, as related in this issue #488 |
Hi ✋ |
Hi, This workaround, work for me: I'm use the prop
|
@guilhermelcn good job :) But this will break your build if you'll try do this with TypeScript |
I also have a workaround: const [loading, setLoading] = useState(false);
const toggleLoading = useCallback(() => {
setLoading(!loading);
}, [loading]);
<Button icon={loading ? () => <ActivityIndicator /> : null} onPress={toggleLoading}>
Tap me to hide/show loading indicator
</Button> |
Hi my approach is a custom button based on the original that have an ActivityIndicator passed from props (similar to react native elements approach). Just have a question @artyorsh how can I put a themed color for make it default color (sorry i'm a bit new in react and ui-kitten ^^) color={this.props.loadingProps ? this.props.loadingProps.color : 'white'}
|
@anthowm you can access theme by using withStyles or styled import { withStyles } from '@ui-kitten/components'
const ScreenComponent = (props) => (
<ActivityIndicator style={props.themedStyle.indicator}/>
);
export const Screen = withStyles(ScreenComponent, theme => ({
indicator: { backgroundColor: theme['color-primary-default'] },
})); |
Woop. Soon in v5 😄(sorry for fps) |
@artyorsh Cool I didn't read the v5 roadmap but looks excited 🌊 . thanks for the job 💯 |
Available in v5! 🎉 |
Could be useful to have a laoding state for buttons.
The text was updated successfully, but these errors were encountered: