Skip to content

Commit

Permalink
feat: adapt list size to number of visible lists
Browse files Browse the repository at this point in the history
  • Loading branch information
swouf committed Jan 9, 2023
1 parent a2da251 commit d0ddfb8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/main/tasks/TasksList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const TasksList: FC<TasksListProps> = ({
position: 'relative',
zIndex: 1,
boxShadow: isOver ? `0 0 1em ${theme.palette.primary.light}` : 'none',
maxWidth: '40em',
}}
key={label}
>
Expand Down
14 changes: 13 additions & 1 deletion src/components/views/TasksManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ const TasksManager: FC = () => {
[TASK_LABELS.COMPLETED]: false,
});

const numberOfColumnsInGridForVisibleList =
12 /
Object.values(hiddenLists).reduce(
(total, x) => (x === false ? total + 1 : total),
0,
);

const [activeTask, setActiveTask] = useState<ExistingTaskType | null>(null);

const filteredMembersSetting = appSettingArray.find(
Expand Down Expand Up @@ -182,7 +189,12 @@ const TasksManager: FC = () => {
unmountOnExit
style={{ height: 'auto' }}
>
<Grid item sm={12} md={4} height="100%">
<Grid
item
sm={12}
md={numberOfColumnsInGridForVisibleList}
height="100%"
>
<TasksList
title={title}
label={label}
Expand Down

0 comments on commit d0ddfb8

Please sign in to comment.