Leavitt will continue to serve as an outside adviser to President Donald Trump.