From 862828b91c1a9dae27f35cbfdea7accc7a55555b Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Mon, 25 May 2026 14:18:10 +0200 Subject: [PATCH] refactor(frontend): hoist .random-icon to utils.css MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three form modals each carried identical .random-icon styles (small primary-tinted icon next to randomizable inputs): ClientBulkAddModal, InboundFormModal, OutboundFormModal Single definition lives in utils.css now. ClientBulkAddModal.css was just this one rule, so the file and its import are deleted along the way. .danger-icon is left per file — the margin-left differs slightly between InboundFormModal (6px) and OutboundFormModal (8px), so it stays as a page-local rule rather than getting averaged into utils.css. --- frontend/src/pages/clients/ClientBulkAddModal.css | 5 ----- frontend/src/pages/clients/ClientBulkAddModal.tsx | 1 - frontend/src/pages/inbounds/InboundFormModal.css | 6 ------ frontend/src/pages/xray/OutboundFormModal.css | 6 ------ frontend/src/styles/utils.css | 6 ++++++ 5 files changed, 6 insertions(+), 18 deletions(-) delete mode 100644 frontend/src/pages/clients/ClientBulkAddModal.css diff --git a/frontend/src/pages/clients/ClientBulkAddModal.css b/frontend/src/pages/clients/ClientBulkAddModal.css deleted file mode 100644 index 8d563dbb..00000000 --- a/frontend/src/pages/clients/ClientBulkAddModal.css +++ /dev/null @@ -1,5 +0,0 @@ -.random-icon { - margin-left: 4px; - cursor: pointer; - color: var(--ant-color-primary); -} diff --git a/frontend/src/pages/clients/ClientBulkAddModal.tsx b/frontend/src/pages/clients/ClientBulkAddModal.tsx index 1b15267f..264b3229 100644 --- a/frontend/src/pages/clients/ClientBulkAddModal.tsx +++ b/frontend/src/pages/clients/ClientBulkAddModal.tsx @@ -9,7 +9,6 @@ import { HttpUtil, RandomUtil, SizeFormatter } from '@/utils'; import { TLS_FLOW_CONTROL } from '@/models/inbound'; import DateTimePicker from '@/components/DateTimePicker'; import type { InboundOption } from '@/hooks/useClients'; -import './ClientBulkAddModal.css'; const FLOW_OPTIONS = Object.values(TLS_FLOW_CONTROL); const JSON_HEADERS = { headers: { 'Content-Type': 'application/json' } } as const; diff --git a/frontend/src/pages/inbounds/InboundFormModal.css b/frontend/src/pages/inbounds/InboundFormModal.css index 2532e21a..444ab670 100644 --- a/frontend/src/pages/inbounds/InboundFormModal.css +++ b/frontend/src/pages/inbounds/InboundFormModal.css @@ -1,9 +1,3 @@ -.random-icon { - margin-left: 4px; - cursor: pointer; - color: var(--ant-color-primary); -} - .danger-icon { margin-left: 6px; cursor: pointer; diff --git a/frontend/src/pages/xray/OutboundFormModal.css b/frontend/src/pages/xray/OutboundFormModal.css index 98e0c050..60f2cb5a 100644 --- a/frontend/src/pages/xray/OutboundFormModal.css +++ b/frontend/src/pages/xray/OutboundFormModal.css @@ -1,9 +1,3 @@ -.random-icon { - cursor: pointer; - color: var(--ant-color-primary); - margin-left: 4px; -} - .danger-icon { cursor: pointer; color: var(--ant-color-error); diff --git a/frontend/src/styles/utils.css b/frontend/src/styles/utils.css index 40cec66d..fca7aa5a 100644 --- a/frontend/src/styles/utils.css +++ b/frontend/src/styles/utils.css @@ -15,3 +15,9 @@ .my-10 { margin: 10px 0; } .zero-margin { margin: 0; } + +.random-icon { + margin-left: 4px; + cursor: pointer; + color: var(--ant-color-primary); +}