Sliding panel with rotating flap

Hi all.
Sorry for my noobness here but I am just tinkering around with a camper trailer design I want to build and to make it more interactive I want to animate the fixed awning side.
I want part A and part B to slide out of the camper together and then part B rotate upward.
I can get part A to slide.
I can get part B to rotate.
But I can’t get the two parts to stay together. Part B wont stick with part A

Anyone able to … in a really basic way… help me get this please?

I have tried to follow tutorials on sliding doors and cupboards etc.