Cat Help!

I have a 2 year old cat, who is sometimes quite aggressive for no reason. I’ve had her since she was 8 weeks old & she was my first animal I got on my own! I’m so attached to her, but ever since I’ve known I was pregnant I’m realizing I might have to give her away. She can be really calm at times if you don’t mess with her, but what about when the baby starts crawling or walking or just simply wants to pet her? When my boyfriend comes home from work, sometimes he’ll pick her up & she’ll be fine for a few seconds then she’ll try to hit him across the face with nails & everything! Recently she’s become really territorial of random areas, & if you come within 10 steps she’ll charge you & attack your foot or leg. I love my cat so much, but if she hurts our baby I won’t keep her & my boyfriend has put his foot down about that. She hasn’t been fixed, so we’re getting her fixed soon to see if it helps in any way. I definitely don’t wanna give her away, but I don’t know what else I could do. What would you do if you were in this situation?

Update: Wow ladies I appreciate everyone’s help & advice so so much! This absolutely warms my heart. I’m gonna do everything I can to make sure I don’t have to rehome my kitty, because it is the last thing I wanna do. As a lot of people said, declawing is cruel in my eyes & unnecessary so I won’t be doing that. I truly do wanna thank everyone for your sweet & helpful comments. I’m a first time cat mom, so I didn’t know a lot of this stuff! I could probably update after she’s been fixed which should be in a month of two! Thankyou so much you guys, this really means a lot. ☺️