@@ -20,16 +20,30 @@ const koulen = localFont({
2020
2121export default function SendmePage ( ) {
2222 const install = `curl -fsSL https://iroh.computer/sendme.sh | sh`
23+ const install_win = `iwr https://iroh.computer/sendme.ps1 -useb | iex`
2324 const [ copied , setCopied ] = React . useState ( false )
25+ const [ copiedWin , setCopiedWin ] = React . useState ( false )
26+
27+ const _handleCopy = ( ins ) => {
28+ navigator . clipboard . writeText ( ins ) ;
29+ }
2430
2531 const handleCopy = ( ) => {
26- navigator . clipboard . writeText ( install ) ;
32+ _handleCopy ( install ) ;
2733 setCopied ( true ) ;
2834 setTimeout ( ( ) => {
2935 setCopied ( false ) ;
3036 } , 1300 ) ;
3137 }
3238
39+ const handleCopyWin = ( ) => {
40+ _handleCopy ( install_win ) ;
41+ setCopiedWin ( true ) ;
42+ setTimeout ( ( ) => {
43+ setCopiedWin ( false ) ;
44+ } , 1300 ) ;
45+ }
46+
3347 return (
3448 < div className = { clsx ( 'w-full h-full bg-white text-zinc-700' , koulen . variable ) } >
3549 < div className = "pt-10 mx-auto lg:max-w-5xl" >
@@ -50,7 +64,7 @@ export default function SendmePage() {
5064
5165 < div className = 'px-5 py-10 border-b flex-1 md:w-7/12' >
5266 < 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 >
5468 < 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 } >
5569 < div className = 'grow mr-10 font-spaceMono' > $ { install } </ div >
5670 { copied
@@ -60,6 +74,16 @@ export default function SendmePage() {
6074 ? < ClipboardDocumentCheckIcon className = "h-5 w-5 text-zinc-500" />
6175 : < ClipboardDocumentIcon className = "h-5 w-5 text-zinc-500" /> }
6276 </ 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 >
6387 < div className = 'mt-2 text-xs/6 text-gray-500' >
6488 < 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 >
6589 </ div >
0 commit comments