Barnaby Joyce has announced his resignation as National Party leader and deputy prime minister of Australia after the fallout over his affair with a former staffer and now partner, Vikki Campion, who is pregnant with his child.