Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Try installing this AIDA64 app, it's a utility that just summarizes your phone's hardware and software.
https://play.google.com/store/apps/details?id=com.finalwire.aida64&hl=en_US
Start the app and tap on 'Sensors', and wait a few seconds for it to access thing. There should be a Proximity sensor in the resulting listing. On the phone I'm looking at it only shows two conditions - 100 cm and 3 cm (the former holding the phone out, the latter when I hold my hand close to the approximate sensor location). Your numbers will probably vary.
You mentioned sending your phone back in again to the problem fixed, but could you provide more details as to just what was done as far as, "...they've fitted in a new one..."? Only on some models (very few) different sensors might be modular (therefore more easily replaceable) but for the most part most of them are soldered directly to the circuit boards. With most smartphone models, replacing a failed component is usually a matter of replacing the entire motherboard. With something like the Proximity sensor, it does need to be outward facing exposure and replacing the display typically requires a complete tear-down of the phone so while there is a chance the sensor itself was damaged in the process, it's also more likely to be just a bad alignment issue (the sensor now isn't lining up with the viewing opening internally.)
Or do you have your P30 in a case? Could it just be a matter of the phone has shifted out of place and part of the case is blocking the sensor?
Do you know if your phone was phone repaired at a local shop or was it sent out to the manufacturer?
Apparently only the front and back cameras are replaceable, discrete components, the proximity sensor is not. For an approximate location, it will be located near the top of the phone facing frontward, in the general area close to the front camera module (see steps 17 and 18 in the link below):
https://www.sosav.com/guides/mobiles/huawei/huawei-p30-lite/motherboard/
Presumably since everything else is soldered into the primary motherboard, whatever part they sent you (in those two photos) may or may not even be from a P30 Lite phone. Suspect it isn't. Do you know if your phone was serviced by a local shop or was it sent in to Huawei?