From d4c2e6dfa22a52155d7176b0f278363cd39d28b2 Mon Sep 17 00:00:00 2001 From: Sabrina Kuah Date: Fri, 16 Apr 2021 11:27:42 -0700 Subject: [PATCH] Fix responsiveness on search card, #110 --- client/src/components/CommunityCard.js | 4 +- client/src/components/SearchResultCard.js | 87 ++++++++++------------- client/src/styles/_userCommunities.scss | 7 ++ client/src/views/dashboard/Dashboard.js | 2 + 4 files changed, 47 insertions(+), 53 deletions(-) diff --git a/client/src/components/CommunityCard.js b/client/src/components/CommunityCard.js index c8cabc5..9159a93 100644 --- a/client/src/components/CommunityCard.js +++ b/client/src/components/CommunityCard.js @@ -23,9 +23,7 @@ const CommunityCard = ({ community }) => { {community?.title} - - {community?.description} - +

{community?.description}

diff --git a/client/src/components/SearchResultCard.js b/client/src/components/SearchResultCard.js index ba0eb56..5872631 100644 --- a/client/src/components/SearchResultCard.js +++ b/client/src/components/SearchResultCard.js @@ -1,10 +1,4 @@ -import { - Card, - CardHeader, - CardContent, - Avatar, - IconButton, -} from '@material-ui/core'; +import { Card, CardHeader, Avatar, IconButton } from '@material-ui/core'; import FavoriteIcon from '@material-ui/icons/Favorite'; // import PeopleIcon from '@material-ui/icons/People'; import RoomIcon from '@material-ui/icons/Room'; @@ -17,51 +11,44 @@ const SearchResultCard = ({ community, handleJoinCommunity }) => { return ( - + + {community.title.slice(0, 1)} + + +
+ handleJoinCommunity(community._id)} + > + + + + setLiked(!liked)} > - {community.title.slice(0, 1)} - - } - action={ - <> - handleJoinCommunity(community._id)} - > - - + {liked ? ( + + ) : ( + + )} + +
+ +
{community.title}
+ +
+
+ {community?.location} +
+
- setLiked(!liked)} - > - {liked ? ( - - ) : ( - - )} - - - } - title={
{community.title}
} - subheader={ -
-
- {community.location} -
- {/*
- {' '} - {community.members.length} -
*/} -
- } - /> - {community.description} +

{community?.description}

); }; diff --git a/client/src/styles/_userCommunities.scss b/client/src/styles/_userCommunities.scss index c849502..93dde36 100644 --- a/client/src/styles/_userCommunities.scss +++ b/client/src/styles/_userCommunities.scss @@ -22,3 +22,10 @@ .create-com-button { @include brand-button-lg; } + +.comm-card-desc { + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; +} diff --git a/client/src/views/dashboard/Dashboard.js b/client/src/views/dashboard/Dashboard.js index f6f7361..7eb5034 100644 --- a/client/src/views/dashboard/Dashboard.js +++ b/client/src/views/dashboard/Dashboard.js @@ -15,6 +15,8 @@ const Dashboard = ({ children }) => { useEffect(() => { const communityId = location.pathname.substr(18, 35); + // console.log('community ID >>', communityId); + // console.log('location', location); communityId && (async () => { const response = await getCommunity({ id: communityId, token });