Give baby depression?

Erica
I've been really stressed out and sad lately because of a breakup, and being led on; told that there is hope for our relationship to become a thing again. 
I'm 28 weeks pregnant, is all this stress and sadness going to affect the baby? It's been about a week and a half now and someone pointed out that I could give the baby depression and anxiety by being sad all the time. I don't really think that's the way it works, but I don't really know, can I give the baby mental illnesses this way?