Skip to content

Commit

Permalink
Merge branch 'development' of github.com:devvsakib/github-error-solve…
Browse files Browse the repository at this point in the history
… into development
  • Loading branch information
devvsakib committed Jul 28, 2024
2 parents 44780b4 + 83dcbde commit c3fd566
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Error/ErrorSolutions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function ErrorSolutions({ solutions }) {
return (
<ul id="scroll-solution">
{solutions.split("<").map((solution, index) => (
<li key={index} className="text-sm text-white break-all" >
<li key={index} className="text-sm break-all" >
{solution}
</li>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Error/ErrorType.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function ErrorType({ type }) {
<span
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}]`}
>
<span className="relative text-white text-sm -top-1">{type}</span>
<span className="relative text-sm -top-1">{type}</span>
</span>
);
}
Expand Down
9 changes: 7 additions & 2 deletions src/components/Error/ModalSolutions.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import React from "react";
import React,{ useContext } from "react";
import { MdKeyboardArrowLeft, MdContentCopy } from "react-icons/md";
import ErrorSolutions from "./ErrorSolutions";
import useColorBorderBox from "../../hooks/useColorBorderBox";
import ErrorType from "./ErrorType";
import Modal from "react-modal";
import toast from "react-hot-toast";
import { ThemeContext } from '../../context/ThemeContext';

Modal.setAppElement("#root");

const ModalSolutions = ({ isOpen, setOpenModal, error }) => {
const { errorTypeColor } = useColorBorderBox(error.type);
const { theme } = useContext(ThemeContext);
const overlayBackgroundColor = theme === 'dark'
? 'rgba(0, 0, 0, 0.6)'
: 'rgba(0, 0, 0, 0.2)';

return (
<Modal
Expand All @@ -23,7 +28,7 @@ const ModalSolutions = ({ isOpen, setOpenModal, error }) => {
id="main-div"
style={{
overlay: {
backgroundColor: "rgba(0, 0 ,0, .6)",
backgroundColor: overlayBackgroundColor,
},
content: {
position: "fixed",
Expand Down

0 comments on commit c3fd566

Please sign in to comment.