-
Notifications
You must be signed in to change notification settings - Fork 0
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 #24 from atlp-rwanda/187802122-bug-fix-landing-pag…
…e-fixing [finishes #187802122] bgfix-landing-page
- Loading branch information
Showing
19 changed files
with
435 additions
and
103 deletions.
There are no files selected for viewing
Empty file.
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 @@ | ||
20.11.0 |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,17 @@ | ||
const CategorySkeleton = () => { | ||
const skeletons = Array.from({ length: 7 }); | ||
|
||
return ( | ||
<div className="scroll-container flex flex-row gap-4 overflow-x-auto snap-x h-48"> | ||
{skeletons.map((_, index) => ( | ||
<div key={index} className="single-category flex justify-center gap-1 flex-col cursor-pointer relative w-56 p-4"> | ||
<div className="image-skeleton bg-gray-300 h-48 rounded-md animate-pulse shadow-xl"></div> | ||
<p className="text-skeleton bg-gray-300 h-6 w-3/4 mt-2 rounded-md animate-pulse text-grayColor">Loading</p> | ||
<div className="absolute inset-0 hover:bg-blackColor hover:bg-opacity-20 rounded-md"></div> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default CategorySkeleton; |
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,37 @@ | ||
import React from 'react'; | ||
import { FaStar, FaStarHalfAlt } from 'react-icons/fa'; | ||
import { CiStar } from 'react-icons/ci'; | ||
import { Review } from '../../types/Types'; | ||
|
||
interface RatingsProps { | ||
reviews: Review[]; | ||
} | ||
|
||
const StarRating: React.FC<RatingsProps> = ({ reviews }) => { | ||
// Calculate the average rating | ||
const calculateAverageRating = (reviews: Review[]): number => { | ||
if (reviews.length === 0) return 0; | ||
const totalRating = reviews.reduce((sum, review) => sum + review.rating, 0); | ||
return totalRating / reviews.length; | ||
}; | ||
|
||
const averageRating = calculateAverageRating(reviews); | ||
|
||
const renderStars = () => { | ||
const stars = []; | ||
for (let i = 1; i <= 5; i++) { | ||
if (averageRating >= i) { | ||
stars.push(<FaStar key={i} />); | ||
} else if (averageRating >= i - 0.5) { | ||
stars.push(<FaStarHalfAlt key={i} />); | ||
} else { | ||
stars.push(<CiStar key={i} />); | ||
} | ||
} | ||
return stars; | ||
}; | ||
|
||
return <div className="ratings flex">{renderStars()}</div>; | ||
}; | ||
|
||
export default StarRating; |
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
Oops, something went wrong.