generated from 202303-PRM-TR-FEW/capstone-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from 202303-PRM-TR-FEW/AMDJED
Amdjed
- Loading branch information
Showing
12 changed files
with
303 additions
and
166 deletions.
There are no files selected for viewing
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,19 @@ | ||
import React from 'react'; | ||
|
||
function CategoriesExpansion({categories}){ | ||
return ( | ||
<div className="flex justify-center"> | ||
<div className={`bg-white/25 mt-5 rounded-xl backdrop-blur-xl transition-all duration-300 ease-out focus:ease-in grid grid-cols-2 grid-rows-2 md:grid-cols-${categories.length} lg:grid-cols-${categories.length} md:grid-rows-1 cursor-pointer w-full`}> | ||
{categories.map((category, index) => ( | ||
<div key={index} | ||
className={`flex flex-col items-center px-1 py-3 m-2 rounded-lg shadow category-icon--container hover:bg-[#CBE1FA] hover:border-blue-500 border hover:text-[#2E8DFF] text-[#616161] bg-[#fbfbfb]`}> | ||
<div>{category.icon}</div> | ||
<p className={`text-sm font-bold`}>{category.name}</p> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default CategoriesExpansion; |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
'use client'; | ||
import { useTranslations } from "next-intl"; | ||
import React, { useState } from "react"; | ||
|
||
export default function MyLearningCard({ key, course, courseName, teacherName, percentage, image }) { | ||
const t = useTranslations("Home"); | ||
const [isBookmarked, setBookmarked] = useState([false, false]); | ||
const handleBookmarkClick = (index) => { | ||
const updatedBookmarks = [...isBookmarked]; | ||
updatedBookmarks[index] = !updatedBookmarks[index]; | ||
setBookmarked(updatedBookmarks); | ||
}; | ||
|
||
return ( | ||
<div key={key} className="shadow rounded-2xl lg:p-3 py-2 md:mr-2 h-auto relative flex flex-col"> | ||
<div className="flex"> | ||
<div className="mr-5 h-auto w-1/2 md:w-1/4 lg:w-1/2"> | ||
<img src={image} | ||
alt='Course Main Image' | ||
className="w-full h-32 ml-2 md:w-44 md:h-32 lg:w-44 lg:mt-1 lg:h-32 rounded-2xl" | ||
/> | ||
</div> | ||
<div className="w-full"> | ||
<h6 className="text-s lg:text-l font-bold break-words mt-1 md:mt-3 mb-1">{courseName}</h6> | ||
<p className="text-s lg:text-md text-zinc-600 mb-3">{teacherName}</p> | ||
<div className="bg-stone-200 h-3 w-11/12 rounded-lg"> | ||
<div className="bg-blue-500 h-full rounded-lg mt-3" style={{ width: `${percentage}` }}></div> | ||
<p className="font-bold text-zinc-500 mt-3">{percentage} {t('MyLearning.Complete')}</p> | ||
</div> | ||
|
||
</div> | ||
<div className="absolute top-0 right-0 m-2 cursor-pointer hidden md:block"> | ||
<div className={`flex justify-center items-center w-9 h-9 p-0 overflow-hidden text-blue-600 bg-gray-300 rounded-lg border-0 ${isBookmarked[course.bookMark] ? "opacity-100" : "opacity-25"}`} | ||
onClick={() => handleBookmarkClick(course.bookMark)}> | ||
<svg className="w-4 h-4 overflow-visible opacity-100 z-1 fill-current" viewBox="0 0 384 512"> | ||
<path d="M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z"></path> | ||
</svg> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="self-center mt-3 w-full md:hidden"> | ||
<div className={`flex justify-center items-center w-auto h-9 mx-2 overflow-hidden text-blue-950 bg-gray-300 rounded-lg border-0 ${isBookmarked[course.bookMark] ? "opacity-100" : "opacity-25"}`} | ||
onClick={() => handleBookmarkClick(course.bookMark)}> | ||
<p className="mr-2">{t('MyLearning.Save')}</p> | ||
<svg className="w-4 h-4 overflow-visible opacity-100 z-1 fill-current" viewBox="0 0 384 512"> | ||
<path d="M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z"></path> | ||
</svg> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
Oops, something went wrong.