Ahsan Allahu Alaikum, in qawaid al fiqhiyyah, niyyah was seperated into three categories, validity, being fulfilled, and ikhlas, so does this mean if someone was showing off in an act of worship, for example salah, is it valid in the sense that the obligation was fulfilled, but he gets no reward?

Ustadh AbdulAziz al-Haqqan
Ibn Rajab al-Hanbali said in Jāmiʿ al-ʿUlūm wa al-Ḥikam (1/82): > "As for when the origin of the deed was for the sake of Allah, then the intention of showing off (riyā’) later came upon it—if it was merely passing by and he pushed it away, then it does not harm him, and there is no disagreement about that. But if he continued with it, then does that invalidate his deed, or does it not harm him and he is rewarded for his initial intention? There is a difference of opinion among the scholars of the salaf on this matter, as narrated by Imām Aḥmad and Ibn Jarīr al-Ṭabarī. Both of them preferred the view that his deed is not nullified by that, and that he is rewarded according to his initial intention. This view is also reported from al-Ḥasan al-Baṣrī and others."