Hello kauthar209.
Thank you for using Apple Support Communities. It sounds like you're experiencing issues with your proximity sensor on your device. We can understand how this would be an issue. Allow us to investigate this issue and assist in any way we can.
There isn't a built-in setting to adjust or disable your proximity sensor. If you're noticing issues with it, you'll want to attempt some troubleshooting steps to see if it helps. First, you'll want to remove any protective cases you might be using and restart your device. If your iPhone has pending updates available, it would be best to create a backup and install those updates. Keeping your device fully updated can help resolve various issues and also help with overall performance. Just in case, the resources below can guide you:
How to back up your iPhone, iPad, and iPod touch - Apple Support
Update your iPhone, iPad, or iPod touch - Apple Support
If these steps don't work and the issue only occurs with WhatsApp, you might want to delete it and reinstall it. This is a great step to try as well:
Delete apps on your iPhone, iPad, and iPod touch - Apple Support
Redownload apps and games from Apple - Apple Support
We hope this information is useful. Cheers.