From cd6c564b5d7a4649cca01bb33d8d180c8a6577d3 Mon Sep 17 00:00:00 2001 From: Anatoli Makarevich Date: Sat, 16 Dec 2023 19:38:46 +0100 Subject: [PATCH] Disable Submit button until API key is set, fix tooltip on mobile --- src/App.tsx | 23 ++++++++++++++++++----- src/components/Navbar.tsx | 6 +++--- src/components/Settings.tsx | 2 +- src/index.css | 6 +++++- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 67af8bc..4d82b2f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -102,10 +102,10 @@ function App() { return true } - return generatingExam || processingSubmission + return generatingExam || processingSubmission || !openAIAPIKey } return ( -
+
{settingsVisible && } {showWelcomePopup && } @@ -138,9 +138,22 @@ function App() { />
- +
+ + + {!openAIAPIKey && ( +
+ {t("set_api_key")} +
+
+ )} +
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 3287312..f458090 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -118,9 +118,9 @@ export default function Navbar() {
)} -
+
{!openAIAPIKey && ( -
+
{t("set_api_key")}
diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index ad0daff..250bd2c 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -78,7 +78,7 @@ export default function Settings() { } return ( -
+
setSettingsVisible(false)} diff --git a/src/index.css b/src/index.css index 1b4f20c..d51ec3a 100644 --- a/src/index.css +++ b/src/index.css @@ -2,6 +2,10 @@ @tailwind components; @tailwind utilities; +*, *::before, *::after { + box-sizing: border-box; +} + body { margin: 0; padding: 0; @@ -85,7 +89,7 @@ a:hover { position: absolute; top: 0; left: 50%; - transform: translateX(-100%) translateY(-100%); + transform: translateX(-4px) translateY(-100%); width: 0; height: 0; }