From 409f1733ce990e93f695894524735caab9e3ea9e Mon Sep 17 00:00:00 2001
From: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
Date: Wed, 19 Oct 2022 15:02:27 +0300
Subject: [PATCH] Optimize dark mode UI for shared link form (#2355)
* remove redundant empty div
* optimize shared link form for darkmode
* follow the same style in new_api_key form
---
.../templates/auth/new_api_key.html.eex | 4 ++--
.../templates/site/new_shared_link.html.eex | 12 +++++-------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/lib/plausible_web/templates/auth/new_api_key.html.eex b/lib/plausible_web/templates/auth/new_api_key.html.eex
index f42c0dde1..e45e4eb9c 100644
--- a/lib/plausible_web/templates/auth/new_api_key.html.eex
+++ b/lib/plausible_web/templates/auth/new_api_key.html.eex
@@ -1,6 +1,6 @@
<%= form_for @changeset, "/settings/api-keys", [class: "w-full max-w-md mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 py-6 mt-8"], fn f -> %>
+
<%= label f, :name, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
<%= text_input f, :name, class: "dark:bg-gray-900 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 dark:border-gray-500 dark:text-gray-300 dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500 rounded-md", placeholder: "Development" %>
@@ -14,7 +14,7 @@
COPY
-
Make sure to store the key in a secure place. Once created, we will not be able to show it again.
+
Make sure to store the key in a secure place. Once created, we will not be able to show it again.
<%= submit "Continue", class: "button mt-4 w-full" %>
diff --git a/lib/plausible_web/templates/site/new_shared_link.html.eex b/lib/plausible_web/templates/site/new_shared_link.html.eex
index 533a183fa..f96ff386d 100644
--- a/lib/plausible_web/templates/site/new_shared_link.html.eex
+++ b/lib/plausible_web/templates/site/new_shared_link.html.eex
@@ -1,20 +1,18 @@
<%= form_for @changeset, "/sites/#{URI.encode_www_form(@site.domain)}/shared-links", [class: "max-w-md w-full mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>
New shared link
-
-
- <%= label f, :name, "Name", class: "block text-sm font-medium text-gray-700 dark:text-gray-100" %>
+ <%= label f, :name, "Name", class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
- <%= text_input f, :name, class: "shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md", required: "required", autocomplete: "off" %>
+ <%= text_input f, :name, class: "shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md dark:bg-gray-900 dark:border-gray-500 dark:text-gray-300 dark:focus:bg-gray-800 dark:focus:border-gray-500", required: "required", autocomplete: "off" %>
<%= error_tag f, :name %>
- <%= label f, :password, "Password (optional)", class: "block text-sm font-medium text-gray-700 dark:text-gray-100" %>
+ <%= label f, :password, "Password (optional)", class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
- <%= password_input f, :password, class: "shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md", autocomplete: "off" %>
+ <%= password_input f, :password, class: "shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md dark:bg-gray-900 dark:border-gray-500 dark:text-gray-300 dark:focus:bg-gray-800 dark:focus:border-gray-500", autocomplete: "off" %>
<%= error_tag f, :password %>
-
+
Password protection is optional. Please make sure you save it in a secure place. Once the link is created, we cannot reveal the password.