When a user clicks on the login icon from a desktop, I want a modal dialog to appear. However, when using smaller devices like mobile or tablets, I prefer that a reactjs route is triggered to display in the main content area instead of using a modal dialog.
I am unsure of the best way to achieve this. Initially, I considered having two separate actions for touch and click events, but what if an iPad screen size falls somewhere in between and should show a dialog?
Another option I thought about was having two distinct icons and displaying the appropriate one based on media queries, although I am not fond of duplicating code.
Are there any other approaches I could take? I want to avoid introducing size logic into my JavaScript code since everything else currently relies on media queries.