Praise be to Allah.
The Muslim should be solemn and submissive during his prayer and he should keep away from everything that may prevent him from being solemn and submissive, because focus is the heart of prayer. Allaah praised the believers when He said (interpretation of the meaning):
“Successful indeed are the believers.
Those who offer their Salaah (prayers) with all solemnity and full submissiveness”
Undoubtedly one of the things that keep a person from being solemn and submissive is smiling during prayer.
With regard to the ruling on smiling during prayer, it does not invalidate the prayer. See al-Mawsoo’ah al-Fiqhiyyah, part 27, p. 124.
Ibn Qudaamah said: Ibn al-Mundhir said: They were unanimously agreed that laughing invalidates prayer, and most of the scholars said that smiling does not invalidate prayer. Al-Mughni, part 1, p. 394
Shaykh al-Islam Ibn Taymiyah said: as for smiling, it does not invalidate prayer, but if one giggles in prayer then that invalidates it. Al-Fataawa al-Kubra, part 2, p. 227
Al-Nawawi said: our view is that smiling in prayer does not affect it. Al-Majmoo’, part 4, p. 22
Al-Bahooti said: It does not invalidate the prayer if one smiles whilst praying. This is the view of the majority narrated by Ibn al-Mundhir. Kashshaaf al-Qinaa’, part 1, p. 402
Since it does not invalidate the prayer, then you should complete the prayer and not stop praying. But you should avoid things that may make you do that. See the book 33 Means of Developing Khushoo’ in prayer, on this web site. And Allaah knows best.