Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: list component fixed #162

Merged
merged 5 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function CalendarHeader(): JSX.Element {

return (
<div className='min-h-79px min-w-672px w-full flex px-0 py-5'>
<div className='flex flex-row gap-20 w-full'>
<div className='w-full flex flex-row gap-20'>
<div className='flex gap-10'>
<div className='flex gap-1'>
<Button className='self-center' variant='single' icon={MenuIcon} color='ut-gray' />
Expand All @@ -57,7 +57,7 @@ export default function CalendarHeader(): JSX.Element {
</Text>
</div>
</div>
<div className='flex flex-row items-center justify-end space-x-8 ml-auto'>
<div className='ml-auto flex flex-row items-center justify-end space-x-8'>
<div className='flex flex-row space-x-4'>
<CourseStatus size='small' status={Status.WAITLISTED} />
<CourseStatus size='small' status={Status.CLOSED} />
Expand Down
9 changes: 4 additions & 5 deletions src/views/components/common/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ function List<T>(props: ListProps<T>): JSX.Element {

useEffect(() => {
// check if the draggables content has *actually* changed
if (props.draggables.every((element, index) => equalityCheck(element, items[index].content))) {
console.log("List's draggables have not changed");
if (
props.draggables.length === items.length &&
props.draggables.every((element, index) => equalityCheck(element, items[index].content))
) {
return;
}

console.log("List's draggables have changed, updating...");

setItems(wrap(props.draggables));
}, [props.draggables]);

Expand Down
Loading