Photonic devices with two dimensional materials