It is narrated from Hazrat Jundub (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) said: Whoever does any deed to gain fame, Allah will leave him to that, and whoever does any deed for show (ostentation), Allah will leave him to that.
Hadith Referenceمسند احمد / تتمہ مُسْنَدِ الْكُوفِيِّينَ / 18808