Being gay and being trans are not the same thing.
But if you are a straight man attracted to a trans woman who looks like any other woman, that attraction does not make you gay.
You might not want to date a woman who has a penis (penis repulsion is not uncommon in straight men), but thinking she's hot and wanting to date her just from appearance, not gay. Not if she has breasts, is presenting as a woman, and passes.
Same if you're a straight woman attracted to a trans man.
Part of the problem is the fear that unknowingly being attracted to a "male" makes you gay. And that leads to the trap narrative, and to attacks on trans women. (trans panic).
So while you might not want to date somebody with a penis, it's good to acknowledge that if they are presenting as a woman and you think they're hot, you're still straight.
And it's also good not to judge straight men who DO date and have relationships with trans women.