@@ -2,32 +2,36 @@ import React from 'react';
2
2
import Tabs from '@theme/Tabs' ;
3
3
import TabItem from '@theme/TabItem' ;
4
4
import DownloadButton from './DownloadButton' ;
5
+ import BrowserOnly from '@docusaurus/BrowserOnly' ;
5
6
6
7
const windowsPlatforms = [ 'Win32' , 'Win64' , 'Windows' , 'WinCE' ]
7
8
9
+ function defaultOS ( ) { return window ? ( window . navigator . userAgent . indexOf ( "Win" ) != - 1 ? "win" : "mac/linux" ) : "mac/linux" }
10
+
8
11
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 >
33
37
}
0 commit comments