Weight gain

Y’all I’m struggling mentally with this weight gain. I had lost almost 50 lbs in the years leading up to getting pregnant. So far I’ve gained back 17. I’m 22 weeks. I’m scared I’m going to gain back everything I lost. I hate that so much of my self worth is based on that number. I’ve tried to slow the gain down by tracking on weight watchers, but I’m ravenous sometimes. Any tips to get these negative thoughts out of my head?