If you want Gnats gone, never to return, and to never have that problem again, then bottom water your plants. The water will wick up into the medium and distribute perfectly in your soil, while the top inch of your soil remains bone dry and uninhabitable for Gnats, they will die as will their Larva.
Over watering. Funny how people think Coco can't be over watered, well it can. And especially yours if that's what your using because you have no perlite or or anything in it to given it aeration and prevent it from compacting and depriving the roots of oxygen.. Straight coco will cake if there's a lot of powdery coco in it. Your stuff looks like it came from a expanded brick. That stuff is crap and is full of sodium and Potassium and is generally poorly treated. Especially bricks off Amazon. Always pay the extra to get coco from a reputable source, like Canna or Mother Earth. They sell pre mixed and buffered coco in 50 liter bags. Already mixed with a 30% blend of perlite. and it is buffered with Calcium and the pH is stabilized to an acceptable range.