From c6b1dd7376ee33b4a9c49fce4fdd64a5f633b557 Mon Sep 17 00:00:00 2001 From: Adam McQuilkin <46639306+ajmcquilkin@users.noreply.github.com> Date: Tue, 25 Jul 2023 19:44:52 +0900 Subject: [PATCH 1/6] Implemented dark mode for connect page --- src/components/Sidebar/Sidebar.tsx | 2 +- src/components/connection/ConnectTab.tsx | 2 +- src/components/connection/ConnectionInput.tsx | 2 +- .../connection/ConnectionSwitch.tsx | 4 +- .../connection/SerialConnectPane.tsx | 14 ++--- .../connection/SerialPortOption.tsx | 57 +++++++------------ src/components/connection/TcpConnectPane.tsx | 14 +++-- src/components/pages/ConnectPage.tsx | 20 ++++--- 8 files changed, 52 insertions(+), 63 deletions(-) diff --git a/src/components/Sidebar/Sidebar.tsx b/src/components/Sidebar/Sidebar.tsx index a29cb65a..f1965cfa 100644 --- a/src/components/Sidebar/Sidebar.tsx +++ b/src/components/Sidebar/Sidebar.tsx @@ -34,7 +34,7 @@ const Sidebar = () => { return (
diff --git a/src/components/connection/ConnectTab.tsx b/src/components/connection/ConnectTab.tsx index b14d75a8..e31ef75f 100644 --- a/src/components/connection/ConnectTab.tsx +++ b/src/components/connection/ConnectTab.tsx @@ -18,7 +18,7 @@ const ConnectTab = ({ }: IConnectTabProps) => { return (

{label}

diff --git a/src/components/connection/ConnectionInput.tsx b/src/components/connection/ConnectionInput.tsx index ac0cd110..b1df4875 100644 --- a/src/components/connection/ConnectionInput.tsx +++ b/src/components/connection/ConnectionInput.tsx @@ -13,7 +13,7 @@ const ConnectionInput = forwardRef( return ( { return ( - + ); }; diff --git a/src/components/connection/SerialConnectPane.tsx b/src/components/connection/SerialConnectPane.tsx index 5eb0b38d..b933baba 100644 --- a/src/components/connection/SerialConnectPane.tsx +++ b/src/components/connection/SerialConnectPane.tsx @@ -58,7 +58,7 @@ const SerialConnectPane = ({ /> )) ) : ( -

+

{t("connectPage.tabs.serial.empty")}

)} @@ -70,18 +70,18 @@ const SerialConnectPane = ({ className="flex flex-row justify-center align-middle mx-auto gap-4 mt-5" onClick={() => refreshPorts()} > - -

+ +

{t("connectPage.tabs.serial.refresh")}

@@ -97,14 +97,14 @@ const SerialConnectPane = ({ />
-

+

{t("connectPage.tabs.serial.dtrTitle")}

-

+

{t("connectPage.tabs.serial.rtsTitle")}

diff --git a/src/components/connection/SerialPortOption.tsx b/src/components/connection/SerialPortOption.tsx index 6b380b08..1c58f8c8 100644 --- a/src/components/connection/SerialPortOption.tsx +++ b/src/components/connection/SerialPortOption.tsx @@ -21,33 +21,12 @@ const SerialPortOption = ({ onClick, }: ISerialPortOptions) => { switch (connectionState.status) { - case "IDLE": - return ( - - ); - case "PENDING": return (
-
- -

+
+ +

-
- -

+
+ +

-
+
- -

+ +

-

+

{connectionState.message}

); - default: + default: // "IDLE" return ( -
+ ); } }; diff --git a/src/components/connection/TcpConnectPane.tsx b/src/components/connection/TcpConnectPane.tsx index d3cefd57..b5c16737 100644 --- a/src/components/connection/TcpConnectPane.tsx +++ b/src/components/connection/TcpConnectPane.tsx @@ -47,28 +47,30 @@ const TcpConnectPane = ({ /> {activeSocketState.status === "FAILED" && (
-

+

{activeSocketState.message}

diff --git a/src/components/pages/ConnectPage.tsx b/src/components/pages/ConnectPage.tsx index ed8a316d..77bde5fa 100644 --- a/src/components/pages/ConnectPage.tsx +++ b/src/components/pages/ConnectPage.tsx @@ -5,7 +5,10 @@ import { open } from "@tauri-apps/api/shell"; import * as Tabs from "@radix-ui/react-tabs"; import Hero_Image from "@app/assets/onboard_hero_image.jpg"; -import Meshtastic_Logo from "@app/assets/Mesh_Logo_Black.png"; + +// TODO export these as svg +import Meshtastic_Logo_Dark from "@app/assets/Mesh_Logo_Black.png"; +import Meshtastic_Logo_Light from "@app/assets/Mesh_Logo_White.svg"; import ConnectTab from "@components/connection/ConnectTab"; import TcpConnectPane from "@components/connection/TcpConnectPane"; @@ -176,27 +179,28 @@ const ConnectPage = ({ unmountSelf }: IOnboardPageProps) => { return (
-
+
-

+

{t("connectPage.title")}

-

+

{ onClick={() => void open("https://meshtastic.org/docs/introduction") } - className="hover:cursor-pointer hover:text-gray-600 underline" + className="hover:cursor-pointer hover:text-gray-600 dark:hover:text-gray-300 underline transition-colors" /> ), }} From 60bd23d77bd68295d662033a8107e0dba9149c88 Mon Sep 17 00:00:00 2001 From: Adam McQuilkin <46639306+ajmcquilkin@users.noreply.github.com> Date: Wed, 26 Jul 2023 13:27:33 -0700 Subject: [PATCH 2/6] Styled remainder of application for dark mode --- src/assets/Mesh_Logo_Dark.svg | 12 ++ src/assets/Mesh_Logo_Light.svg | 12 ++ src/assets/Mesh_Logo_White.svg | 12 -- src/components/DefaultTooltip.tsx | 4 +- src/components/Map/CreateWaypointDialog.tsx | 62 +++++---- src/components/Map/MapContextOption.tsx | 6 +- src/components/Map/MapOverlayButton.tsx | 4 +- src/components/Map/MapSelectedNodeMenu.tsx | 25 ++-- src/components/Map/MapView.css | 79 ++++++++++-- src/components/Map/MapView.tsx | 6 +- .../Messaging/ChannelListElement.tsx | 49 +++---- src/components/Messaging/MessagingInput.tsx | 17 ++- .../Messaging/TextMessageBubble.tsx | 17 ++- src/components/NavigationBacktrace.tsx | 6 +- src/components/NodeSearch/NodeSearchDock.tsx | 4 +- src/components/NodeSearch/NodeSearchInput.tsx | 2 +- src/components/Sidebar/Sidebar.tsx | 8 +- src/components/Sidebar/SidebarIcon.tsx | 16 ++- src/components/Sidebar/SidebarLogo.tsx | 18 ++- src/components/Sidebar/SidebarTab.tsx | 2 +- src/components/Table/TableBody.tsx | 9 +- src/components/Table/TableLayout.tsx | 4 +- src/components/Waypoints/WaypointMenu.tsx | 25 ++-- src/components/config/ConfigInput.tsx | 2 +- src/components/config/ConfigLabel.tsx | 4 +- src/components/config/ConfigLayout.tsx | 10 +- src/components/config/ConfigOption.tsx | 18 ++- src/components/config/ConfigSelect.tsx | 35 +++++ src/components/config/ConfigTitlebar.tsx | 14 +- .../config/channel/ChannelConfigDetail.tsx | 28 ++-- .../config/device/BluetoothConfigPage.tsx | 29 ++--- .../config/device/DeviceConfigPage.tsx | 78 ++++++----- .../config/device/DisplayConfigPage.tsx | 122 ++++++++---------- .../config/device/LoRaConfigPage.tsx | 95 +++++++------- .../config/device/NetworkConfigPage.tsx | 23 ++-- .../config/module/AudioConfigPage.tsx | 30 +++-- .../config/module/CannedMessageConfigPage.tsx | 41 +++--- .../config/module/SerialModuleConfigPage.tsx | 88 ++++++------- .../connection/SerialPortOption.tsx | 4 +- src/components/connection/TcpConnectPane.tsx | 4 +- src/components/pages/ApplicationStatePage.tsx | 14 +- src/components/pages/ConnectPage.tsx | 14 +- src/components/pages/MessagingPage.tsx | 4 +- src/index.css | 16 +++ src/utils/hooks.ts | 32 +++++ src/utils/nodes.ts | 32 ++--- 46 files changed, 663 insertions(+), 473 deletions(-) create mode 100644 src/assets/Mesh_Logo_Dark.svg create mode 100644 src/assets/Mesh_Logo_Light.svg delete mode 100644 src/assets/Mesh_Logo_White.svg create mode 100644 src/components/config/ConfigSelect.tsx diff --git a/src/assets/Mesh_Logo_Dark.svg b/src/assets/Mesh_Logo_Dark.svg new file mode 100644 index 00000000..d13c103d --- /dev/null +++ b/src/assets/Mesh_Logo_Dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/assets/Mesh_Logo_Light.svg b/src/assets/Mesh_Logo_Light.svg new file mode 100644 index 00000000..ce55b364 --- /dev/null +++ b/src/assets/Mesh_Logo_Light.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/assets/Mesh_Logo_White.svg b/src/assets/Mesh_Logo_White.svg deleted file mode 100644 index 090a53c3..00000000 --- a/src/assets/Mesh_Logo_White.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/src/components/DefaultTooltip.tsx b/src/components/DefaultTooltip.tsx index 251078b4..4529d357 100644 --- a/src/components/DefaultTooltip.tsx +++ b/src/components/DefaultTooltip.tsx @@ -26,14 +26,14 @@ const DefaultTooltip = ({ {children} {text} - + diff --git a/src/components/Map/CreateWaypointDialog.tsx b/src/components/Map/CreateWaypointDialog.tsx index 1f5c0bc8..c8bb6bde 100644 --- a/src/components/Map/CreateWaypointDialog.tsx +++ b/src/components/Map/CreateWaypointDialog.tsx @@ -42,6 +42,7 @@ import { import { selectMapState } from "@features/map/mapSelectors"; import { dateTimeLocalFormatString } from "@utils/form"; +import { useIsDarkMode } from "@utils/hooks"; import { MapIDs, formatLocation, getFlyToConfig } from "@utils/map"; import { getChannelName } from "@utils/messaging"; @@ -73,6 +74,8 @@ const CreateWaypointDialog = ({ }: ICreateWaypointDialogProps) => { const { t } = useTranslation(); + const { isDarkMode } = useIsDarkMode(); + const dispatch = useDispatch(); const primaryDeviceKey = useSelector(selectPrimaryDeviceKey()); const deviceChannels = useSelector(selectDeviceChannels()); @@ -238,8 +241,8 @@ const CreateWaypointDialog = ({ return ( {/* Tracking https://github.com/radix-ui/primitives/issues/1159 */} -
- +
+
- +
@@ -304,7 +310,7 @@ const CreateWaypointDialog = ({
- + {existingWaypoint ? t("map.waypoints.editWaypointTitle") : t("map.waypoints.createWaypointTitle")} @@ -322,7 +328,9 @@ const CreateWaypointDialog = ({