Skip to content

Commit

Permalink
chore: remove redundant conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
olavis committed Feb 28, 2023
1 parent a4f6889 commit 925d5b4
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions web/src/common/components/VersionText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,21 @@ const useCommitInfo = () => {
return commitInfo
}

export const VersionText = (): JSX.Element => {
export const VersionText = () => {
const commitInfo = useCommitInfo()

return (
<p>
Version:{' '}
{commitInfo.hash !== '' && commitInfo.date !== '' && (
<>
<Typography
link
href={`https://github.com/equinor/template-fastapi-react/commit/${commitInfo.hash}`}
>
{commitInfo.refs === '' ? commitInfo.hash : commitInfo.refs}
</Typography>{' '}
({commitInfo.date})
</>
)}
<>
<Typography
link
href={`https://github.com/equinor/template-fastapi-react/commit/${commitInfo.hash}`}
>
{commitInfo.refs === '' ? commitInfo.hash : commitInfo.refs}
</Typography>{' '}
{commitInfo.date}
</>
</p>
)
}

0 comments on commit 925d5b4

Please sign in to comment.