-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test vue * new error added * doc indiv new page added
- Loading branch information
Showing
13 changed files
with
251 additions
and
84 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,5 +31,6 @@ | |
"pretty-quick": "^3.1.3", | ||
"tailwindcss": "^3.2.4", | ||
"vite": "^4.0.0" | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,46 @@ | ||
import React from 'react'; | ||
import Layout from '../components/Layout/Layout'; | ||
import DocItem from '../components/Doc/DocItem'; | ||
import { docs } from '../data/Doc.json'; | ||
const Doc = () => { | ||
console.log(docs) | ||
return ( | ||
<Layout> | ||
<div className='w-full md:w-5/6 mx-auto px-4 py-8'> | ||
<h3 className='text-3xl text-center mb-20'>Documents</h3> | ||
<div className="grid grid-cols-1 md:grid-cols-2 gap-8"> | ||
<div> | ||
<h4 className='mb-4'>Getting started</h4> | ||
<div className="items grid grid-cols-1 gap-6"> | ||
{ | ||
docs.filter(item => item.tag[0] == "popular").map((item, idx) => ( | ||
<DocItem | ||
key={idx} | ||
title={item.title} | ||
content={item.description} | ||
/> | ||
)) | ||
} | ||
</div> | ||
</div> | ||
<div> | ||
<h4 className='mb-4'>Popular</h4> | ||
<div className="items grid grid-cols-1 gap-6"> | ||
{ | ||
docs.filter(item => item.tag[0] == "popular").map((item, idx) => ( | ||
<DocItem | ||
key={idx} | ||
title={item.title} | ||
content={item.description} | ||
/> | ||
)) | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default Doc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { useParams } from "react-router-dom"; | ||
import Layout from "../../components/Layout/Layout"; | ||
import { docs } from '../../data/Doc.json'; | ||
import { useEffect, useState } from "react"; | ||
|
||
const SingleDoc = () => { | ||
const { doc_name } = useParams(); | ||
const [doc, setDoc] = useState({}); | ||
const [loading, setLoading] = useState(true); | ||
|
||
useEffect(() => { | ||
setLoading(true); | ||
const doc = docs.find(item => item.title.toLowerCase() === doc_name.split("_").join(" ")); | ||
setDoc(doc); | ||
setTimeout(() => { | ||
setLoading(false); | ||
}, 300); | ||
}, [doc_name]); | ||
|
||
return ( | ||
<Layout> | ||
<section className="px-5 md:px-10 min-h-screen"> | ||
<h3 className="text-2xl md:text-3xl capitalize text-center my-10 mb-20"> | ||
{doc_name.split("_").join(" ")} | ||
</h3> | ||
{ | ||
loading ? <p>Loading...</p> | ||
: | ||
<div className=""> | ||
<div> | ||
<div className=""> | ||
{ | ||
doc.tag.map((tag, index) => ( | ||
<span key={index} className="bg-primary text-white px-2 py-1 rounded-lg mr-2"> | ||
{tag} | ||
</span> | ||
)) | ||
} | ||
</div> | ||
<hr className="my-5" /> | ||
</div> | ||
<p className="text-justify">{doc.description}</p> | ||
</div> | ||
} | ||
</section> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default SingleDoc; |