From 72842c663a960b9f26a2ff700e78ee6c95c56cef Mon Sep 17 00:00:00 2001
From: Lim Chee Aun
Date: Mon, 23 Oct 2023 08:43:27 +0800
Subject: [PATCH] Change from "Build" to "Version"
Also make version string copy-able
---
src/pages/settings.css | 7 ++++++
src/pages/settings.jsx | 48 +++++++++++++++++++++++++++++-------------
2 files changed, 40 insertions(+), 15 deletions(-)
diff --git a/src/pages/settings.css b/src/pages/settings.css
index b9dd0e9c..3e21dedb 100644
--- a/src/pages/settings.css
+++ b/src/pages/settings.css
@@ -140,3 +140,10 @@
color: var(--link-color);
vertical-align: middle;
}
+
+#settings-container .version-string {
+ padding: 4px;
+ font-family: var(--monospace-font);
+ font-size: 85%;
+ text-align: center;
+}
diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx
index abbb99c9..ff06f6ca 100644
--- a/src/pages/settings.jsx
+++ b/src/pages/settings.jsx
@@ -18,6 +18,7 @@ import {
removeSubscription,
updateSubscription,
} from '../utils/push-notifications';
+import showToast from '../utils/show-toast';
import states from '../utils/states';
import store from '../utils/store';
@@ -508,21 +509,38 @@ function Settings({ onClose }) {
{__BUILD_TIME__ && (
- Last build:{' '}
- {' '}
- {__COMMIT_HASH__ && (
- <>
- (
-
- {__COMMIT_HASH__}
-
- )
- >
- )}
+ Version:{' '}
+ {
+ e.target.select();
+ // Copy to clipboard
+ try {
+ navigator.clipboard.writeText(e.target.value);
+ showToast('Version string copied');
+ } catch (e) {
+ console.warn(e);
+ showToast('Unable to copy version string');
+ }
+ }}
+ />{' '}
+
+ (
+
+
+
+ )
+
)}