There is definitely an hereditary component to depression
and bipolar disease although this does not mean your child will inherit them. These diseases are multifactorial.
As important is the mental state you are in while raising the child. Make sure you are properly medicated to maintain your optimal mental health and have appropriate counselng.