Chosen Solution

My friend dropped her iphone xr and the phone stopped charging. Everything else kept working until the battery lost its charge. I bought a battery on amazon as well as the charging port. New battery started overheating even before i finished closing up the phone. Put old battery back in to test the charging port but that wouldn’t charge the battery. What could be wrong? Faulty battery? or Logic Board?