Skip to content

Commit

Permalink
simplifying the code
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoapolo committed Jan 6, 2025
1 parent 99c9454 commit cf80b8a
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions frontend/web/components/GithubStar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@ const GithubStar: FC<GithubStarType> = ({}) => {
return <></>
}

if (!stars) {
return (
<a
style={{ width: 90 }}
target='_blank'
href='https://github.com/flagsmith/flagsmith'
className='btn btn-sm btn-with-icon text-body'
rel='noreferrer'
>
<IonIcon style={{ fontSize: 16 }} icon={logoGithub} />
</a>
)
}

return (
<a
style={{ width: 90 }}
Expand All @@ -51,9 +37,15 @@ const GithubStar: FC<GithubStarType> = ({}) => {
className='btn btn-sm btn-with-icon text-body'
rel='noreferrer'
>
<div className='d-flex flex-row justify-content-center align-items-center'>
<div
className={
stars
? 'd-flex flex-row justify-content-center align-items-center'
: ''
}
>
<IonIcon style={{ fontSize: 16 }} icon={logoGithub} />
<div className='ms-1'>{stars}</div>
{stars && <div className='ms-1'>{stars}</div>}
</div>
</a>
)
Expand Down

0 comments on commit cf80b8a

Please sign in to comment.