I've had a bit of that since my last crash in February. Namely, I'm reluctant to get out on the edge on technical descents.
I did get back on the bike as soon as I could have, about the same time as I stopped popping vicodin, but way before I could ride pain-free, which I think helps with overcoming residual fears. You'll probably have to take some baby steps, and also set up a schedule for rides and force yourself to go out for a while. The joy will come back eventually.