mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 09:57:08 -04:00
components(PluginSettings): move css code to a file (#74)
* move disable all / reset all plugin options css to actual css files
This commit is contained in:
parent
20996959ff
commit
2b3465b27d
4 changed files with 148 additions and 32 deletions
|
@ -4,4 +4,74 @@
|
||||||
|
|
||||||
.vc-plugin-modal-description {
|
.vc-plugin-modal-description {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* warning modal */
|
||||||
|
|
||||||
|
.vc-text-selectable {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-warning-info {
|
||||||
|
gap: 15px;
|
||||||
|
flex-direction: column;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-warning-info img {
|
||||||
|
width: 70%;
|
||||||
|
height: auto;
|
||||||
|
display: block;
|
||||||
|
margin: auto auto 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-warning-info strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-warning-info button.disable-warning {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
background-color: transparent;
|
||||||
|
color: red;
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 0 auto;
|
||||||
|
width: fit-content;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-warning-info button.disable-warning:hover {
|
||||||
|
background-color: transparent;
|
||||||
|
color: var(--text-danger);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-warning-info button.disable-warning:active {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-danger {
|
||||||
|
color: var(--text-danger);
|
||||||
|
font-size: 1.4rem;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-normal {
|
||||||
|
color: var(--text-normal);
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-normal.margin-bottom {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-danger-background {
|
||||||
|
background-color: var(--button-danger-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-danger-background-no-margin {
|
||||||
|
background-color: var(--button-danger-background) !important;
|
||||||
|
color: var(--header-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-modal-close-button {
|
||||||
|
margin-left: auto !important;
|
||||||
}
|
}
|
|
@ -407,36 +407,27 @@ export function openWarningModal(plugin: Plugin, pluginModalProps: ModalProps, o
|
||||||
transitionState={warningModalProps.transitionState}
|
transitionState={warningModalProps.transitionState}
|
||||||
>
|
>
|
||||||
<ModalHeader separator={false}>
|
<ModalHeader separator={false}>
|
||||||
<Text style={{ flexGrow: 1, color: "var(--text-danger)", fontSize: "1.4rem", fontWeight: "bold" }}>Warning: Dangerous Action</Text>
|
<Text className="text-danger">Warning: Dangerous Action</Text>
|
||||||
<ModalCloseButton onClick={warningModalProps.onClose} />
|
<ModalCloseButton onClick={warningModalProps.onClose} className="vc-modal-close-button" />
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
<ModalContent>
|
<ModalContent>
|
||||||
<Forms.FormSection>
|
<Forms.FormSection>
|
||||||
<Flex className="vc-warning-info" style={{ gap: "15px", flexDirection: "column", userSelect: "none" }}>
|
<Flex className="vc-warning-info">
|
||||||
<img
|
<img
|
||||||
src="https://media.tenor.com/Y6DXKZiBCs8AAAAi/stavario-josefbenes.gif"
|
src="https://media.tenor.com/Y6DXKZiBCs8AAAAi/stavario-josefbenes.gif"
|
||||||
alt="Warning"
|
alt="Warning"
|
||||||
style={{ width: "60%", height: "auto", marginBottom: "10px", display: "block", margin: "auto" }}
|
|
||||||
/>
|
/>
|
||||||
<Text style={{ fontSize: "1.2rem", color: "var(--text-normal)" }}>
|
<Text className="text-normal">
|
||||||
You are about to reset all settings for <strong>{plugin.name}</strong> to their default values.
|
You are about to reset all settings for <strong>{plugin.name}</strong> to their default values.
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={{ fontSize: "1.2rem", color: "var(--text-danger)", fontWeight: "bold" }}>
|
<Text className="text-danger">
|
||||||
This action is irreversible.
|
This action is irreversible.
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={{ fontSize: "1.2rem", color: "var(--text-normal)", marginBottom: "10px" }}>
|
<Text className="text-normal margin-bottom">
|
||||||
If you are certain you want to proceed, click <strong>Confirm Reset</strong>. Otherwise, click <strong>Cancel</strong>.
|
If you are certain you want to proceed, click <strong>Confirm Reset</strong>. Otherwise, click <strong>Cancel</strong>.
|
||||||
</Text>
|
</Text>
|
||||||
{!Settings.ignoreResetWarning && (
|
{!Settings.ignoreResetWarning && (
|
||||||
<Button style={{
|
<Button className="disable-warning" onClick={() => {
|
||||||
fontSize: "0.8rem",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
color: "red",
|
|
||||||
cursor: "pointer",
|
|
||||||
margin: "0 auto",
|
|
||||||
width: "fit-content",
|
|
||||||
textDecoration: "underline"
|
|
||||||
}} onClick={() => {
|
|
||||||
Settings.ignoreResetWarning = true;
|
Settings.ignoreResetWarning = true;
|
||||||
}}>
|
}}>
|
||||||
Disable this warning forever
|
Disable this warning forever
|
||||||
|
@ -466,7 +457,7 @@ export function openWarningModal(plugin: Plugin, pluginModalProps: ModalProps, o
|
||||||
}}
|
}}
|
||||||
onMouseEnter={onMouseEnter}
|
onMouseEnter={onMouseEnter}
|
||||||
onMouseLeave={onMouseLeave}
|
onMouseLeave={onMouseLeave}
|
||||||
style={{ marginLeft: "10px", backgroundColor: "var(--button-danger-background)" }}
|
className="button-danger-background-no-margin"
|
||||||
>
|
>
|
||||||
Confirm Reset
|
Confirm Reset
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -429,35 +429,26 @@ export default function PluginSettings() {
|
||||||
{enabledPlugins.length > 0 && (
|
{enabledPlugins.length > 0 && (
|
||||||
<Button
|
<Button
|
||||||
size={Button.Sizes.SMALL}
|
size={Button.Sizes.SMALL}
|
||||||
style={{ backgroundColor: "var(--button-danger-background)", margin: "20px 0" }}
|
className="button-danger-background"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (Settings.ignoreResetWarning) return resetCheckAndDo();
|
if (Settings.ignoreResetWarning) return resetCheckAndDo();
|
||||||
|
|
||||||
return Alerts.show({
|
return Alerts.show({
|
||||||
title: "Disable All Plugins",
|
title: "Disable All Plugins",
|
||||||
body: (
|
body: (
|
||||||
<div style={{ textAlign: "center" }}>
|
<div className="alert-body">
|
||||||
<img
|
<img
|
||||||
src="https://media.tenor.com/Y6DXKZiBCs8AAAAi/stavario-josefbenes.gif"
|
src="https://media.tenor.com/Y6DXKZiBCs8AAAAi/stavario-josefbenes.gif"
|
||||||
alt="Warning"
|
alt="Warning"
|
||||||
style={{ width: "60%", height: "auto", marginBottom: "10px", display: "block", margin: "auto" }}
|
|
||||||
/>
|
/>
|
||||||
<p style={{ fontSize: "1.2rem", color: "var(--text-danger)", fontWeight: "bold" }}>
|
<p className="warning-text">
|
||||||
WARNING: You are about to disable <span style={{ textDecoration: "underline" }}>{enabledPlugins.length}</span> plugins!
|
WARNING: You are about to disable <span>{enabledPlugins.length}</span> plugins!
|
||||||
</p>
|
</p>
|
||||||
<p style={{ fontSize: "1rem" }}>
|
<p>
|
||||||
Are you absolutely sure you want to proceed? You can always enable them back later.
|
Are you absolutely sure you want to proceed? You can always enable them back later.
|
||||||
</p>
|
</p>
|
||||||
{!Settings.ignoreResetWarning && (
|
{!Settings.ignoreResetWarning && (
|
||||||
<Button style={{
|
<Button className="disable-warning" onClick={() => {
|
||||||
fontSize: "0.8rem",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
color: "red",
|
|
||||||
cursor: "pointer",
|
|
||||||
margin: "0 auto",
|
|
||||||
width: "fit-content",
|
|
||||||
textDecoration: "underline"
|
|
||||||
}} onClick={() => {
|
|
||||||
Settings.ignoreResetWarning = true;
|
Settings.ignoreResetWarning = true;
|
||||||
}}>
|
}}>
|
||||||
Disable this warning forever
|
Disable this warning forever
|
||||||
|
@ -466,6 +457,7 @@ export default function PluginSettings() {
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
confirmText: "Disable All",
|
confirmText: "Disable All",
|
||||||
|
confirmColor: "button-danger-background-no-margin",
|
||||||
cancelText: "Cancel",
|
cancelText: "Cancel",
|
||||||
onConfirm: () => {
|
onConfirm: () => {
|
||||||
resetCheckAndDo();
|
resetCheckAndDo();
|
||||||
|
|
|
@ -124,3 +124,66 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* disable all modal */
|
||||||
|
|
||||||
|
.button-danger-background {
|
||||||
|
background-color: var(--button-danger-background) !important;
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-danger-background-no-margin {
|
||||||
|
background-color: var(--button-danger-background) !important;
|
||||||
|
color: var(--header-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-danger-background:hover {
|
||||||
|
background-color: var(--button-danger-background-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-body {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-body img {
|
||||||
|
width: 60%;
|
||||||
|
height: auto;
|
||||||
|
display: block;
|
||||||
|
margin: auto auto 10px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-body p.warning-text {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
color: var(--text-danger);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-body p {
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-body span {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.disable-warning {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
background-color: transparent !important;
|
||||||
|
color: var(--text-danger) !important;
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 0 auto;
|
||||||
|
width: fit-content;
|
||||||
|
text-decoration: underline;
|
||||||
|
transition: color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.disable-warning:hover {
|
||||||
|
color: var(--text-danger);
|
||||||
|
background-color: transparent;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.disable-warning:active {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue