fix SettingsModal proportions

This commit is contained in:
plebbitor
2023-04-19 16:20:43 +02:00
parent a33d090553
commit d9168fa699
2 changed files with 19 additions and 4 deletions
+4
View File
@@ -23,6 +23,7 @@ const SettingsModal = ({ isOpen, closeModal }) => {
useError(errorMessage, [errorMessage]);
useSuccess(successMessage, [successMessage]);
const handleCloseModal = () => {
closeModal();
@@ -33,6 +34,7 @@ const SettingsModal = ({ isOpen, closeModal }) => {
}
};
const toggleExpanded = (index) => {
setExpanded((prevExpanded) => {
const newExpanded = [...prevExpanded];
@@ -45,6 +47,7 @@ const SettingsModal = ({ isOpen, closeModal }) => {
});
};
const expandAll = () => {
if (expanded.length === 3) {
setExpanded([]);
@@ -53,6 +56,7 @@ const SettingsModal = ({ isOpen, closeModal }) => {
}
};
useEffect(() => {
if (localStorage.getItem("cacheCleared") === "true") {
setSuccessMessage("Cache Cleared");
+15 -4
View File
@@ -4,8 +4,11 @@ import Modal from 'react-modal';
export const StyledModal = styled(Modal)`
.panel {
top: 60px;
width: 330px;
left: 50%;
width: 400px;
height: auto;
max-height: 80%;
left: calc(50% - 25px);
overflow-y: auto;
margin-left: -178px;
position: absolute;
padding: 2px 5px 5px;
@@ -13,6 +16,14 @@ export const StyledModal = styled(Modal)`
box-shadow: 0 0 5px rgba(0, 0, 0, .25);
}
@media (max-width: 768px) {
.panel {
width: 320px !important;
max-height: 60% !important;
left: calc(50% + 15px) !important;
}
}
.panel-header {
font-size: 16px;
font-weight: 700;
@@ -142,7 +153,7 @@ export const StyledModal = styled(Modal)`
background-color: currentColor;
position: absolute;
left: 28px;
top: 13px; /* Change this value according to your needs */
top: 13px;
}
.settings-input::after {
@@ -153,7 +164,7 @@ export const StyledModal = styled(Modal)`
background-color: currentColor;
position: absolute;
left: 28px;
top: 1px; /* Change this value according to your needs */
top: 1px;
}