fix: list component fixed (#162)
* fix: list component fixed * style: ran prettier * Update List.tsx * refactor: remove console log --------- Co-authored-by: Razboy20 <razboy20@gmail.com>
This commit is contained in:
@@ -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' />
|
||||
@@ -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} />
|
||||
|
||||
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user