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

Footer hidden by React Native Navigation bottom tabs #30

Closed
kevgrig opened this issue May 13, 2020 · 3 comments
Closed

Footer hidden by React Native Navigation bottom tabs #30

kevgrig opened this issue May 13, 2020 · 3 comments

Comments

@kevgrig
Copy link

kevgrig commented May 13, 2020

Hi, thank you very much for this project! However, I have an issue that the footer is hidden if AmazingCropper is within a screen with React Native Navigation bottom tabs.

Here is a standalone reproduction along with a video: on the first screen, there are no bottom tabs and it works fine. Then, click on the arrow in the top right to go to the second screen which has tabs and now the footer is missing. Is there a way to add marginBottom to AmazingCropper or another way to fix this?

Source: https://github.com/kevgrig/amazingcroppertabs/blob/master/App.js
Snack: https://snack.expo.io/@git/github.com/kevgrig/amazingcroppertabs

nofooter

@ggunti
Copy link
Owner

ggunti commented May 15, 2020

@kevgrig
Thanks for reproducing it so accurately. I will check it and I'll try to solve this problem.

@ggunti
Copy link
Owner

ggunti commented Jun 24, 2020

Now, in v0.1.4, you can control the height of the entire component by using the COMPONENT_HEIGHT prop, so if you want to make your bottom tabs visible, you can do something similar to this:

import React, { Component } from 'react';
import { View, Dimensions } from 'react-native';
import AmazingCropper from 'react-native-amazing-cropper';

class AmazingCropperPage extends Component {
  onDone = (croppedImageUri: string): void => {
    console.log('croppedImageUri = ', croppedImageUri);
    // send image to server
  };

  onError = (err: Error) => {
    console.log('Error', err);
  };

  onCancel = (): void => {
    // navigate back
  };

  render() {
    return (
      <>
        <AmazingCropper
          onDone={this.onDone}
          onError={this.onError}
          onCancel={this.onCancel}
          imageUri='https://www.lifeofpix.com/wp-content/uploads/2018/09/manhattan_-11-1600x2396.jpg'
          imageWidth={1600}
          imageHeight={2396}
          NOT_SELECTED_AREA_OPACITY={0.3}
          BORDER_WIDTH={20}
          COMPONENT_HEIGHT={Dimensions.get('window').height - 100}
        />
        <View style={{ backgroundColor: 'red', height: 100 }} />
      </>
    );
  }
}

export default AmazingCropperPage;

The result is that the footer is visible:
Captură de ecran din 2020-06-25 la 00 21 07

@ggunti ggunti closed this as completed Jun 24, 2020
@ggunti ggunti mentioned this issue Jun 24, 2020
@kevgrig
Copy link
Author

kevgrig commented Jun 25, 2020

The fix works. Thank you very much!

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

2 participants