From c55c8e24c9462f1e038b18ec773ad1e349dab397 Mon Sep 17 00:00:00 2001 From: Roland Date: Thu, 25 Dec 2025 16:03:09 -0700 Subject: [PATCH] Replacing Semantic Confirm with custom confirm to have themeing and mobile support. --- app/src/App.css | 5 +++ app/src/components/Common.js | 6 +-- app/src/components/FileBrowser.test.js | 12 +++--- app/src/components/Theme.tsx | 45 +++++++++++++++++++++- app/src/components/Vars.js | 4 ++ app/src/components/admin/ControllerPage.js | 4 +- 6 files changed, 62 insertions(+), 14 deletions(-) diff --git a/app/src/App.css b/app/src/App.css index b5a84cc6..81b69676 100644 --- a/app/src/App.css +++ b/app/src/App.css @@ -197,6 +197,11 @@ textarea.otp { color: #DDDDDD !important; } +/* Mobile-responsive Confirm modal */ +.ui.modal.themed-confirm { + max-width: 95vw; +} + .clickable { cursor: pointer; } diff --git a/app/src/components/Common.js b/app/src/components/Common.js index a62011bc..6fb0f27e 100644 --- a/app/src/components/Common.js +++ b/app/src/components/Common.js @@ -6,7 +6,6 @@ import { Button as SButton, ButtonGroup, Card, - Confirm, Container, Dimmer, DimmerDimmable, @@ -29,6 +28,7 @@ import { Breadcrumb, Button, Card as ThemedCard, + Confirm, darkTheme, Form, Header, @@ -1298,10 +1298,6 @@ export const BackButton = ({...props}) => { return + + + + ); +}; + // ---------------------------------------------------------------------------- // Form Compound Component // ---------------------------------------------------------------------------- diff --git a/app/src/components/Vars.js b/app/src/components/Vars.js index d07b7b97..985e767a 100644 --- a/app/src/components/Vars.js +++ b/app/src/components/Vars.js @@ -90,6 +90,10 @@ export const semanticUIColorMap = { grey: '#767676', } +export const ColorToSemanticHexColor = (color) => { + return semanticUIColorMap[color] || null; +} + export const validUrlRegex = /^(http|https):\/\/[^ "]+$/; export const downloadOrderOptions = [ diff --git a/app/src/components/admin/ControllerPage.js b/app/src/components/admin/ControllerPage.js index b4dd3e39..1cf63c2b 100644 --- a/app/src/components/admin/ControllerPage.js +++ b/app/src/components/admin/ControllerPage.js @@ -1,6 +1,6 @@ import React from 'react'; -import {Checkbox, Confirm, Container, Dropdown, Form, Icon, Input} from "semantic-ui-react"; -import {Button, Header, Loader, Modal, Segment, Table} from "../Theme"; +import {Checkbox, Container, Dropdown, Form, Icon, Input} from "semantic-ui-react"; +import {Button, Confirm, Header, Loader, Modal, Segment, Table} from "../Theme"; import {APIButton, HotspotToggle, ThrottleToggle, Toggle,} from "../Common"; import {useDockerized} from "../../hooks/customHooks"; import {Media} from "../../contexts/contexts";