From 508ffbbb1594f28e47a44151acd75acc6d0ab113 Mon Sep 17 00:00:00 2001 From: Eva Ho Date: Mon, 17 Jul 2023 13:17:52 -0400 Subject: [PATCH] improve the copy command experience --- app/src/app.css | 4 ++ app/src/app.tsx | 147 +++++++++++++++++++++++++----------------------- 2 files changed, 82 insertions(+), 69 deletions(-) diff --git a/app/src/app.css b/app/src/app.css index 6d8c2dbf..c22da2f5 100644 --- a/app/src/app.css +++ b/app/src/app.css @@ -11,6 +11,10 @@ body { -webkit-app-region: drag; } +.no-drag { + -webkit-app-region: no-drag; +} + .blink { -webkit-animation: 1s blink step-end infinite; -moz-animation: 1s blink step-end infinite; diff --git a/app/src/app.tsx b/app/src/app.tsx index c44049c9..c63ed2e2 100644 --- a/app/src/app.tsx +++ b/app/src/app.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import copy from 'copy-to-clipboard' -import { DocumentDuplicateIcon } from '@heroicons/react/24/outline' +import { CheckIcon, DocumentDuplicateIcon } from '@heroicons/react/24/outline' import Store from 'electron-store' import { getCurrentWindow } from '@electron/remote' @@ -17,86 +17,95 @@ enum Step { export default function () { const [step, setStep] = useState(Step.WELCOME) + const [commandCopied, setCommandCopied] = useState(false) const command = 'ollama run orca' return ( -
- {step === Step.WELCOME && ( - <> -
-

Welcome to Ollama

-

- Let's get you up and running with your own large language models. -

- -
-
- -
- - )} - {step === Step.CLI && ( - <> -
-

Install the command line

-
> ollama
-
- -

- You will be prompted for administrator access +

+
+ {step === Step.WELCOME && ( + <> +
+

Welcome to Ollama

+

+ Let's get you up and running with your own large language models.

+
-
- - )} - {step === Step.FINISH && ( - <> -
-

Run your first model

-
-
-
-                  {command}
-                
+
+ +
+ + )} + {step === Step.CLI && ( + <> +
+

Install the command line

+
> ollama
+
+

+ You will be prompted for administrator access +

-

Run this command in your favorite terminal.

- -
- - )} + + )} + {step === Step.FINISH && ( + <> +
+

Run your first model

+
+
+
+                    {command}
+                  
+ +
+

Run this command in your favorite terminal.

+
+ +
+ + )} +
) }