Optical beam shifts in graphene and single-layer boron-nitride