From 7daf9bd8094bc26caa0ecb9a3329c433c6f50248 Mon Sep 17 00:00:00 2001 From: jonphurcombe Date: Thu, 3 Oct 2024 09:13:29 +0100 Subject: [PATCH 1/2] added button --- .../validator/TextArea/CodeMirrorTextArea.tsx | 2 +- .../components/validator/validator.tsx | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ags-validator-app/components/validator/TextArea/CodeMirrorTextArea.tsx b/ags-validator-app/components/validator/TextArea/CodeMirrorTextArea.tsx index e7264f9..fbd3863 100644 --- a/ags-validator-app/components/validator/TextArea/CodeMirrorTextArea.tsx +++ b/ags-validator-app/components/validator/TextArea/CodeMirrorTextArea.tsx @@ -81,7 +81,7 @@ const CodeMirrorTextArea: React.FC = ({ }), [errorLines, hoverLineNumber] ); - + // console.log(agsData) return (
{ + if (!agsData) return; + + const blob = new Blob([agsData], { type: "text/plain;charset=utf-8" }); + const link = document.createElement("a"); + link.href = URL.createObjectURL(blob); + link.download = "exported.ags"; // Filename for the download + link.click(); + }; + return (
@@ -60,6 +73,8 @@ export default function Validator() {
+ + {tabsViewValue === "tables" && parsedAgs !== undefined && ( Date: Thu, 3 Oct 2024 09:44:37 +0100 Subject: [PATCH 2/2] added button export to .ags and added hover --- ags-validator-app/app/globals.css | 2 ++ ags-validator-app/components/ui/button.tsx | 3 ++- ags-validator-app/components/validator/validator.tsx | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ags-validator-app/app/globals.css b/ags-validator-app/app/globals.css index 23d533f..947350c 100644 --- a/ags-validator-app/app/globals.css +++ b/ags-validator-app/app/globals.css @@ -11,6 +11,7 @@ --popover: #ffffff; /* White */ --popover-foreground: #302003; /* Darker text color */ --primary: #376409; /* Dark green */ + --primary-hover: #4b7813; --primary-foreground: #ffffff; /* White */ --secondary: #b08a57; /* Light brown */ --secondary-foreground: #302003; /* Darker text color */ @@ -36,6 +37,7 @@ --popover: #302003; /* Dark brown */ --popover-foreground: #f5f3e7; /* Lighter text color for dark mode */ --primary: #85a86f; /* Slightly lighter primary color for dark mode */ + --primary-hover: #688a4d; --primary-foreground: #302003; /* Dark brown */ --secondary: #5a7a37; /* Slightly lighter secondary color for dark mode */ --secondary-foreground: #f5f3e7; /* Lighter text color for dark mode */ diff --git a/ags-validator-app/components/ui/button.tsx b/ags-validator-app/components/ui/button.tsx index de31d90..b7d5aaf 100644 --- a/ags-validator-app/components/ui/button.tsx +++ b/ags-validator-app/components/ui/button.tsx @@ -9,7 +9,7 @@ const buttonVariants = cva( { variants: { variant: { - default: "bg-primary text-primary-foreground hover:bg-primary/90", + default: "bg-primary text-primary-foreground hover:bg-[var(--primary-hover)]", destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", outline: @@ -33,6 +33,7 @@ const buttonVariants = cva( } ); + export interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { diff --git a/ags-validator-app/components/validator/validator.tsx b/ags-validator-app/components/validator/validator.tsx index 4ea0c06..03d5232 100644 --- a/ags-validator-app/components/validator/validator.tsx +++ b/ags-validator-app/components/validator/validator.tsx @@ -73,7 +73,7 @@ export default function Validator() {
- + {tabsViewValue === "tables" && parsedAgs !== undefined && (