diff --git a/client/src/views/dashboard/Dashboard.js b/client/src/views/dashboard/Dashboard.js index 7eb5034..8a9b41a 100644 --- a/client/src/views/dashboard/Dashboard.js +++ b/client/src/views/dashboard/Dashboard.js @@ -10,17 +10,19 @@ const Dashboard = ({ children }) => { const [value, onChange] = useState(new Date()); const location = useLocation(); const USER_COMMUNITY_URL = '/user/communities'; + const USER_SEARCH_URL = '/user/communities/search'; const [token] = useLocalStorage('token'); const [community, setCommunity] = useState(null); useEffect(() => { const communityId = location.pathname.substr(18, 35); - // console.log('community ID >>', communityId); + console.log('community ID >>', communityId); // console.log('location', location); communityId && + communityId !== 'search' && (async () => { const response = await getCommunity({ id: communityId, token }); - console.log('community response', response.community); + console.log('community response', response?.community); setCommunity(response.community); })(); }, []); @@ -34,13 +36,15 @@ const Dashboard = ({ children }) => {
- {location.pathname !== USER_COMMUNITY_URL && ( - - )} + {location.pathname !== USER_COMMUNITY_URL && + location.pathname !== USER_SEARCH_URL && ( + + )} - {location.pathname !== USER_COMMUNITY_URL && ( - - )} + {location.pathname !== USER_COMMUNITY_URL && + location.pathname !== USER_SEARCH_URL && ( + + )}