Skip to content
Snippets Groups Projects
Commit 1c3fd3df authored by Christophe's avatar Christophe
Browse files

fix(Template): replace fontawesome with lucide for cleaner half-star

parent 47e899ac
No related branches found
No related tags found
1 merge request!10Update ai4eosc branch with recent main (multiple templates)
......@@ -3,31 +3,36 @@ import styles from './Template.module.scss';
import clsx from 'clsx';
import { Template as TemplateDto } from 'lib/client/models/template';
import Link from 'next/link';
import { faStarHalf } from '@fortawesome/free-solid-svg-icons';
import { faStarHalf as faStarHalfBorder } from '@fortawesome/free-regular-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import Badge from 'components/Badge';
import { StarHalf } from 'lucide-react';
type RatingProps = { score: number; className?: string };
const Rating: FC<RatingProps> = ({ score, className }) => {
const doubleScore = score * 2;
return (
<span className={className}>
<span className={clsx(className)}>
{[...Array(10)].map((_, i) => (
<span
key={i}
className={clsx('text-yellow-500', 'text-xl', 'inline', 'align-text-bottom')}
>
{i < doubleScore ? (
<FontAwesomeIcon
icon={faStarHalf}
className={clsx(styles['star'], i % 2 == 1 ? styles['flipped'] : false)}
<StarHalf
fill="currentColor"
className={clsx(
'inline',
styles['star'],
i % 2 == 1 ? styles['flipped'] : false
)}
/>
) : (
<FontAwesomeIcon
icon={faStarHalfBorder}
className={clsx(styles['star'], i % 2 == 1 ? styles['flipped'] : false)}
<StarHalf
className={clsx(
'inline',
styles['star'],
i % 2 == 1 ? styles['flipped'] : false
)}
/>
)}
</span>
......
......@@ -23,6 +23,7 @@
"clsx": "^1.2.1",
"eslint": "8.27.0",
"eslint-config-next": "13.0.3",
"lucide-react": "^0.279.0",
"next": "13.0.3",
"normalize.css": "^8.0.1",
"oidc-client-ts": "^2.2.0",
......
......@@ -1532,6 +1532,11 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"
lucide-react@^0.279.0:
version "0.279.0"
resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.279.0.tgz#05cdd709f3cc8b40846abf8929896ec75d684c2d"
integrity sha512-LJ8g66+Bxc3t3x9vKTeK3wn3xucrOQGfJ9ou9GsBwCt2offsrT2BB90XrTrIzE1noYYDe2O8jZaRHi6sAHXNxw==
merge2@^1.3.0, merge2@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment