From 1afa19696cc7b0514b392611a5eb4df038cbce9c Mon Sep 17 00:00:00 2001 From: Grant Forrest Date: Mon, 10 Jun 2024 15:09:58 -0400 Subject: [PATCH] [tt] fix list edit layout --- .../src/components/lists/ListInfoEditor.tsx | 119 +++++++++++------- apps/trip-tick/web/src/pages/ListPage.tsx | 2 +- packages/client/src/components/Explainer.tsx | 2 +- .../components/InfrequentSubscriptionHint.tsx | 3 +- 4 files changed, 76 insertions(+), 50 deletions(-) diff --git a/apps/trip-tick/web/src/components/lists/ListInfoEditor.tsx b/apps/trip-tick/web/src/components/lists/ListInfoEditor.tsx index 64035abf..27e42f33 100644 --- a/apps/trip-tick/web/src/components/lists/ListInfoEditor.tsx +++ b/apps/trip-tick/web/src/components/lists/ListInfoEditor.tsx @@ -5,6 +5,12 @@ import { TemperatureUnit } from '../weather/TemperatureUnit.jsx'; import { useCanSync } from '@biscuits/client'; import { useTemperatureUnit } from '../weather/useTemperatureUnit.js'; import { Input } from '@a-type/ui/components/input/Input'; +import { + CollapsibleContent, + CollapsibleRoot, + CollapsibleTrigger, +} from '@a-type/ui/components/collapsible'; +import { Icon } from '@a-type/ui/components/icon'; export interface ListInfoEditorProps { list: List; @@ -18,55 +24,74 @@ export function ListInfoEditor({ list }: ListInfoEditorProps) { if (!isSubscribed) return null; return ( -
-
- -
- { - if (isNaN(ev.currentTarget.valueAsNumber)) return; - list.set( - 'hotThreshold', - fromDisplay(ev.currentTarget.valueAsNumber), - ); - }} - maxLength={3} - onFocus={(ev) => { - ev.currentTarget.select(); - }} - /> - - + + + +
+ + + Weather settings |{' '} + {toDisplay(hotThreshold ?? 299)}{' '} + {toDisplay(coldThreshold ?? 277)}{' '} + -
-
-
- -
- { - if (isNaN(ev.currentTarget.valueAsNumber)) return; - list.set( - 'coldThreshold', - fromDisplay(ev.currentTarget.valueAsNumber), - ); - }} - maxLength={3} - onFocus={(ev) => { - ev.currentTarget.select(); - }} + - - - -
-
-
+ + +
+
+ +
+ { + if (isNaN(ev.currentTarget.valueAsNumber)) return; + list.set( + 'hotThreshold', + fromDisplay(ev.currentTarget.valueAsNumber), + ); + }} + maxLength={3} + onFocus={(ev) => { + ev.currentTarget.select(); + }} + /> + + and above + +
+
+
+ +
+ { + if (isNaN(ev.currentTarget.valueAsNumber)) return; + list.set( + 'coldThreshold', + fromDisplay(ev.currentTarget.valueAsNumber), + ); + }} + maxLength={3} + onFocus={(ev) => { + ev.currentTarget.select(); + }} + /> + + and below + +
+
+
+
+ ); } diff --git a/apps/trip-tick/web/src/pages/ListPage.tsx b/apps/trip-tick/web/src/pages/ListPage.tsx index 1e45091c..895ef88c 100644 --- a/apps/trip-tick/web/src/pages/ListPage.tsx +++ b/apps/trip-tick/web/src/pages/ListPage.tsx @@ -34,7 +34,7 @@ function ListPageEditor({ listId }: { listId: string }) { return ( <> - +