Chosen Solution

My iPhone 7 has recently started to somehow keep restarting. It does this when I do a small thing like play something on speaker or change the brightness. It doesn’t matter how low or high the percentage is, it just sometimes randomly does this. I tried reconnecting the battery to the motherboard, decharging it and recharging it with a powerbank and a wall plug, but with no success. It might be that I recently ruined my power cable and it was hard to charge it and it did extremely slowly so it could have just ruined the battery. I might also add that I bought a new battery and replaced it about half a year ago but even at that moment it didn’t hold for more than 5 hours so it seemed weird to me. Another point is that the left side of my iPhone screen has gone out of the frame. It’s together with the display but it has just popped out. While taking a small look at the battery, it didn’t seem to have maybe swallowed up but I might just be mistaken about it. What could be the problem? Could the battery have somehow just gotten ruined or it could be a motherboard problem? EDIT: Made photos of the battery, starts to look like the left side has a small indent which you can barely see in the photos

According to your pictures, it seems like your battery is swollen. This can be dangerous and might explain the random shutdowns. Since you replaced the battery only half a year ago, I’d suggest returning the battery.