mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
refactor(frontend): hoist .danger-icon to utils.css and use it everywhere
InboundFormModal (margin-left 6px) and OutboundFormModal (margin-left 8px) each carried their own .danger-icon, and FinalMaskForm wrote the same color/cursor/marginLeft trio inline five times. Unify on a single .danger-icon in utils.css with margin-left: 8px — matching the more generous OutboundFormModal value — and: - Drop the per-file .danger-icon copies from InboundFormModal.css and OutboundFormModal.css. - Replace the five inline style props in FinalMaskForm.tsx with className="danger-icon". The visible change is a 2px wider gap to the right of the delete icons on InboundFormModal's protocol/peer dividers.
This commit is contained in:
parent
862828b91c
commit
83ab642beb
4 changed files with 11 additions and 17 deletions
|
|
@ -138,7 +138,7 @@ export default function FinalMaskForm({ stream, protocol, onChange }: FinalMaskF
|
||||||
<Divider style={{ margin: 0 }}>
|
<Divider style={{ margin: 0 }}>
|
||||||
TCP Mask {mIdx + 1}
|
TCP Mask {mIdx + 1}
|
||||||
<DeleteOutlined
|
<DeleteOutlined
|
||||||
style={{ color: 'var(--ant-color-error)', cursor: 'pointer', marginLeft: 8 }}
|
className="danger-icon"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
stream.delTcpMask(mIdx);
|
stream.delTcpMask(mIdx);
|
||||||
notify();
|
notify();
|
||||||
|
|
@ -238,7 +238,7 @@ export default function FinalMaskForm({ stream, protocol, onChange }: FinalMaskF
|
||||||
<Divider style={{ margin: 0 }}>
|
<Divider style={{ margin: 0 }}>
|
||||||
UDP Mask {mIdx + 1}
|
UDP Mask {mIdx + 1}
|
||||||
<DeleteOutlined
|
<DeleteOutlined
|
||||||
style={{ color: 'var(--ant-color-error)', cursor: 'pointer', marginLeft: 8 }}
|
className="danger-icon"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
stream.delUdpMask(mIdx);
|
stream.delUdpMask(mIdx);
|
||||||
notify();
|
notify();
|
||||||
|
|
@ -403,7 +403,7 @@ function HeaderCustomGroups({
|
||||||
<Divider style={{ margin: 0 }}>
|
<Divider style={{ margin: 0 }}>
|
||||||
{groupKey === 'clients' ? 'Clients' : 'Servers'} Group {gi + 1}
|
{groupKey === 'clients' ? 'Clients' : 'Servers'} Group {gi + 1}
|
||||||
<DeleteOutlined
|
<DeleteOutlined
|
||||||
style={{ color: 'var(--ant-color-error)', cursor: 'pointer', marginLeft: 8 }}
|
className="danger-icon"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
(settings[groupKey] as ItemRow[][]).splice(gi, 1);
|
(settings[groupKey] as ItemRow[][]).splice(gi, 1);
|
||||||
onChange();
|
onChange();
|
||||||
|
|
@ -445,7 +445,7 @@ function UdpHeaderCustom({ mask, onChange }: { mask: MaskRow; onChange: () => vo
|
||||||
<Divider style={{ margin: 0 }}>
|
<Divider style={{ margin: 0 }}>
|
||||||
{groupKey === 'client' ? 'Client' : 'Server'} {ci + 1}
|
{groupKey === 'client' ? 'Client' : 'Server'} {ci + 1}
|
||||||
<DeleteOutlined
|
<DeleteOutlined
|
||||||
style={{ color: 'var(--ant-color-error)', cursor: 'pointer', marginLeft: 8 }}
|
className="danger-icon"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
(settings[groupKey] as ItemRow[]).splice(ci, 1);
|
(settings[groupKey] as ItemRow[]).splice(ci, 1);
|
||||||
onChange();
|
onChange();
|
||||||
|
|
@ -493,7 +493,7 @@ function NoiseItems({ mask, onChange }: { mask: MaskRow; onChange: () => void })
|
||||||
<Divider style={{ margin: 0 }}>
|
<Divider style={{ margin: 0 }}>
|
||||||
Noise {ni + 1}
|
Noise {ni + 1}
|
||||||
<DeleteOutlined
|
<DeleteOutlined
|
||||||
style={{ color: 'var(--ant-color-error)', cursor: 'pointer', marginLeft: 8 }}
|
className="danger-icon"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
(settings.noise as ItemRow[]).splice(ni, 1);
|
(settings.noise as ItemRow[]).splice(ni, 1);
|
||||||
onChange();
|
onChange();
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,3 @@
|
||||||
.danger-icon {
|
|
||||||
margin-left: 6px;
|
|
||||||
cursor: pointer;
|
|
||||||
color: var(--ant-color-error);
|
|
||||||
}
|
|
||||||
|
|
||||||
.vless-auth-state {
|
.vless-auth-state {
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,3 @@
|
||||||
.danger-icon {
|
|
||||||
cursor: pointer;
|
|
||||||
color: var(--ant-color-error);
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-heading {
|
.item-heading {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
||||||
|
|
@ -21,3 +21,9 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: var(--ant-color-primary);
|
color: var(--ant-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.danger-icon {
|
||||||
|
margin-left: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--ant-color-error);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue