Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cookiecutter-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
m-team
ai
cookiecutter-web
Commits
1c3fd3df
Commit
1c3fd3df
authored
1 year ago
by
Christophe
Browse files
Options
Downloads
Patches
Plain Diff
fix(Template): replace fontawesome with lucide for cleaner half-star
parent
47e899ac
No related branches found
No related tags found
1 merge request
!10
Update ai4eosc branch with recent main (multiple templates)
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/components/templates/Template.tsx
+15
-10
15 additions, 10 deletions
frontend/components/templates/Template.tsx
frontend/package.json
+1
-0
1 addition, 0 deletions
frontend/package.json
frontend/yarn.lock
+5
-0
5 additions, 0 deletions
frontend/yarn.lock
with
21 additions
and
10 deletions
frontend/components/templates/Template.tsx
+
15
−
10
View file @
1c3fd3df
...
...
@@ -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
>
...
...
This diff is collapsed.
Click to expand it.
frontend/package.json
+
1
−
0
View file @
1c3fd3df
...
...
@@ -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"
,
...
...
This diff is collapsed.
Click to expand it.
frontend/yarn.lock
+
5
−
0
View file @
1c3fd3df
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment