Skip to content

Commit 20e05b9

Browse files
committed
reverted commit due to deploy issue
1 parent 44864bc commit 20e05b9

4 files changed

Lines changed: 70 additions & 18 deletions

File tree

src/App.jsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
1+
import { useState } from "react";
12
import "./index.css";
3+
<<<<<<< HEAD
24
import {
35
Routes,
46
Route
57
} from "react-router-dom";
68
import Doc from "./pages/Doc";
79
import Home from "./pages/Home";
10+
=======
11+
import Error from "./components/Error/Error";
12+
import Header from "./components/Header/Header";
13+
import SearchInput from "./components/Search/SearchInput";
14+
import Layout from "./components/Layout/Layout";
15+
>>>>>>> parent of 8d9c392 (pages created)
816

917
function App() {
18+
const [search, setSearch] = useState('')
19+
const [type, setType] = useState('')
1020
return (
21+
<<<<<<< HEAD
1122
<Routes>
1223
<Route path="/" element={<Home />} />
1324
<Route path="/Doc" element={<Doc />} />
1425
</Routes>
26+
=======
27+
<>
28+
<Layout>
29+
<SearchInput
30+
search={search}
31+
setSearch={setSearch}
32+
setType={setType}
33+
/>
34+
<Error
35+
search={search}
36+
type={type}
37+
/>
38+
</Layout>
39+
40+
</>
41+
>>>>>>> parent of 8d9c392 (pages created)
1542
);
1643
}
1744

src/components/Error/ErrorCard.jsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import ErrorSolutions from "./ErrorSolutions";
44
import ErrorType from "./ErrorType";
55

66
function ErrorCard({ error }) {
7-
7+
88
const [showSolution, setShowSolution] = useState(false);
99
const [errorTypeColor, setErrorTypeColor] = useState('#7e1aa5');
10-
const [readMore, setReadMore] = useState(false);
10+
const [readMore,setReadMore]=useState(false);
1111
useEffect(() => {
1212
if (error.type == "add") {
1313
return setErrorTypeColor("#4024e0");
@@ -31,16 +31,16 @@ function ErrorCard({ error }) {
3131
return (
3232
<div
3333
className={`py-4 mb-4 col-span-12 md:col-span-6 xl:col-span-4 px-2 md:px-6 border-l-4 rounded-lg items-start bg-dark-secondary flex flex-col ${item === "add"
34-
? "border-[#4024e0]"
35-
: item === "commit"
36-
? "border-[#1a5ba5]"
37-
: item === "merge"
38-
? "border-[#118d7c]"
39-
: item === "push"
40-
? "border-[#8d54e1]"
41-
: item === "branch"
42-
? "border-[#40E4F0]"
43-
: "border-[#7e1aa5]"
34+
? "border-[#4024e0]"
35+
: item === "commit"
36+
? "border-[#1a5ba5]"
37+
: item === "merge"
38+
? "border-[#118d7c]"
39+
: item === "push"
40+
? "border-[#8d54e1]"
41+
: item === "branch"
42+
? "border-[#40E4F0]"
43+
: "border-[#7e1aa5]"
4444
}`}
4545
>
4646
<h3 className="text-lg font-medium">{error.title}</h3>
@@ -53,11 +53,11 @@ function ErrorCard({ error }) {
5353
<ErrorSolutions solutions={error.solutions} />
5454
) : (
5555
<div className="h-fit">
56-
<p className="text-sm text-gray line-clamp-11 leading-relaxed">
57-
{readMore ? error.description : error.description.substring(0, 100)}
58-
{error.description.length > 100 ? <button onClick={() => { setReadMore(!readMore) }}>{readMore ? '...show less' : '...show more'} </button> : ''}
59-
</p>
60-
56+
<p className="text-sm text-gray line-clamp-11 leading-relaxed">
57+
{readMore ? error.description : error.description.substring(0,100)}
58+
{error.description.length > 100 ?<button onClick={()=>{setReadMore(!readMore)}}>{readMore ? '...show less': '...show more'} </button>:''}
59+
</p>
60+
6161
</div>
6262
)}
6363

src/main.jsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
import React from "react";
22
import ReactDOM from "react-dom/client";
33
import App from "./App";
4+
<<<<<<< HEAD
45
import { BrowserRouter } from "react-router-dom";
6+
=======
7+
import {
8+
createBrowserRouter,
9+
RouterProvider,
10+
} from "react-router-dom";
11+
import Doc from "./components/Doc/Doc";
12+
13+
/* Creating a router object that is used to render the correct component based on the url. */
14+
const router = createBrowserRouter(
15+
[
16+
{
17+
path: "/",
18+
element: <App />,
19+
},
20+
{
21+
path: '/doc',
22+
element: <Doc />
23+
}
24+
]
25+
);
26+
>>>>>>> parent of 8d9c392 (pages created)
527

628
ReactDOM.createRoot(document.getElementById("root")).render(
729
<BrowserRouter>

src/pages/doc.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<<<<< HEAD
12
import React from 'react'
23
import Layout from '../components/Layout/Layout'
34
import DocCard from '../components/Docs/DocCard'
@@ -9,4 +10,6 @@ const Doc = () => {
910
)
1011
}
1112

12-
export default Doc
13+
export default Doc
14+
=======
15+
>>>>>>> parent of 8d9c392 (pages created)

0 commit comments

Comments
 (0)