Attempt to automatically select OS tab based on user user-agent

This is a quick fix to attempt to automatically select the user's OS tab
on the pages that requires so which potentially avoids users following
incorrect docs

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
This commit is contained in:
Marcos Lilljedahl
2022-03-23 13:59:39 -03:00
parent 323f01278a
commit b47b51401f
2 changed files with 5 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ You can use a local socket in an action:
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs defaultValue="unix" groupId="client-env">
<Tabs defaultValue={window.navigator.userAgent.indexOf('Win') != -1 ? 'windows': 'unix'} groupId="client-env">
<TabItem value="unix" label="Linux/macOS">