Skip to content

Commit

Permalink
Merge pull request #1720 from airqo-platform/analytics-home-page
Browse files Browse the repository at this point in the history
[analytics] Custom dropdown style issues
  • Loading branch information
Baalmart authored Nov 21, 2023
2 parents 7b62fd5 + 8bc55f9 commit 3f20ad5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
6 changes: 4 additions & 2 deletions platform/src/common/components/Dropdowns/CustomDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ const CustomDropdown = ({ trigger, children, className, id, dropdownWidth = '200
{React.cloneElement(trigger, { onClick: handleDropdown })}
{isOpen && (
<div
className={`absolute w-[${dropdownWidth}] mt-2 bg-white border border-gray-200 divide-y divide-gray-100 rounded-md shadow-lg z-50 ${className}`}
>
className={`absolute mt-2 bg-white border border-gray-200 divide-y divide-gray-100 rounded-md shadow-lg z-50 ${className}`}
style={{
width: dropdownWidth,
}}>
<div className='py-1'>{children}</div>
</div>
)}
Expand Down
15 changes: 0 additions & 15 deletions platform/src/common/components/Layout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { useDispatch, useSelector } from 'react-redux';
import { fetchUserChecklists } from '@/lib/store/services/checklists/CheckData';
import { updateCards } from '@/lib/store/services/checklists/CheckList';
import Head from 'next/head';
import { updateUserChecklists } from '@/lib/store/services/checklists/CheckData';

const Layout = ({ pageTitle = 'AirQo Analytics', children, topbarTitle, noBorderBottom }) => {
// Constants
Expand Down Expand Up @@ -96,20 +95,6 @@ const Layout = ({ pageTitle = 'AirQo Analytics', children, topbarTitle, noBorder

useEffect(fetchData, [dispatch, userInfo]);

// update user checklists when ever the cardCheckList changes
const updateUserChecklist = () => {
if (userInfo?._id) {
dispatch(
updateUserChecklists({
user_id: userInfo._id,
items: cardCheckList,
}),
);
}
};

useEffect(updateUserChecklist, [dispatch, userInfo, cardCheckList]);

useEffect(() => {
localStorage.setItem('collapsed', collapsed);
}, [collapsed]);
Expand Down

0 comments on commit 3f20ad5

Please sign in to comment.