Skip to content

Commit

Permalink
hide show all hide button on campaign when you have not solved any. w…
Browse files Browse the repository at this point in the history
…astes space
  • Loading branch information
k2xl committed May 12, 2024
1 parent f7116e9 commit d808b54
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions components/formatted/formattedCampaign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,18 @@ export default function FormattedCampaign({
</div>
}
</div>
<div className='text-center mb-6'>
<FilterButton
element={<span className='text-base'>{filter === 'HIDE_SOLVED' ? 'Show All' : 'Hide Solved'}</span>}
first
last
onClick={() => setFilter(filter === 'HIDE_SOLVED' ? 'SHOW_ALL' : 'HIDE_SOLVED')}
selected={filter === 'HIDE_SOLVED'}
value={filter}
/>
</div>
{ solvedLevels > 0 &&
<div className='flex text-center mb-6 items-center gap-2 flex-col'>
<FilterButton
element={<span className='text-base'>{filter === 'HIDE_SOLVED' ? 'Show All' : 'Hide Solved'}</span>}
first
last
onClick={() => setFilter(filter === 'HIDE_SOLVED' ? 'SHOW_ALL' : 'HIDE_SOLVED')}
selected={filter === 'HIDE_SOLVED'}
value={filter}
/>
</div>
}
<div className='flex flex-col gap-12'>
{getOptions()}
</div>
Expand Down

0 comments on commit d808b54

Please sign in to comment.