Skip to content

Commit f3405d4

Browse files
Adding Cards Feature
1 parent a5a7471 commit f3405d4

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

React-Cards-Layout/src/components/CardDetail.jsx

100644100755
+10-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ const CardDetail = () => {
1818

1919
return (
2020
<>
21-
<main className='bg-red-50 min-w-screen min-h-screen p-5'>
22-
<article className='border-2 p-4 rounded-2xl min-h-screen ' >
23-
<p> Post Count: {post.id}</p>
24-
<h1 className='text-center font-black text-3xl' >{post.tittle}</h1>
25-
<h1 className='text-center mt-4' >{post.Content}</h1>
26-
<button onClick={()=>navigate('/')} className=' text-white font-black bg-sky-700 px-4 py-2 mt-5 rounded hover:bg-sky-600 cursor-pointer' >Go Back!</button>
27-
</article>
21+
<main className='bg-sky-200 min-w-screen min-h-screen'>
22+
<section className='bg-blue-500 min-h-screen p-5 flex items-center justify-center ' >
23+
<article className='p-5 bg-red-400 ' >
24+
<p className='mb-5 font-black' > Post Id : {post.id}</p>
25+
<img className='w-full h-80 ' src={post.img} alt="Content-image" loading='lazy' />
26+
<h1 className='font-bold text-3xl mt-5 text-black' >{post.tittle}</h1>
27+
<p className='text-2xl font-mono pt-2 pb-5' >{post.Content}</p>
28+
<button onClick={()=>navigate('/')} className='rounded hover:bg-sky-900 cursor-pointer bg-sky-800 text-white px-4 py-2 ' >|Back...|</button>
29+
</article>
30+
</section>
2831
</main>
2932
</>
3033
)

React-Cards-Layout/src/components/Cards.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Cards = () => {
1010

1111
const handleReadPost = (id)=>{
1212
navigate(`/post/${id}`)
13-
console.log(id)
13+
console.log("post id:",id)
1414
}
1515

1616
useEffect(()=>{

React-Cards-Layout/src/components/CardsData.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const cardsData = [
3636
img: "https://random-image-pepebigotes.vercel.app/api/random-image",
3737
tittle: "I am Creating a Card title",
3838
description: " this is an cards descriptiongraph Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias modi, facere sequi architecto minus eum iste dolores quod aut corrupti!",
39-
link:"/ReadPost/id",
39+
link:`/ReadPost//id`,
4040
Content:"While children are struggling to be unique, the world around them is trying all means to make them look like everybody else."
4141
},
4242
{
@@ -98,5 +98,4 @@ const cardsData = [
9898
},
9999
]
100100

101-
102101
export default cardsData;

0 commit comments

Comments
 (0)