Skip to content

Commit a52e7cf

Browse files
committed
Fix website building
1 parent 31b58b8 commit a52e7cf

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

website/src/components/basicInstall.js

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,36 @@ import React from 'react';
22
import Tabs from '@theme/Tabs';
33
import TabItem from '@theme/TabItem';
44
import DownloadButton from './DownloadButton';
5+
import BrowserOnly from '@docusaurus/BrowserOnly';
56

67
const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE']
78

9+
function defaultOS(){ return window ? (window.navigator.userAgent.indexOf("Win") != -1 ? "win" : "mac/linux") : "mac/linux" }
10+
811
export default function BasicInstall(props){
9-
const defaultOS = window.navigator.userAgent.indexOf("Win") != -1 ? "win" : "mac/linux"
10-
return <div>
11-
<Tabs
12-
groupId="operating-systems"
13-
defaultValue={defaultOS}
14-
values={[
15-
{label: 'Windows', value: 'win'},
16-
{label: 'macOS/Linux', value: 'mac/linux'},
17-
]}>
18-
<TabItem value="win">
19-
<a className="no_monospace" href="https://github.com/Virtuslab/scala-cli/releases/download/nightly/scala-cli-x86_64-pc-win32.msi">
20-
Download Scala CLI for Windows
21-
</a>
22-
</TabItem>
23-
<TabItem value="mac/linux">
24-
<p>Run the following one-line command in your terminal
25-
<br/>
26-
<code> bash
27-
curl -sSLf https://virtuslab.github.io/scala-cli-packages/scala-setup.sh | sh
28-
</code>
29-
</p>
30-
</TabItem>
31-
</Tabs>
32-
</div>
12+
return <BrowserOnly>{() =>
13+
<div>
14+
<Tabs
15+
groupId="operating-systems"
16+
defaultValue={defaultOS()}
17+
values={[
18+
{label: 'Windows', value: 'win'},
19+
{label: 'macOS/Linux', value: 'mac/linux'},
20+
]}>
21+
<TabItem value="win">
22+
<a className="no_monospace" href="https://github.com/Virtuslab/scala-cli/releases/download/nightly/scala-cli-x86_64-pc-win32.msi">
23+
Download Scala CLI for Windows
24+
</a>
25+
</TabItem>
26+
<TabItem value="mac/linux">
27+
<p>Run the following one-line command in your terminal
28+
<br/>
29+
<code> bash
30+
curl -sSLf https://virtuslab.github.io/scala-cli-packages/scala-setup.sh | sh
31+
</code>
32+
</p>
33+
</TabItem>
34+
</Tabs>
35+
</div>
36+
}</BrowserOnly>
3337
}

0 commit comments

Comments
 (0)