Skip to content

Commit cf80b8a

Browse files
committed
simplifying the code
1 parent 99c9454 commit cf80b8a

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

frontend/web/components/GithubStar.tsx

+8-16
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,6 @@ const GithubStar: FC<GithubStarType> = ({}) => {
2929
return <></>
3030
}
3131

32-
if (!stars) {
33-
return (
34-
<a
35-
style={{ width: 90 }}
36-
target='_blank'
37-
href='https://github.com/flagsmith/flagsmith'
38-
className='btn btn-sm btn-with-icon text-body'
39-
rel='noreferrer'
40-
>
41-
<IonIcon style={{ fontSize: 16 }} icon={logoGithub} />
42-
</a>
43-
)
44-
}
45-
4632
return (
4733
<a
4834
style={{ width: 90 }}
@@ -51,9 +37,15 @@ const GithubStar: FC<GithubStarType> = ({}) => {
5137
className='btn btn-sm btn-with-icon text-body'
5238
rel='noreferrer'
5339
>
54-
<div className='d-flex flex-row justify-content-center align-items-center'>
40+
<div
41+
className={
42+
stars
43+
? 'd-flex flex-row justify-content-center align-items-center'
44+
: ''
45+
}
46+
>
5547
<IonIcon style={{ fontSize: 16 }} icon={logoGithub} />
56-
<div className='ms-1'>{stars}</div>
48+
{stars && <div className='ms-1'>{stars}</div>}
5749
</div>
5850
</a>
5951
)

0 commit comments

Comments
 (0)