Chosen Solution

so my grandma gifted me her shattered iphone xr, it turns on but back and front are completely shattered both rear and front cameras don’t function as well as speakers so i was thinking can i buy a locked iphone xr (icloud locked) and just replace the logic board to have it fully functional?

You are taking a pretty high chance of doing this. I usually purchase phones in lots, and I’ve encountered 3 phones that had this issue. 2 were an iPhone X, and 1 was an XS. I tested the models by doing what you said, swapping the motherboard into a good housing. Only 1 of the 3 phones I did it on ended up having sound and camera functionality back. you can attempt this repair, as sometimes you can find a locked XR for cheap, and even if it doesn’t work, you will most likely get all your money back from reselling the locked XR what I’m trying to say is from my experience, there is no guarantee it will work, and if the phone has a bend in it, there’s a pretty high possibility of having a board level issue.