From e1ae090c9f71681c16d2766e3774ddae147b26a3 Mon Sep 17 00:00:00 2001
From: David Arranz
Date: Sat, 24 Aug 2024 11:32:52 +0200
Subject: [PATCH] .
---
.../app/quotes/components/QuotesDataTable.tsx | 14 ++++-
client/src/app/quotes/list.tsx | 7 ++-
.../LoadingIndicator/LoadingIndicator.tsx | 3 +-
.../LoadingOverlay/LoadingOverlay.module.css | 8 ---
.../LoadingOverlay/LoadingOverlay.tsx | 15 ++++--
client/src/index.css | 54 +++++++++++++++++--
client/src/locales/en.json | 9 ++++
client/src/locales/es.json | 9 ++++
8 files changed, 99 insertions(+), 20 deletions(-)
delete mode 100644 client/src/components/LoadingOverlay/LoadingOverlay.module.css
diff --git a/client/src/app/quotes/components/QuotesDataTable.tsx b/client/src/app/quotes/components/QuotesDataTable.tsx
index 0ce40ef..886b2a5 100644
--- a/client/src/app/quotes/components/QuotesDataTable.tsx
+++ b/client/src/app/quotes/components/QuotesDataTable.tsx
@@ -70,7 +70,19 @@ export const QuotesDataTable = ({
id: "reference" as const,
accessorKey: "reference",
header: () => <>{t("quotes.list.columns.reference")}>,
- cell: ({ renderValue }) => {renderValue()}
,
+ cell: ({ row: { original }, renderValue }) => (
+
+ ),
enableResizing: false,
},
diff --git a/client/src/app/quotes/list.tsx b/client/src/app/quotes/list.tsx
index 0cce78b..d39216d 100644
--- a/client/src/app/quotes/list.tsx
+++ b/client/src/app/quotes/list.tsx
@@ -5,7 +5,7 @@ import { QuotesDataTable } from "./components";
import { Button, Tabs, TabsContent, TabsList, TabsTrigger, Toggle } from "@/ui";
import { useToggle } from "@wojtekmaj/react-hooks";
import { t } from "i18next";
-import { InfoIcon } from "lucide-react";
+import { InfoIcon, PlusIcon } from "lucide-react";
import { useNavigate } from "react-router-dom";
export const QuotesList = () => {
@@ -24,7 +24,10 @@ export const QuotesList = () => {
-
+
diff --git a/client/src/components/LoadingIndicator/LoadingIndicator.tsx b/client/src/components/LoadingIndicator/LoadingIndicator.tsx
index ef55075..9943635 100644
--- a/client/src/components/LoadingIndicator/LoadingIndicator.tsx
+++ b/client/src/components/LoadingIndicator/LoadingIndicator.tsx
@@ -1,4 +1,5 @@
import { cn } from "@/lib/utils";
+import { t } from "i18next";
import styles from "./LoadingIndicator.module.css";
import { LoadingSpinIcon } from "./LoadingSpinIcon";
@@ -13,7 +14,7 @@ export type LoadingIndicatorProps = {
export const LoadingIndicator = ({
active = true,
look = "dark",
- title = "Cargando...",
+ title = t("components.loading_indicator.title"),
subtitle = "",
}: LoadingIndicatorProps) => {
const isDark = look === "dark";
diff --git a/client/src/components/LoadingOverlay/LoadingOverlay.module.css b/client/src/components/LoadingOverlay/LoadingOverlay.module.css
deleted file mode 100644
index 493665a..0000000
--- a/client/src/components/LoadingOverlay/LoadingOverlay.module.css
+++ /dev/null
@@ -1,8 +0,0 @@
-@tailwind components;
-
-@layer components {
- .LoadingOverlay {
- @apply fixed top-0 bottom-0 left-0 right-0 z-50 w-full h-screen overflow-hidden;
- @apply flex justify-center bg-red-700 opacity-75;
- }
-}
diff --git a/client/src/components/LoadingOverlay/LoadingOverlay.tsx b/client/src/components/LoadingOverlay/LoadingOverlay.tsx
index c1f7da4..027df98 100644
--- a/client/src/components/LoadingOverlay/LoadingOverlay.tsx
+++ b/client/src/components/LoadingOverlay/LoadingOverlay.tsx
@@ -1,5 +1,5 @@
+import { t } from "i18next";
import { LoadingIndicator } from "../LoadingIndicator";
-import styles from "./LoadingOverlay.module.css";
export type LoadingOverlayProps = {
title?: string;
@@ -7,13 +7,18 @@ export type LoadingOverlayProps = {
};
export const LoadingOverlay = ({
- title = "Cargando",
- subtitle = "Esto puede tardar unos segundos. Por favor, no cierre esta página.",
+ title = t("components.loading_overlay.title"),
+ subtitle = t("components.loading_overlay.subtitle"),
...props
}: LoadingOverlayProps) => {
return (
-
-
+
+
);
};
diff --git a/client/src/index.css b/client/src/index.css
index b20ddb9..750351c 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -3,7 +3,7 @@
@tailwind utilities;
/* https://ui.jln.dev/ Teriyaki */
-@layer base {
+/*@layer base {
:root {
--background: 25 31% 100%;
--foreground: 25 67% 4%;
@@ -21,8 +21,8 @@
--secondary-foreground: 25 18% 30%;
--accent: 25 23% 83%;
--accent-foreground: 25 23% 23%;
- --destructive: 0 72.2% 50.6%; /* 13 96% 20%; */
- --destructive-foreground: 0 85.7% 97.3%; /* 13 96% 80%; */
+ --destructive: 0 72.2% 50.6%; / * 13 96% 20%; * /
+ --destructive-foreground: 0 85.7% 97.3%; / * 13 96% 80%; * /
--ring: 25 31% 75%;
--radius: 0.5rem;
}
@@ -48,6 +48,54 @@
--destructive-foreground: 0 0% 100%;
--ring: 25 31% 75%;
}
+}*/
+
+/* https://ui.jln.dev/ unicscode89-stripe */
+@layer base {
+ :root {
+ --background: 210 40% 96.08%;
+ --foreground: 334 55% 1%;
+ --muted: 214.29 31.82% 91.37%;
+ --muted-foreground: 334 9% 37%;
+ --popover: 334 62% 100%;
+ --popover-foreground: 334 55% 1%;
+ --card: 334 62% 100%;
+ --card-foreground: 334 55% 1%;
+ --border: 334 5% 95%;
+ --input: 334 5% 95%;
+ --primary: 242.93 100% 67.84%;
+ --primary-foreground: 0 0% 100%;
+ --secondary: 213.75 20.25% 69.02%;
+ --secondary-foreground: 334 0% 100%;
+ --accent: 214.29 31.82% 91.37%;
+ --accent-foreground: 334 20% 22%;
+ --destructive: 348.37 78.4% 49.02%;
+ --destructive-foreground: 18 0% 100%;
+ --ring: 228.33 94.74% 62.75%;
+ --radius: 0.5rem;
+ }
+
+ .dark {
+ --background: 222.22 47.37% 11.18%;
+ --foreground: 334 34% 98%;
+ --muted: 215.38 16.32% 46.86%;
+ --muted-foreground: 334 0% 87.69%;
+ --popover: 217.24 32.58% 17.45%;
+ --popover-foreground: 334 34% 98%;
+ --card: 217.24 32.58% 17.45%;
+ --card-foreground: 334 34% 98%;
+ --border: 334 0% 32.31%;
+ --input: 215.29 25% 26.67%;
+ --primary: 227.56 53.78% 49.22%;
+ --primary-foreground: 0 0% 100%;
+ --secondary: 214.29 5.04% 27.25%;
+ --secondary-foreground: 334 0% 100%;
+ --accent: 222.22 47.37% 11.18%;
+ --accent-foreground: 226.73 0% 100%;
+ --destructive: 358.82 84.44% 64.71%;
+ --destructive-foreground: 0 0% 100%;
+ --ring: 227.56 53.78% 49.22%;
+ }
}
@layer base {
diff --git a/client/src/locales/en.json b/client/src/locales/en.json
index 2aea287..cd1ffee 100644
--- a/client/src/locales/en.json
+++ b/client/src/locales/en.json
@@ -52,6 +52,15 @@
"duplicate": "Duplicate",
"print": "Print"
},
+ "components": {
+ "loading_indicator": {
+ "title": "Loading..."
+ },
+ "loading_overlay": {
+ "title": "Loading...",
+ "subtitle": "This may take a few seconds. Please do not close this page."
+ }
+ },
"main_menu": {
"home": "Home",
"settings": "Settings",
diff --git a/client/src/locales/es.json b/client/src/locales/es.json
index 39094b3..5a6de03 100644
--- a/client/src/locales/es.json
+++ b/client/src/locales/es.json
@@ -52,6 +52,15 @@
"duplicate": "Duplicar",
"print": "Imprimir"
},
+ "components": {
+ "LoadingIndicator": {
+ "title": "Cargando..."
+ },
+ "loading_overlay": {
+ "title": "Cargando...",
+ "subtitle": "Esto puede tardar unos segundos. Por favor, no cierre esta página."
+ }
+ },
"main_menu": {
"home": "Inicio",
"settings": "Ajustes",