@@ -20,16 +20,30 @@ const koulen = localFont({
20
20
21
21
export default function SendmePage ( ) {
22
22
const install = `curl -fsSL https://iroh.computer/sendme.sh | sh`
23
+ const install_win = `iwr https://iroh.computer/sendme.ps1 -useb | iex`
23
24
const [ copied , setCopied ] = React . useState ( false )
25
+ const [ copiedWin , setCopiedWin ] = React . useState ( false )
26
+
27
+ const _handleCopy = ( ins ) => {
28
+ navigator . clipboard . writeText ( ins ) ;
29
+ }
24
30
25
31
const handleCopy = ( ) => {
26
- navigator . clipboard . writeText ( install ) ;
32
+ _handleCopy ( install ) ;
27
33
setCopied ( true ) ;
28
34
setTimeout ( ( ) => {
29
35
setCopied ( false ) ;
30
36
} , 1300 ) ;
31
37
}
32
38
39
+ const handleCopyWin = ( ) => {
40
+ _handleCopy ( install_win ) ;
41
+ setCopiedWin ( true ) ;
42
+ setTimeout ( ( ) => {
43
+ setCopiedWin ( false ) ;
44
+ } , 1300 ) ;
45
+ }
46
+
33
47
return (
34
48
< div className = { clsx ( 'w-full h-full bg-white text-zinc-700' , koulen . variable ) } >
35
49
< div className = "pt-10 mx-auto lg:max-w-5xl" >
@@ -50,7 +64,7 @@ export default function SendmePage() {
50
64
51
65
< div className = 'px-5 py-10 border-b flex-1 md:w-7/12' >
52
66
< h3 className = 'text-3xl font-koulen' > Install</ h3 >
53
- < p className = 'mt-1 text-sm/6 text-gray-500' > Add sendme to your machine using shell :</ p >
67
+ < p className = 'mt-1 text-sm/6 text-gray-500' > Add sendme to your machine using bash :</ p >
54
68
< button className = 'text-xs md:text rounded bg-zinc-100 p-2 mt-2 flex plausible-event-name=Sendme+Copy+Install+Script+Click' onClick = { handleCopy } >
55
69
< div className = 'grow mr-10 font-spaceMono' > $ { install } </ div >
56
70
{ copied
@@ -60,6 +74,16 @@ export default function SendmePage() {
60
74
? < ClipboardDocumentCheckIcon className = "h-5 w-5 text-zinc-500" />
61
75
: < ClipboardDocumentIcon className = "h-5 w-5 text-zinc-500" /> }
62
76
</ button >
77
+ < p className = 'mt-1 text-sm/6 text-gray-500' > On windows with PowerShell:</ p >
78
+ < button className = 'text-xs md:text rounded bg-zinc-100 p-2 mt-2 flex plausible-event-name=Sendme+Copy+Install+Script+Click' onClick = { handleCopyWin } >
79
+ < div className = 'grow mr-10 font-spaceMono' > $ { install_win } </ div >
80
+ { copiedWin
81
+ ? < span className = 'w-10 mr-1' > copied!</ span >
82
+ : < span className = 'w-10 mr-1' > </ span > }
83
+ { copiedWin
84
+ ? < ClipboardDocumentCheckIcon className = "h-5 w-5 text-zinc-500" />
85
+ : < ClipboardDocumentIcon className = "h-5 w-5 text-zinc-500" /> }
86
+ </ button >
63
87
< div className = 'mt-2 text-xs/6 text-gray-500' >
64
88
< p > This will copy the sendme binary to the path you ran the script from.< br /> Run it with < pre className = 'font-mono text-sm/6 rounded bg-zinc-100 px-2 py-1 inline' > ./sendme</ pre > on unix systems</ p >
65
89
</ div >
0 commit comments