If it helps, I resigned when on maternity with dc1.
I was unsure whether I would return to my teaching job, so I signed up to receive Occupational Maternity Pay, which required a period of service on my return. There will be a form that you have to fill in when you go on maternity leave, which will include a risk assessment and the requirement to submit your MATB1 (and am option to receive OMP).
Your can ask your school to give you a breakdown of your maternity pay (… I didn’t get this with dc1, and I had to seek Union intervention later when they made a mistake; with dc2, my school gave me a maternity breakdown without me asking, which was much more reassuring).
I decided to resign during maternity leave. The way I did it was to return for one day at the end of the summer term, effectively be employed for the summer holiday, and then resign on 31st August. My salary for this period repaid my OMP, and broke the hiatus in NI payments and pension contribution. Some of the summer holiday covered the return service that had been a condition of receiving OMP, which made the repayment a bit smaller.
I hope some of this is helpful. You don’t need to tell anyone of your plans when you go on maternity leave (but there will be a date by when you will have to have resigned).
When I knew that I wasn’t going back, I