Unfortunately, it may well have been legal. You may not be fired because you were on maternity leave; however, being on maternity leave does not prevent you from being fired or laid off for unrelated reasons. If the entire senior staff had been replaced, it sounds like the company could show that there was a wider restructuring or layoff that you were fired as part of, unrelated to your pregnancy or leave.