From 5be885de1962f22407a972884163d5e7739807bf Mon Sep 17 00:00:00 2001
From: Bailey Pumfleet
Date: Thu, 6 May 2021 21:44:55 +0100
Subject: [PATCH] UI improvements to time settings
---
pages/[user]/[type].tsx | 77 +++++++++++++++++++++++------------------
1 file changed, 44 insertions(+), 33 deletions(-)
diff --git a/pages/[user]/[type].tsx b/pages/[user]/[type].tsx
index 728694dab5..3e5a201d89 100644
--- a/pages/[user]/[type].tsx
+++ b/pages/[user]/[type].tsx
@@ -34,6 +34,10 @@ export default function Type(props) {
const telemetry = useTelemetry();
const [selectedTimeZone, setSelectedTimeZone] = useState('');
+
+ function toggleTimeOptions() {
+ setIsTimeOptionsOpen(!isTimeOptionsOpen);
+ }
useEffect(() => {
// Setting timezone only client-side
@@ -45,8 +49,6 @@ export default function Type(props) {
const router = useRouter();
const { user } = router.query;
- const toggleTimeOptions = () => { setIsTimeOptionsOpen(!isTimeOptionsOpen); }
-
// Handle month changes
const incrementMonth = () => {
setSelectedMonth(selectedMonth + 1);
@@ -168,37 +170,46 @@ export default function Type(props) {
{props.eventType.length} minutes
-
-
-
-
- am/pm
-
-
- Use setting
-
-
-
- 24h
-
-
-
-
- setSelectedTimeZone(value)} className="shadow-sm focus:ring-blue-500 focus:border-blue-500 mt-1 block w-full sm:text-sm border-gray-300 rounded-md" />
-
+
+ {isTimeOptionsOpen &&
+
+
+
Time Options
+
+
+
+ am/pm
+
+
+ Use setting
+
+
+
+ 24h
+
+
+
+
+
setSelectedTimeZone(value)} className="mb-2 shadow-sm focus:ring-blue-500 focus:border-blue-500 mt-1 block w-full sm:text-sm border-gray-300 rounded-md" />
+
+ }
{props.eventType.description}