Skip to content

Commit c3fd566

Browse files
committed
Merge branch 'development' of github.com:devvsakib/github-error-solve into development
2 parents 44780b4 + 83dcbde commit c3fd566

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/components/Error/ErrorSolutions.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function ErrorSolutions({ solutions }) {
1515
return (
1616
<ul id="scroll-solution">
1717
{solutions.split("<").map((solution, index) => (
18-
<li key={index} className="text-sm text-white break-all" >
18+
<li key={index} className="text-sm break-all" >
1919
{solution}
2020
</li>
2121
))}

src/components/Error/ErrorType.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function ErrorType({ type }) {
66
<span
77
className={`before:block mb-3 mt-1 top-2 left-2 h-4 before:absolute before:-inset-1 before:-skew-y-3 relative block before:bg-[${errorTypeColor}]`}
88
>
9-
<span className="relative text-white text-sm -top-1">{type}</span>
9+
<span className="relative text-sm -top-1">{type}</span>
1010
</span>
1111
);
1212
}

src/components/Error/ModalSolutions.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
import React from "react";
1+
import React,{ useContext } from "react";
22
import { MdKeyboardArrowLeft, MdContentCopy } from "react-icons/md";
33
import ErrorSolutions from "./ErrorSolutions";
44
import useColorBorderBox from "../../hooks/useColorBorderBox";
55
import ErrorType from "./ErrorType";
66
import Modal from "react-modal";
77
import toast from "react-hot-toast";
8+
import { ThemeContext } from '../../context/ThemeContext';
89

910
Modal.setAppElement("#root");
1011

1112
const ModalSolutions = ({ isOpen, setOpenModal, error }) => {
1213
const { errorTypeColor } = useColorBorderBox(error.type);
14+
const { theme } = useContext(ThemeContext);
15+
const overlayBackgroundColor = theme === 'dark'
16+
? 'rgba(0, 0, 0, 0.6)'
17+
: 'rgba(0, 0, 0, 0.2)';
1318

1419
return (
1520
<Modal
@@ -23,7 +28,7 @@ const ModalSolutions = ({ isOpen, setOpenModal, error }) => {
2328
id="main-div"
2429
style={{
2530
overlay: {
26-
backgroundColor: "rgba(0, 0 ,0, .6)",
31+
backgroundColor: overlayBackgroundColor,
2732
},
2833
content: {
2934
position: "fixed",

0 commit comments

Comments
 (0)