Design layout

This is layout part
I am not sure but for this if/else construction we need to refresh page one additional time. Can you please js here? (it can be done after merge)