Skip to content

Commit

Permalink
Fix Back to tournaments button rendering hexlet-codebattle#2017
Browse files Browse the repository at this point in the history
  • Loading branch information
akivonen committed Jan 11, 2025
1 parent 7b40f22 commit 0ae1f57
Showing 1 changed file with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function TournamentHeader({
'btn-secondary': !hasCustomEventStyle,
'cb-custom-event-btn-secondary': hasCustomEventStyle,
});
const backBtnClassName = cn('btn rounded-lg ml-lg-2 ml-md-2 mr-2', {
const backBtnClassName = cn('btn rounded-lg ml-lg-2 mr-2', {
'btn-primary': !hasCustomEventStyle,
'cb-custom-event-btn-primary': hasCustomEventStyle,
});
Expand All @@ -203,7 +203,7 @@ function TournamentHeader({
return (
<>
<div className="col bg-white shadow-sm rounded-lg p-2">
<div className="d-flex flex-column flex-lg-row flex-md-row justify-content-between">
<div className="d-flex flex-column flex-lg-row justify-content-between">
<div className="d-flex align-items-center pb-2">
<h2
title={name}
Expand Down Expand Up @@ -247,30 +247,27 @@ function TournamentHeader({
</div>
<div className="d-flex">
{!streamMode && (
!isOver ? (
<div className="d-flex justify-items-center pb-2">
{type !== 'team' && (
<div className="mr-2 mr-lg-0">
<JoinButton
isShow={state !== TournamentStates.active || type === 'arena'}
isShowLeave={!(type === 'arena' && state === TournamentStates.active)}
isParticipant={!!players[currentUserId]}
disabled={!isOnline || !isLive}
/>
</div>
)}
</div>
) : (
<div className="d-flex justify-items-center pb-2">
<div className="d-flex justify-items-center pb-2">
{!players[currentUserId] && (
<a
className={backBtnClassName}
href="/tournaments"
>
<FontAwesomeIcon className="mr-2" icon="undo" />
{i18next.t('Back to tournaments')}
</a>
</div>
)
)}
{type !== 'team' && !isOver && (
<div className="d-flex mr-2 mr-lg-0">
<JoinButton
isShow={state !== TournamentStates.active || type === 'arena'}
isShowLeave={type !== 'arena' || state !== TournamentStates.active}
isParticipant={!!players[currentUserId]}
disabled={!isOnline || !isLive}
/>
</div>
)}
</div>
)}
<div className="d-flex justify-items-center pb-2">
{canModerate && (
Expand Down

0 comments on commit 0ae1f57

Please sign in to comment.