sort data frame according to the order of variables in another data frame

A reproducible example, called a reprex would be a huge help in working through the problem. Some representative data and the code used to get to your desired result would be great.