Skip to content

Commit

Permalink
fix: sonar cloud issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bakaqc committed Feb 10, 2025
1 parent 50f1c7f commit 20115c3
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 26 deletions.
16 changes: 14 additions & 2 deletions src/components/learners/home/BrowseCategories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,83 +22,95 @@ import CategoryCard from './CatergoryCard';
export const BrowseCategories = () => {
const categories = [
{
id: 1,
icon: <HiChip />,
title: 'Label',
courseCount: '63,476',
bgColor: 'bg-violet-100',
iconColor: '#564FFD',
},
{
id: 2,
icon: <PiHandshakeDuotone />,
title: 'Business',
courseCount: '52,822',
bgColor: 'bg-green-100',
iconColor: '#22C55E',
},
{
id: 3,
icon: <PiCreditCardDuotone />,
title: 'Finance & Accounting',
courseCount: '33,841',
bgColor: 'bg-orange-50',
iconColor: '#F59E0B',
},
{
id: 4,
icon: <PiChartBarHorizontal />,
title: 'IT & Software',
courseCount: '22,649',
bgColor: 'bg-rose-50',
iconColor: '#E34444',
},
{
id: 5,
icon: <PiBugDroidBold />,
title: 'Personal Development',
courseCount: '20,126',
bgColor: 'bg-rose-100',
iconColor: '#E34444',
},
{
id: 6,
icon: <PiReceiptDuotone />,
title: 'Office Productivity',
courseCount: '13,932',
bgColor: 'bg-slate-100',
iconColor: undefined,
},
{
id: 7,
icon: <PiMegaphoneSimpleDuotone />,
title: 'Marketing',
courseCount: '12,068',
bgColor: 'bg-violet-100',
iconColor: '#564FFD',
},
{
id: 8,
icon: <PiCameraDuotone />,
title: 'Photography & Video',
courseCount: '6,196',
bgColor: 'bg-slate-100',
iconColor: undefined,
},
{
id: 9,
icon: <PiPackageDuotone />,
title: 'Lifestyle',
courseCount: '2,736',
bgColor: 'bg-orange-50',
iconColor: '#FD8E1F',
},
{
id: 10,
icon: <FiPenTool />,
title: 'Design',
courseCount: '2,600',
bgColor: 'bg-rose-100',
iconColor: '#FF6636',
},
{
id: 11,
icon: <PiFirstAidKitDuotone />,
title: 'Health & Fitness',
courseCount: '1,678',
bgColor: 'bg-green-100',
iconColor: '#23BD33',
},
{
id: 12,
icon: <PiHeadphonesDuotone />,
title: 'Music',
courseCount: '959',
Expand All @@ -120,8 +132,8 @@ export const BrowseCategories = () => {
</h2>
<div className="flex flex-col mt-10 max-md:max-w-full">
<div className="grid grid-cols-4 gap-6 max-md:grid-cols-1">
{categories.map((category, index) => (
<CategoryCard key={index} {...category} />
{categories.map((category) => (
<CategoryCard key={category.id} {...category} />
))}
</div>
</div>
Expand Down
14 changes: 12 additions & 2 deletions src/components/learners/home/ListCourseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import CourseCard from './CourseCard';
const ListCourseCard: React.FC = () => {
const courses = [
{
id: 1,
imageUrl: '/app/card-img-template.png',
category: 'Design',
price: '$57',
Expand All @@ -15,6 +16,7 @@ const ListCourseCard: React.FC = () => {
categoryTextColor: 'text-orange-800',
},
{
id: 2,
imageUrl: '/app/card-img-template.png',
category: 'Business',
price: '$45',
Expand All @@ -25,6 +27,7 @@ const ListCourseCard: React.FC = () => {
categoryTextColor: 'text-green-800',
},
{
id: 3,
imageUrl: '/app/card-img-template.png',
category: 'Finance',
price: '$65',
Expand All @@ -35,6 +38,7 @@ const ListCourseCard: React.FC = () => {
categoryTextColor: 'text-blue-800',
},
{
id: 4,
imageUrl: '/app/card-img-template.png',
category: 'Marketing',
price: '$50',
Expand All @@ -45,6 +49,7 @@ const ListCourseCard: React.FC = () => {
categoryTextColor: 'text-yellow-800',
},
{
id: 5,
imageUrl: '/app/card-img-template.png',
category: 'IT & Software',
price: '$70',
Expand All @@ -55,6 +60,7 @@ const ListCourseCard: React.FC = () => {
categoryTextColor: 'text-purple-800',
},
{
id: 6,
imageUrl: '/app/card-img-template.png',
category: 'Personal Development',
price: '$40',
Expand All @@ -65,6 +71,7 @@ const ListCourseCard: React.FC = () => {
categoryTextColor: 'text-pink-800',
},
{
id: 7,
imageUrl: '/app/card-img-template.png',
category: 'Health & Fitness',
price: '$55',
Expand All @@ -75,6 +82,7 @@ const ListCourseCard: React.FC = () => {
categoryTextColor: 'text-red-800',
},
{
id: 8,
imageUrl: '/app/card-img-template.png',
category: 'Music',
price: '$60',
Expand All @@ -85,6 +93,7 @@ const ListCourseCard: React.FC = () => {
categoryTextColor: 'text-orange-800',
},
{
id: 9,
imageUrl: '/app/card-img-template.png',
category: 'Photography',
price: '$75',
Expand All @@ -95,6 +104,7 @@ const ListCourseCard: React.FC = () => {
categoryTextColor: 'text-teal-800',
},
{
id: 10,
imageUrl: '/app/card-img-template.png',
category: 'Lifestyle',
price: '$35',
Expand All @@ -112,8 +122,8 @@ const ListCourseCard: React.FC = () => {
Best selling courses
</h2>
<div className="grid grid-cols-5 gap-6 max-md:grid-cols-1">
{courses.map((course, index) => (
<CourseCard key={index} {...course} />
{courses.map((course) => (
<CourseCard key={course.id} {...course} />
))}
</div>
</section>
Expand Down
8 changes: 6 additions & 2 deletions src/components/learners/home/ListCourseCardLandscape.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import CourseCardLandscape from './CourseCardLandscape';
const ListCourseCardLandscape: React.FC = () => {
const courses = [
{
id: 1,
imageUrl: '/app/card-img-template.png',
category: 'Productivity',
categoryBgColor: 'bg-slate-100',
Expand All @@ -21,6 +22,7 @@ const ListCourseCardLandscape: React.FC = () => {
duration: '6 hours',
},
{
id: 2,
imageUrl: '/app/card-img-template.png',
category: 'Design',
categoryBgColor: 'bg-blue-100',
Expand All @@ -35,6 +37,7 @@ const ListCourseCardLandscape: React.FC = () => {
duration: '8 hours',
},
{
id: 3,
imageUrl: '/app/card-img-template.png',
category: 'Marketing',
categoryBgColor: 'bg-green-100',
Expand All @@ -49,6 +52,7 @@ const ListCourseCardLandscape: React.FC = () => {
duration: '10 hours',
},
{
id: 4,
imageUrl: '/app/card-img-template.png',
category: 'Development',
categoryBgColor: 'bg-red-100',
Expand All @@ -70,8 +74,8 @@ const ListCourseCardLandscape: React.FC = () => {
Our feature courses
</h2>
<div className="grid grid-cols-2 gap-6 max-md:grid-cols-1">
{courses.map((course, index) => (
<CourseCardLandscape key={index} {...course} />
{courses.map((course) => (
<CourseCardLandscape key={course.id} {...course} />
))}
</div>
<Button className="flex gap-3 justify-center items-center px-6 text-base font-semibold tracking-normal leading-none text-orange-500 bg-white hover:bg-orange-50 focus:outline-none focus:ring-2 focus:ring-orange-500 mt-8 capitalize">
Expand Down
9 changes: 7 additions & 2 deletions src/components/learners/home/ListTeacherCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,39 @@ import TeacherCard from './TeacherCard';
const ListTeacherCard: React.FC = () => {
const teachers = [
{
id: 1,
avatarUrl: '/app/teacher-img-placeholder.png',
name: 'Alice Johnson',
major: 'Senior Developer',
rating: '4.8',
students: '1,200',
},
{
id: 2,
avatarUrl: '/app/teacher-img-placeholder.png',
name: 'Bob Smith',
major: 'Data Scientist',
rating: '4.7',
students: '950',
},
{
id: 3,
avatarUrl: '/app/teacher-img-placeholder.png',
name: 'Charlie Brown',
major: 'UX Designer',
rating: '4.9',
students: '1,500',
},
{
id: 4,
avatarUrl: '/app/teacher-img-placeholder.png',
name: 'Diana Prince',
major: 'Marketing Expert',
rating: '4.6',
students: '800',
},
{
id: 5,
avatarUrl: '/app/teacher-img-placeholder.png',
name: 'Evan Wright',
major: 'Project Manager',
Expand All @@ -49,8 +54,8 @@ const ListTeacherCard: React.FC = () => {
Top instructor of the month
</h2>
<div className="grid grid-cols-5 gap-6 max-md:grid-cols-1">
{teachers.map((teacher, index) => (
<TeacherCard key={index} {...teacher} />
{teachers.map((teacher) => (
<TeacherCard key={teacher.id} {...teacher} />
))}
</div>
<div className="flex gap-3 items-center mt-10 text-sm tracking-normal text-center">
Expand Down
22 changes: 21 additions & 1 deletion src/components/learners/teacher-profile/Comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ import { Star } from 'lucide-react';
import Image from 'next/image';
import React from 'react';

/*
* ======================================================================
* Copyright (C) 2025 - lzaycoe (Lazy Code)
* ======================================================================
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ======================================================================
*/

/*
* ======================================================================
* Copyright (C) 2025 - lzaycoe (Lazy Code)
Expand Down Expand Up @@ -58,7 +79,6 @@ interface CommentProps {
const Rating: React.FC<{ rating: number }> = ({ rating }) => (
<div
className="flex items-center"
role="img"
aria-label={`${rating} out of 5 stars rating`}
>
{Array.from({ length: 5 }, (_, index) => (
Expand Down
Loading

0 comments on commit 20115c3

Please sign in to comment.