Skip to content

Commit

Permalink
fix custom markets view
Browse files Browse the repository at this point in the history
  • Loading branch information
CleanBread committed Oct 21, 2024
1 parent c2294c0 commit 84a84d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/compositions/events/Markets/Markets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const HeadMarket: React.FC<HeadMarketProps> = ({ market, conditionIndex, isOpen

const headMarket = {
...market,
outcomeRows: isOpen ? outcomeRows : [ outcomeRows[conditionIndex] ],
outcomeRows: isOpen ? outcomeRows : [ outcomeRows[conditionIndex].slice(0, 3) ],
}

return (
Expand Down Expand Up @@ -100,8 +100,8 @@ const Content: React.FC<ContentProps> = ({ marketsByKey, sortedMarkets }) => {
return <MarketsSkeleton />
}

const isDisabled = !Boolean(otherMarkets.length)
const headMarket = marketsByKey[activeMarket]
const isDisabled = !Boolean(otherMarkets.length) && headMarket.outcomeRows.length === 1 && headMarket.outcomeRows[0].length <= 3

const contentClassName = cx('w-full flex mb:border-transparent ds:p-2 border', {
'absolute bg-grey-10 overflow-y-auto no-scrollbar max-h-[20rem] border-grey-15 pb-2 z-30 rounded-md': isOpen && !isMobileView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Buttons: React.FC<ButtonsProps> = ({ rows }) => {
<div className="w-full">
{
rows.map((outcomes, index) => (
<div key={index} className={cx('grid gap-x-2 gap-y-3 w-full mt-2 first-of-type:mt-0', outcomes?.length === 3 ? 'grid-cols-3' : 'grid-cols-2')}>
<div key={index} className={cx('grid gap-x-2 gap-y-3 w-full mt-2 first-of-type:mt-0', outcomes?.length > 2 ? 'grid-cols-3' : 'grid-cols-2')}>
{
outcomes.map(outcome => (
<OutcomeButton
Expand Down

0 comments on commit 84a84d8

Please sign in to comment.