An application of 4 bar linkage.
Friction in revolute joints must be large enough, otherwise the mechanism will move from open or closed positions due to the gravity. Adding positioning devices is another solution.
Disadvantage: The two panels are not on the same level.