I dont think you should upgrade or even sidegrade at this point. Save your money. Let your machine die out on its own and replace as needed. There isn’t much value in changing from Ryzen 3 1300x to Ryzen 5 3400g at this time (unless you are getting these components for free). Hopefully by the time your PC breaks, you have more than enough to get a better performing card for your monitor.
I would like to comment that your monitor is mismatched with your graphics card. you are probably not maximizing the use of that high refresh rate monitor in your demanding games unless you are cranking it to low detail.
Also take note: miniaturizing computers are potentially expensive - you really cant make a pc small and performant without racking up price. My suggestion instead of miniaturization: Wall-mount! It may be potentially ugly but It is cheap and cool vs forcing components in a small cramped space. The vertical spaces in households are oftentimes underutilized.
I just bought a Silverstone GD08 Case off a site here for $50AUD I gotta say what a fantastic case, I’m modding it tonight to fit a 240mm AIO and I figured out a way to install 4X 3.5" drives and 2x SSD’s. I’m putting this underneath my Monitor as well.
Going to cut that out with a dremel and the radiator will sit outside the case with the fans inside, going to use two Silverstone dust filters that came with the case with 3x intake fans under the drives and 2x 80mm exhaust fans at the rear.