This simple theme component will change share icon on posts and topics from to . On Android will change it to .
Note: If you use copyLink in post_menu than you probably don’t want to use this component as that’s copy post link instantly on desktop so the icon is a great choice for that. Maybe I should restrict this component for mobile or keep the original link icon on desktop if copyLink enabled.
To handle this I’ve added a setting with you can disable the icon change on desktop. It is recommended to enable, if the copyLink is added to the post_menu. copyLink is added by default so this setting is enabled by default. This will keep the default link icon on posts on desktop.
I like idea of that component, but I’m a bit wondering, as an apple mobile user, if it really works because the functionality of OS-icon in OS is different. It more than a just link or copying a link. But perhaps I’m just overthinking and overdramatizing this because I’m bored.
I’ve added a setting to keep the default link icon on desktop if the instant post copy link is active.
On iOS and Android it will change the default link icon because it uses the native share panel. So not instantly copying the post link but open the native share panel.
Overall, it only keeps the link icon by default, if it’s instantly copy the post link. But it can be control with the setting .
I got a deprecation notice for this great theme component in the developer console of the browser:
[THEME 57 ‘Change share icon by OS’] Deprecation notice: Accessing site.mobileView or site.desktopView during the site initialization can lead to errors and inconsistencies when the browser window is resized. Please move these checks to a component, transformer, or API callback that executes during page rendering. [deprecated since Discourse 3.5.0.beta9-dev] [deprecation id: discourse.static-viewport-initialization] [info: Designing for Different Devices (Viewport Size, Touch/Hover, etc.)]