Skip to content
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

Missing custom component support #54

Open
xxvvii opened this issue May 22, 2018 · 0 comments
Open

Missing custom component support #54

xxvvii opened this issue May 22, 2018 · 0 comments

Comments

@xxvvii
Copy link

xxvvii commented May 22, 2018

In src/Swipeout.tsx:

  renderCustomButton(button) {
    const buttonStyle = button.style || {};
    const bgColor = buttonStyle.backgroundColor || 'transparent';
    const Component = (
      <View
        style={{
          flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: bgColor,
        }}
      >
        {React.isValidElement(button.text) ? button.text : (
          <Text style={[button.style, { textAlign: 'center' }]}>
            {button.text}
          </Text>
        )}
      </View>
    );
    return {
      text: button.text || 'Click',
      onPress: button.onPress,
      type: 'default',
      component: Component,
      backgroundColor: 'transparent',
      color: '#999',
      disabled: false,
    };
  }

button.component is simply ignored but the parameter exists in react-native-swiperout, please add the parameter so we can use custom component like custom icon in swipeout.

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

No branches or pull requests

1 participant