deavial / react-native-dialogbox

Dialog boxes for React Native (forked from react-native-popup)
Other
48 stars 21 forks source link

Render Issue: Calling Pop with Multiple Buttons #36

Closed gregberns closed 7 years ago

gregberns commented 7 years ago

It looks like the PopContent component was built to handle more than 2 buttons, but when rendering they do not display well.

I'd like to display 4 options for a user to select from. 'confirm()' allows OK and Cancel, horizontally aligned. I'd like to supply 'pop()' with 3-4 buttons to select from that are vertically stacked on each other.

I have a feeling that the issue is with styling and I'll take a look at what might be screwed up. If you have any thoughts let me know though. screenshot_2017-03-15-11-32-48

handleOnPress = () => {
     this.dialogbox.pop({
          title: 'Title',
          content: 'Content',
          btns: [
               {
                    text: 'OK',
                    callback: () => {
                         this.dialogbox.close();
                         //ok && typeof ok.callback === 'function' && ok.callback();
                    },
               },
               {
                    text: 'Cancel',
                    callback: () => {
                         this.dialogbox.close();
                         //cancel && typeof cancel.callback === 'function' && cancel.callback();
                    },
               },       
               {
                     text: 'Action 3',
                     callback: () => {
                          this.dialogbox.close();
             },
               },
               {
                     text: 'Another Action',
                     callback: () => {
                           this.dialogbox.close();
                     },
               },
           ],
     });
}
deavial commented 7 years ago

This is definitely an issue. I am currently traveling (spring break). I will fix this as soon as I can get setup somewhere.

gregberns commented 7 years ago

Thanks! I just put in RP #37 that helps resolve the issue. Great little project by the way. So glad you put in 'pop()' so I could supply the custom object my self.

deavial commented 7 years ago

I think this new version will work out for you.